[vtkusers] Coloring subvolumes
Sankhesh Jhaveri
sankhesh.jhaveri at kitware.com
Tue Jan 10 10:18:20 EST 2017
Hi John,
I don’t think its possible to directly apply the color transfer function to
a sub-volume.
You can use the label map mask to achieve the desired results. An example
is provided as a test for composite mask blend
<https://gitlab.kitware.com/vtk/vtk/blob/a1e7fab2ae19f86e9b1f8b97ca53329227f53161/Rendering/Volume/Testing/Cxx/TestGPURayCastCompositeMaskBlend.cxx>.
You would have to create the mask volume based on the sub-volume of
interest and set the mask color function and mask blend factor accordingly.
Alternatively, you could use multi-component support of the volume mapper.
You can create a new vtkImageData from your slices with two components. The
first component would be your whole volume with voxels in the sub-volume
set to a value that would be transparent in the opacity transfer function.
The second component would consist of non-transparent values on voxels in
the sub-volume region. Finally, setting two different color transfer
functions (one for each component) would do the trick. Make sure to set the
components as independent in the volume property.
Hope that helps.
Sankhesh
On Mon, Jan 9, 2017 at 4:43 PM Tatarowicz, John <tatarowiczj at battelle.org>
wrote:
> Hello All-
>
>
>
> I’m a relatively new user to the VTK toolkit. I am currently rendering
> medical CT data which has a color transfer function applied for the whole
> scan. Suspect masses in the scan have bounding boxes (vtkBoxWidget)
> defined around them. I would like to be able to toggle a change in their
> colorization (to and from red) in order to highlight possible cancerous
> masses. Is it possible to change the color transfer function only in a
> subvolume such that a predefined CT number range has its color changed to
> red? I would just change the color transfer function for the defined CT
> number range over the whole scan, but I want to only highlight objects in
> the predefined suspect areas.
>
>
>
> Cheers,
>
> John Tatarowicz
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
--
Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware
<http://www.kitware.com/> | (518) 881-4417
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170110/fbbb9a76/attachment.html>
More information about the vtkusers
mailing list