Page MenuHomePhabricator

Deprecated classes in ImageExtraction-module are not used
Open, NormalPublic

Description

The ImageExtraction-module only consists of three deprecated classes. They all document to use mitkExtractSliceFilter from the Core-module.
From what I see the whole module can be removed.

Event Timeline

kalali triaged this task as Normal priority.Jul 29 2021, 4:21 PM
kalali created this task.
kalali moved this task from Backlog to Cycle on the MITK (v2021.10) board.

I just realized that PlanarFigureMaskGenerator is still using the ExtractImageFilter from this module. Other classes use ExtractSliceFilter (which is the recommended version). So in order to remove the ImageExtraction-module, I will replace the filter inside PlanarFigureMaskGenerator.

Ok I don't really understand how to work with the ExtractSliceFilter and how to replace what's currently done inside PlanarFigureMaskGenerator::CalculateMask(). Maybe someone can help and explain the different usages of ExtractSliceFilter and ExtractImageFilter and how to correctly set the desired slice for the slice filter.

So I'm trying to replace the ExtractImageFilter with the ExtractSliceFilter by doing the following:

const PlaneGeometry *planarFigurePlaneGeometry = m_PlanarFigure->GetPlaneGeometry();

auto extractSliceFilter = mitk::ExtractSliceFilter::New();
extractSliceFilter->SetInput(m_inputImage);
extractSliceFilter->SetTimeStep(m_TimeStep);
extractSliceFilter->SetWorldGeometry(planarFigurePlaneGeometry);
extractSliceFilter->SetResliceTransformByGeometry(m_inputImage->GetTimeGeometry()->GetGeometryForTimeStep(m_TimeStep));
extractSliceFilter->SetVtkOutputRequest(false);
extractSliceFilter->Update();

with m_PlanarFigure of type mitk::PlanarFigure::Pointer.

I tried to see if this somehow works doing the following:

  • I used the MITK release (using ExtractImageFilter) to create a circle and a segmentation mask to compare the statistics of both
  • I used my modified branch (using ExtractSliceFilter) to create a circle and a segmentation mask to compare the statistics of both

The result can be seen here:

2021.02.png (1×2 px, 128 KB)

develop_branch.png (1×2 px, 139 KB)

Notice how the statistics differ in the second case.

Also, when I first create a planar figure (say, a circle) and then a new, empty segmentation node I cannot modify the planar figure anymore (drag the handle to resize the circle). I get the a nullptr exception in line 74 of mitkPlaneClipping.h: const mitk::BoundingBox *boundingBox = boundingGeometry->GetBoundingBox();, where const BaseGeometry *boundingGeometry is not initialized.
The call happens inside bool mitk::ExtractSliceFilter::GetClippedPlaneBounds(const BaseGeometry *boundingGeometry, const PlaneGeometry *planeGeometry, double *bounds), which in turn is called in if (this->GetClippedPlaneBounds(m_WorldGeometry->GetReferenceGeometry(), m_WorldGeometry, sliceBounds)). Here, m_WorldGeometry is valid but the reference geometry seems to be invalid.

This does not happen with the original version, using the MITK release.