1

I'm trying to overlay several NRRD (volume) files to show ROIs etc on top of a volume. Is there a way to set the color of a volume to, say, red? Any suggestions on approaching this?

Thanks

1 Answers1

0

XTK supports 1 volume and 1 label map together.

You probably want to do the following like in this lesson: http://jsfiddle.net/gh/get/library/pure/xtk/lessons/tree/master/11/#run

The colored overlays is the labelmap which maps the scalar values of a .nrrd file to colors using a color table. This example uses the 3D Slicer colortable but it also works with the Freesurfer colortable.

If you have multiple .nrrd files containing each one label, you first have to add them to load them as one label map. Then, you can write your own colortable or use a standard one to colorize the label map.

Color tables have the following format:

0 background 0 0 0 0
1 tissue 128 174 128 255
2 bone 241 214 145 255
3 skin 177 122 101 255
4 connective_tissue 111 184 210 255

So scalar value, some name, r, g, b, a

haehn
  • 967
  • 1
  • 6
  • 19
  • The api doc for Volume seems to indicate that the method setColor(r,g,b) is available for Volume, but it doesn't seem to work. Wouldn't it be useful to support this method? – user1390021 Jun 01 '12 at 15:15
  • yes, the API docs seem to be old right now. they need to be updated. anyway, what do you want to do? setting a color for a volume is something new to me - I always used colortables to map intensity scalars to colors but you want to set a whole volume to a static color? – haehn Jun 02 '12 at 12:06
  • Image viewing tools such as MRICRON, allow you to overlay several images and set color to each image individually. The color schemes can be a simple color or a lookup table. I thought it'd nice to do the same. – user1390021 Jun 02 '12 at 15:21
  • I see, yes we can add a linear gradient for volumes.. Can you add an issue for that on github? Thx. – haehn Jun 03 '12 at 15:54
  • Does the use of a color table require a separate label map? Is there no way to directly map scalars in a volume to rgba values? – A.E. Drew Mar 18 '14 at 16:46