[vtkusers] vtkImageAppend Runtime Error

Siavash Khallaghi siavashk at ece.ubc.ca
Thu Sep 17 15:24:51 EDT 2015


After a lot of debugging, I found the culprit. It has nothing to do with
vtkImageAppend, but the inputs that I was supplying to the filter.
Basically, overlapImage has bad memory sometimes (I don't know why).

overlapImage is the output of a vtkExtractVOI filter and has
mapper->GetInput() as input data. I was writing it out after the update
call, and everything worked fine, so I did not suspect it.

After the vtkExtractVOI update call, I set the the extent of the
overlapImage to be between (0, 0, 0) and (Nx, Ny, Nz), where is N is the
number of pixels in each dimension. This is because I do calculations with
the assumption that the extent starts from (0, 0, 0). Now something really
weird happens:

I noticed that after overlapImage->SetExtent(0, Nx, 0, Ny, 0, Nz), I can no
longer write out the overlapImage. If I write it out, it would be empty
(size of 0 KB). So when I was passing it to vtkImageAppend, it would also
crash my program.

Here is an example set of numbers for the extent:

overlapImage extent before SetExtent: 501, 1910, 251, 1007, 0, 0
overlapImage extent after SetExtent: 0, 1410, 0, 757, 0, 0

Does anyone know why setting the image extent manually would mess up the
memory for vtkImageData? Maybe SetExtent is not meant to be used in this
way? 

In the mean time, I will work on creating a small program that would
reproducible the problem.

Thank you,

Siavash



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkImageAppend-Runtime-Error-tp5733951p5734014.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list