[vtk-developers] vtkImageMapToColors overwrites data?

Carlos Scheidegger cscheid at sci.utah.edu
Mon Sep 17 20:42:33 EDT 2007


Hi,

I'm getting strange behavior with the following (attached) python script and
dataset. It would seem that vtkImageMapToColors is overwriting the data passed
to it.

On this script,

$ python test.py path/to/multi.vtk

I'm running two instances of vtkImageMapToColors on the output of a
vtkDataSetReader, and rendering each one of these on a different vtkRenderer.
If either one of renderers is not added (lines 75 and 76), then the single
colormapped square shows up correctly: a bivariate colormap changing hue and
saturation. If both of them are used, however, one of the squares is just
gray. It looks like this happens because the imagedata was mutated.

Is this expected behavior? I don't see it documented anywhere, and this is the
first VTK class I've used that behaves like that. If so, is there a list of
all classes that exhibit behavior like this? (data mutation happens to destroy
our caching in VisTrails, so we would have to clear the cache every time a
pipeline with such a class gets executed). A similar issue seems to have been
pointed out back in 2002:

http://public.kitware.com/pipermail/vtkusers/2002-February/059136.html

(In case you're curious, the strange ImageMapToColors + ProbeFilter setup is
made to get bivariate colormaps on carefully constructed datasets. Is there
standard functionality to do that in VTK?)

Thanks a lot in advance,
Carlos Scheidegger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 2279 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20070917/d910131f/attachment-0001.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multi.vtk
Type: application/octet-stream
Size: 8506 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20070917/d910131f/attachment-0001.obj>


More information about the vtk-developers mailing list