I have a question regarding the editing/ painting of volumes. I would like to craft a color-version of my CT scan and ideally, I would like to follow the following workflow:
Load a scan (grayscale)
Load a colortable to translate the grayscale values to colors
Create a new colorvolume from scan+colortable
Edit the colors in the colorvolume using a paint tool.
I experimented a bit with the Volume and Editor module. But I can not get it to work. I can create an empty label node, but that one is not filled with colors coming from the colortable I selected in Volumes. In the Editor module itself I am only able to select a couple of predefined colors, there is no colorpicker.
Does anybody have any hits or a different approach to the coloring of scans?
You can easily achieve all this using Segment Editor module. Threshold effect can be used to assign segments (colored regions) to a grayscale range. If you have many segments then you can automate segment creation by 10-20 lines of Python code - see “skin surface extraction” example in script repository.
Yesterday I thought of another approach: what about iterating the voxel array and sampling the displayNode colorMapper to get a color value. Then for each voxel I can write its colorvalue to a labelmap or some other format that can store rgb values?
In the end I would like to have a color volume that represents color, not grayscale. I would like to use it as a 3DTexture for rendering in OpenGL or Direct3D.
For this purpose, a color lookup table is the appropriate solution. It is much more efficient in term of storage space and rendering speed and much more flexible (you can change color/opacity on-the-fly).