[vtk-developers] reproducible bug with vtkExtractVOI and vtkImageShiftScale

Lisa Sobierajski Avila lisa.avila at kitware.com
Fri Nov 9 22:37:46 EST 2001


Hi Charl,

Try to update your vtkExtractVOI.cxx, rebuild, and run this again. I think 
the problem is fixed.  vtkExtractVOI was not setting the output scalar type 
so vtkImageShiftScale was traversing the data 4 bytes at a time (regardless 
of data type) and crashing when it runs out of data.

Lisa


At 08:17 PM 11/9/2001, Charl P. Botha wrote:
>Dear VTK-developers,
>
>If one uses a vtkExtractVOI followed by a vtkImageShiftScale on e.g.
>unsigned char data, the data _seems_ to change type to float
>(imagedata->GetScalarType(), although
>imagedata->GetPointData()->GetActiveScalars()->GetDataType() seems to remain
>correct).  In addition, setting vtkImageShiftScale's output scalar type to
>the same type as the input data results in an immediate segfault in the two
>examples that I've attached.
>
>I am using this filter combination in a raycasting pipeline... obviously the
>raycaster refuses to render float data.  In my own application, changing the
>output type of vtkImageShiftScale does not result in a segfault, but the
>actual scalar data seems to get "lost", as nothing is rendered.  I have
>confirmed that all other components in my pipeline are working.
>
>Please apply the attached two patches to the pertinent examples
>(graphics/examplesCxx/volProt.cxx and graphics/examplesPython/volSimple.py)
>in current VTK cvs.  Each demonstrates this problem *independently*.  To see
>the segfault, UNcomment the line that calls
>SetOutputScalarTypeToUnsignedShort().  If this line is commented, one can
>watch the raycaster complaining about incorrect scalar type.  It is also
>interesting to note that if either of the vtkImageShiftScale OR the
>vtkExtractVOI is short-circuited, all is well.
>
>If anyone can shed some more light on this, I'd be MOST grateful.  I suppose
>it has something to do with the changes in VTK's data-model abstraction, but
>I haven't been able to find anything obviously wrong.  The perl scripts in
>the 3.2 -> 4.0 upgrade package also seem to think all is fine with the
>involved filters.
>
>Thanks in advance for any information,
>Charl
>
>--
>charl p. botha      | computer graphics and cad/cam
>http://cpbotha.net/ | http://www.cg.its.tudelft.nl/
>





More information about the vtk-developers mailing list