Page MenuHomePhabricator

ITK fails during interpolation on slice with pixel hole near the segmentation border
Open, LowPublic

Description

Interpolation fails on slice with pixel hole near the segmentation border

Effect on video is 100% reproducible when you add one pixel-width line near the border of segmentation on some slice

code:

mitk::Image::Pointer
mitk::ShapeBasedInterpolationAlgorithm::Interpolate(
                               Image::ConstPointer lowerSlice, unsigned int lowerSliceIndex,
                               Image::ConstPointer upperSlice, unsigned int upperSliceIndex,
                               unsigned int requestedIndex,
                               unsigned int /*sliceDimension*/, // commented variables are not used
                               Image::Pointer resultImage,
                               unsigned int /*timeStep*/,
                               Image::ConstPointer /*referenceImage*/)
{
  mitk::Image::Pointer lowerDistanceImage = mitk::Image::New();
  AccessFixedDimensionByItk_1(lowerSlice, ComputeDistanceMap, 2, lowerDistanceImage);

  mitk::Image::Pointer upperDistanceImage = mitk::Image::New();
  AccessFixedDimensionByItk_1(upperSlice, ComputeDistanceMap, 2, upperDistanceImage);

  // calculate where the current slice is in comparison to the lower and upper neighboring slices
  float ratio = (float)(requestedIndex - lowerSliceIndex) / (float)(upperSliceIndex - lowerSliceIndex);
  AccessFixedDimensionByItk_3(resultImage, InterpolateIntermediateSlice, 2, upperDistanceImage, lowerDistanceImage, ratio);

  return resultImage;
}

Mirror on ITK JIRA: https://issues.itk.org/jira/browse/ITK-3524

video attached

Event Timeline

mpkh updated the task description. (Show Details)
mpkh updated the task description. (Show Details)
kislinsk added a subscriber: kislinsk.

Thanks for reporting!
Triaged as "High" priority as it may lead to a crash. 💣

@kislinsk okay, under the hood of ComputeDistanceMap there are few ITK filters working together
itk::FastChamferDistanceImageFilter, itk::IsoContourDistanceImageFilter, itk::InvertIntensityImageFilter, itk::SubtractImageFilter, error happens after setting them all together and calling Update(), possibly needs minimal reproducible example of what filter exactly fails there

this is closed as won't fix on ITK at the moment, and I guess it's because for now we can't tell what exactly fails there

When you break on the exception, isn't it enough to check the callstack?

@kislinsk so far I didn't checked what's going inside Update() call

kislinsk lowered the priority of this task from High to Low.Dec 21 2017, 2:46 PM

Lowering priority as we will basically rewrite the whole MITK Segmentation.