[vtkusers] Problem with vtkLookupTable

Miguel Sotaquira msotaquira at gmail.com
Fri Mar 30 13:29:06 EDT 2012


Hi Sandra,

Maybe you have to rescale your image (using vtkImageShiftScale) after
resampling with vtkResample, so as to ensure that pixels' type is unsigned
char.

Miguel

On Fri, Mar 30, 2012 at 6:23 PM, Hikaruchan
<Sandra.Schroetter.fl at ait.ac.at>wrote:

> Hi everyone!
>
> I have a little Problem with my vtkLookupTable, and I don't know why. I
> have
> a Lookuptable with 256 colors, but after rendering my actor it seems that
> the image which is rendered to the screen and was mapped through the
> lookuptable only something about eight colors (it only looks like that).
> And
> I don't get it, where I make my mistake. Hope you can help me or give me a
> hint.
>
> I have attached two images. The first one (HowItIsNow.jpg), shows the
> actual
> result. You can see that it seems, that there are not 256 colors.
>
> http://vtk.1045678.n5.nabble.com/file/n5607138/HowItIsNow.jpg
>
> The second one (HowIWouldLikeIt.jpg) shows the result, which I want to
> have.
> The two images are based on the same data, the second is a result in MATLAB
> the first in VTK. Maybe you can give me a hint how to get the image in VTK
> like the second image shown (done in Matlab).
>
> http://vtk.1045678.n5.nabble.com/file/n5607138/HowIWouldLikeIt.jpg
>
> My Pipeline is as follows:
>
> vtkImageData -> filled via frequencyDataIma->GetScalarPointer() with
> unsigned char
> vtkLookupTable -> 256 colors
> vtkResample -> for resizing the image (make it bigger)
> vtkImageMapToColors -> the lookuptable is applied to it and the
> resample->Output() is the Input for it
> vtkImageMapper -> Input is the Output of the vtkImageMapToColors
> vtkActor2D -> input is the mapper
>
>
>
> Greets
>
> Sandra
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Problem-with-vtkLookupTable-tp5607138p5607138.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120330/54c616e9/attachment.htm>


More information about the vtkusers mailing list