[vtkusers] How to get the pixels of a volume rendered image?

Wilf Rosenbaum wilf.rosenbaum at gmail.com
Mon Mar 20 14:36:03 EDT 2017


Hi Guys,
  VTK noob here. Ignorant, but (hopefully) not stoopid.

  I am interested in creating a volume rendering (VR) of a volumetric
medical (CT) dataset, and then getting access to the pixel values of that
volume rendering image. I can follow along with the SmartVolumeMapper
example from the VTK examples website, which creates the VR for my dataset
but displays the result in a vtkRenderWindow. Right now I don't want to
display the VR image, I just want to get the pixel values and do something
with them - pass them to a 3rd party program for instance. I understand
that I could use a vtkWindowToImageFilter to convert the data in my
RenderWindow to an image, but intuitively this seems like a rather
circuitous route to get what I want. I suspect that there is a more direct
standard vtk workflow.

  I know that if I was interested in an orthogonal or an oblique slab
through my volume I can create a pipeline like

     vtkDicomImageReader -> vtkImageReslice -> vtkImageMapToColors

and then call GetOutput() -> GetScalarPointer() on the vtkImageMapToColors
object to get the pixels of the slab - no RenderWindow is required. Is
there something analogous for volume rendering?

If the real answer to my question is "create a hidden render window, render
the volume into that hidden render window and then use a Window to Image
Filter to get the image" then I am fine with that but I feel like I don't
know enough about VTK yet to know for sure.

Finally, please free to suggest some terms to google. I am happy to do more
research, but I feel like I need to be pointed in the right direction. I am
already looking into "vtk render to frame buffer" , "vtk render to image",
"vtk offscreen rendering", ...

Thanks very much!
Cheers,
Wilf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170320/bb4f85b1/attachment.html>


More information about the vtkusers mailing list