[vtkusers] Why is the image red?

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 14 16:56:14 EST 2009


David D,

Print your image. Its scalar type is double. You need a lookup table
because no one knows what a 0.0 color is. If it were unsigned char:

 image->SetScalarTypeToUnsignedChar();

it will be black.

Bill

On Mon, Dec 14, 2009 at 4:09 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Mon, Dec 14, 2009 at 3:58 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>> The class vtkImageMapToColors can apply a lookup table to a whole
>> image.  As for vtkTexture, it has a set of rules that control when it
>> applies a lookup table, just like vtkMapper does.  Really, vtkTexture
>> is, itself, very much like a mapper.  The rules for how vtkTexture
>> maps the input data into something that can be used by the hardware
>> are described in the class documentation.
>>
>>   David
>
> David G,
>
> I was looking here:
> http://www.vtk.org/doc/nightly/html/classvtkTexture.html#_details and
> I still don't see anything about the rules it uses?
>
> I checked this:
>
> vtkstd::cout << "Map through LUT? " <<
> myTexture->GetMapColorScalarsThroughLookupTable () << vtkstd::endl;
>
> and it is 0, so that should mean that the image should be displayed
> based on its actual RGB values, right? I must still be
> misunderstanding.
>
> Thanks,
>
> David D.
> _______________________________________________
> 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