[vtkusers] Should the 5.0 branch be used instead of HEAD? (Was: A bug in vtkImageMapToColors?)

Kalle Pahajoki kalpaha at st.jyu.fi
Tue Sep 13 13:33:23 EDT 2005


Kalle Pahajoki wrote:

> Hi
>
> I've recently noticed a strange behaviour in my software that I've got 
> the behaviour repeated with the attached piece of code. In short, the 
> output from vtkImageMapToColors is very odd. Sometimes some scalars 
> (could be around range 200-255 or so) are mapped to black. Other times 
> they are colored in weird colors that do not come from the ctf.
>

I was too quick to pronounce this working in Linux.The installation I 
tested it with had been tagged to an older version. With the newest 
version, it does fail on linux too. Adding the explicit Update() Prabhu 
suggested didn't help either.

I tracked the problem down to 
vtkColorTransferFunction::vtkColorTransferFunctionMapData  (that 
vtkImageMapToColors uses), in particular
the line:

    const unsigned char *table = self->GetTable(0,255,256);

produces a table where only the first 84 entries are filled.

Browsing the CVS online, vtkColorTransferFunction tagged VTK-5-0 is a 
version that I know will work correctly. I've never  ran into problems 
with using the CVS before, so this is a new situation for me. Should I 
draw the conclusion that it is wiser to use it instead of the HEAD 
branch? Of course it's no longer so big of an issue since 5.0 is 
probably up-to-date enough.

Kalle

-- 
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition not smart enough to debug it.        -- Brian W. Kerninghan




More information about the vtkusers mailing list