
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:

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)

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)
participants (2)
-
Eleftherios Garyfallidis
-
Nino