[vtkusers] How to convert vtkVolume to vtkImageData?

David Gobbi david.gobbi at gmail.com
Fri Jul 23 11:53:18 EDT 2010


Yes, it would, but you can't use an opacity transfer function with
vtkImageMapToColors.  It needs either a vtkLookupTable or a
vtkColorTransferFunction.  It cannot use a vtkPiecewiseFunction.  So
you would have to e.g. convert the opacity function into a lookup
table.

   David


On Fri, Jul 23, 2010 at 9:48 AM, Jothy <jothybasu at gmail.com> wrote:
> If I use a grayscale instead of a RGB vtkLookupTable and if I set the
> opacity transfer function, won't the final colors corelate with the opacity
> values.
>
> Thanks,
>
> Jothy
>
> On Tue, Jul 20, 2010 at 11:09 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>>
>> 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