Exception on vtkImageCacheFilter after modifying the pipeline
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Hi all,
I have a pipeline formed by a vtkImageReader2, a vtkImageResample, a vtkMapToColors and a vtkImageCache, connected in this order to show the slices of a 3D image. This code works well while I change the ZSlice parameter of the vtkImageMapper. But when I modify the pipeline, an exception is thrown.
Reviewing the code of method UpdateData of vtkImageCache, I found that the algorithm verifies if the pipeline is still valid. If not, it deletes every image generated previous to the time of pipeline. The images are deleted but the array Data[i] is not assigned NULL. After that an exception is thrown in line 148. ext = this->Data[i]->GetExtent();
I found a solution to my problem adding the following line to vtkImageCacheFilter.cxx version 1.19
136: if (this->Data[i] && this->Times[i] < pmt) 137: { 138: this->Data[i]->Delete(); 139: this->Times[i] = 0; 140: this->Data[i] = NULL; // added line 141: }
Is this a bug? am I doing something wrong o missing something? is it a known issue? I made a simple test program to show the exception.
Thanks, Emiliano