# How to change color of fudicial and line?

**URL:** https://discourse.slicer.org/t/how-to-change-color-of-fudicial-and-line/18849
**Category:** Development
**Tags:** python, markups
**Created:** [July 21, 2021, 10:17am UTC](https://discourse.slicer.org/t/how-to-change-color-of-fudicial-and-line/18849 "2021-07-21T10:17:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Guillaume](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@Guillaume](https://discourse.slicer.org/u/Guillaume)
#### Post date: [July 21, 2021, 10:17am UTC](https://discourse.slicer.org/t/how-to-change-color-of-fudicial-and-line/18849/1 "2021-07-21T10:17:39Z")

</div>

Hello, I still have a problem …  
Well I need to change the color of the fudicial, I saw that it was possible but I do not know why, I am blocking with … I have already tried something but without success.

```auto
    viridis = cm.get_cmap('viridis', 8)
    nbClust = -1

    if len(points) != 0:
      for i in range(len(points)):
        if points['nbClust'][i] != nbClust:
          nodeName = f"Cluster {nbClust+2}"
          markupsNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsFiducialNode", nodeName)
          markupsNode.CreateDefaultDisplayNodes()

        nbClust=points['nbClust'][i]
        pos = [points['p1z'][i], points['p1y'][i], points['p1x'][i]]  

        markupsNode.AddFiducialFromArray(pos, 'point')

        # --------- Couleur ----------
        color = points['volume'][i]/100
        color = viridis(color)

        # color = (r, g, b, a)
        '''
          points = {
                    'p1x': p1[0],
                    'p1y': p1[1],
                    'p1z': p1[2],
                    'volume': volume,
                    'nbClust': nbClust,
                    'red': color[0],
                    'blue': color[1],
                    'green': color[2],
                }
             '''

```

So i need to display a part of point with the color.

In addition, I also need to change the color of the lines but hey, there I found nothing.

Thank’s for your help !

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [July 21, 2021, 1:02pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-fudicial-and-line/18849/3 "2021-07-21T13:02:05Z")

</div>

Would you like to display each fiducial point with a different color?

---

<div class="post-metadata">

### Author: ![Guillaume](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@Guillaume](https://discourse.slicer.org/u/Guillaume)
#### Post date: [July 21, 2021, 1:03pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-fudicial-and-line/18849/4 "2021-07-21T13:03:57Z")

</div>

No, not especially, I have point clusters registered in different suites. And each suite must have a different color.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [July 21, 2021, 1:16pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-fudicial-and-line/18849/5 "2021-07-21T13:16:28Z")

</div>

You can use two colors in one markups fiducial list - selected and unselected. See example for setting color [here](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#change-markup-fiducial-display-properties). API reference is available [here](https://apidocs.slicer.org/master/classvtkMRMLMarkupsFiducialDisplayNode.html) - color setting methods are in “Public member functions inherited from vtkMRMLDisplayNode” section.

---

<div class="post-metadata">

### Author: ![Guillaume](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@Guillaume](https://discourse.slicer.org/u/Guillaume)
#### Post date: [July 21, 2021, 1:18pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-fudicial-and-line/18849/6 "2021-07-21T13:18:21Z")

</div>

Oh yes, thank you but I forgot to precise that I work with the 14.11 version.

EDIT:  
Finally it works. Great ! Thank you ! But, why I can’t find “SetSelectedColor” in [Slicer: vtkMRMLMarkupsFiducialDisplayNode Class Reference](https://apidocs.slicer.org/master/classvtkMRMLMarkupsFiducialDisplayNode.html) ?
