Hi Eleftherios,

Thank you for your answer. It helped me a lot to understand how to create the color maps that I needed.
My real problem was that I am very new in python and I did not (and still don’t) know how to store the arrays for the colours to feed the renderer with them.
Maybe the solution hat I implemented is naive but it works the way I intended, which is colouring the elements of each streamline according to their local orientation.

The piece of code that does that is below. I am attaching as well some examples of the images that I produced.

Thank you very much,
Nino



colors = [np.random.rand(*streamline.shape) for streamline in bundle_native]
for i, streamline in enumerate(bundle_native):
vs = abs(streamline[1:len(streamline)]-streamline[0:len(streamline)-1])
for k, r in enumerate(vs):
vs[k] = r/max(r)
colors[i][0] = vs[0]
colors[i][1:len(colors[i]),:] = vs

scene.clear()
stream_actor_rgb = actor.line(bundle_native, colors, linewidth=0.1)
scene.add(stream_actor_rgb)
window.show(scene, size=(600, 600), reset_camera=False)




On 7 Sep 2021, at 21.51, Eleftherios Garyfallidis <elef@indiana.edu> wrote:

Hi Enedino, 

Thank you for your question. You can build the colors that you want. Just create a 2D array with as many RGB values as the number of points
of the streamlines and provide that array as a parameter in actor.line.

Have in mind that there is no right or wrong way to color streamlines. Every software has different preferences.
We use the average orientation around the middle point of the streamline to color it. However, we do provide ways for people to
build their own colors as explained above.

Let us know how you progress. Be happy to use DIPY's chatroom at https://gitter.im/dipy/dipy to post your code solution.
You can get faster feedback there because FURY's bundle visualization is used primarily in DIPY.

Best regards,
Eleftherios



On Thu, Sep 2, 2021 at 10:27 PM Nino <ninoht@drcmr.dk> wrote:
To whom it may concern.

My name is Enedino Hernández and I am working at the DRCMR in Copenhaguen K on a quality assurance of fibre tracts in my DTI analysis.
I have a question regarding the colouring of the tracts using fury. In your documentation (snapshot attached) it is mentioned that it is possible to create a streamline with orientation colouring. However, in the example the streamlines pointing upwards should change color, I would expect a combination of blue and green, instead of only green. I would expect similarly a change in colour for the fibres curbing in downwards direction.
Is there a way to use the local orientation of the fibre elements to produce the correct local orientation colouring?

Thank you very much in advance for your attention.
With kind regards,
Enedino Hernández, PhD



<tracF.png>