[vtkusers] How to convert vtkVolume to vtkImageData?

David Gobbi david.gobbi at gmail.com
Tue Jul 20 18:09:50 EDT 2010


This is "almost" a trivial thing to do.  With vtkImageMapToColors, you
can do this:

vtkImageMapToColors::SetLookupTable(vtkColorTransferFunction)

So, you can use ImageMapToColors to map an image to exactly the same
colors that you get when you do a volume rendering.  However, the
vtkColorTransferFunction does not do opacity, only colors -- the
opacity is handled by a separate vtkPiecewiseFunction (the fact that
the vtkColorTransferFunction doesn't include the alpha channel is
something that I consider to be a flaw in VTK.)

So, unless I am mistaken, if you want to map a vtkImageData through a
piecewise opacity function, you will have to find a creative way of
doing so.

  David


On Tue, Jul 20, 2010 at 3:03 PM, Jothy <jothybasu at gmail.com> wrote:
> Hi all,
>
> Is there any way to convert vtkVolume to vtkImageData after volume rendering
> using composite function?
>
> Actually I need to get the opacity values from each voxel (alpha).
>
> Any help would be highly appreciated!
>
>
> Thank you
>
> Jothy
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list