[vtk-developers] [vtkusers] vtkLookUpTable, what am I doing wrong?

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Wed May 2 02:40:31 EDT 2001


hi,

>>>>> "JH" == Julian Humphries <julian at essaustin.com> writes:

    JH> Hi, I am using a recent vtkNightly release on Win2k with
    JH> python (1.5).  The following code doesn't behave as I expect:
    JH> I thought I was building a LUT with a simple linear grayscale
    JH> value range of 0 to 1.

    JH> table = vtkLookupTable() table.SetTableRange(0,255)
    JH> table.SetValueRange(0.0,1.0) table.SetSaturationRange(0.0,0.0)
    JH> table.SetHueRange(0.0,0.0) table.SetAlphaRange(0.0,0.0)
    JH> table.SetNumberOfColors(256) table.Build()

This seems correct, except you should use an alpha range of 1.0, 1.0
(which is the default).  

    JH> However, the resulting table starts off with the first 16
    JH> entries listed below This is not what I wanted. When applied
    JH> to any grayscale image this LUT should change nothing (or at
    JH> least that is what I want, as in later code I will be changing
    JH> the min and max table range values to change image leveling).

I notice the same problem that you report with both vtk3.2, vtknightly
on Linux (i.e. the first 10 or so entries are all zero, also there are
lots of repeated values).  I am not an expert on this but maybe it is
because floats are being used in vtkLookupTable.cxx::Build() ?
Should'nt this be a bad bug (after all scalar colouring is so
important)?  I looked at the code briefly but dont understand much of
it.

prabhu




More information about the vtk-developers mailing list