We received garbage from the method GetVtkImageData in ImageDataItem, which is returned by Image::GetVolumeData. The first call always worked well. However, in contrast to calling Image::GetSliceData, Image::GetVolumeData returned a broken ImageDataItem after at least two calls.
Description
Status | Assigned | Task | ||
---|---|---|---|---|
Invalid | None | T15325 Consecutive calls of Image::GetVolumeData() lead to undefined vtkImageData | ||
Wontfix | • goerres | T13526 Extend mitkImage so that vtkImage is also modified | ||
Wontfix | None | T16381 Redesign storage of ImageDataItems in Image |
Event Timeline
This bug has a high severity and was not fixed within the 2013-06 release. Setting target milestone to next release.
A simple test of investigating consecutive calls is not sufficient to reproduce the behavior. The actual problem can however be easily regarded in the QmitkSlicesInterpolator.cpp in Line 539:
If the code line
"reslice->SetInputSlice(slice->GetSliceData()->GetVtkImageData(slice));"
is replaced with
"reslice->SetInputSlice(slice->GetVolumeData()->GetVtkImageData(slice));
the 2D slice interpolation will become garbage.
This occurs when clicking "Apply" for a 2-dimensional slice interpolation in the segmentation plugin.
It works if you put
"slice->GetVolumeData()->ConstructVtkImageData(slice);"
in front of the problematic code line.
Therefore, the actual problem seems to be that ConstructVtkImageData isn't called after changing the image content. It would be best to fix this bug together with T13526.
in QmitkSlicesInterpolator, it works for me if I just set:
overwrite->SetInputSlice(slice->GetVtkImageData());
We couldn't reproduce the behavior with the test provided in branch bug-15325-ExtendImageDataItemTest. Since the actual problem doesn't occur anymore in the QmitkSlicesInterpolator, we assume there was a problem with image initalisation/deallocation when an interpolated slice was confirmed.