Page MenuHomePhabricator

[Segmentation] Crash and interpolation issues in static segmentation on reference image with strange arbitrary time geometry (3d+t heart)
Closed, ResolvedPublic

Description

Using a segmentation interpolation on a static segmentation created from a 4D image the contour is not visible on a timestep t != 0 if the segmentation was created on t = 0. However, the segmentation is visible on all timesteps (which is fine since it's a static segmentation).
Also, the resulting interpolated segmentation is visible on all timesteps.

I also encountered a strange behavior sometimes, that a contour is visible on a timestep t != 0, if the interpolated slice was the selected slice on timestep t = 0 (yellow contour visible) and then the timestep was changed to t != 0. However, scrolling through the slices did not hide this contour and show other interpolation contours.
Also, this happens sometims only on t = 2, not on t = 1. Also, on t = 2 sometimes the manually segmented contour stays the same on all slices.

To reproduce:

  1. Load a 4D dataset (e.g. MITK-Data\3D+t-Heart)
  2. create a new static segmentation
  3. set interpolation to 2-Dimensional

Additionally, I encountered a crash, if a a segmentation is currently interpolated (yellow contour) on timestep t = 0 and while timestep t != 0 (only t = 2?) is selected, the user creates a new slice before or after the first or last segmented slice:
Exception thrown: read access violation. this was nullptr. in const mitk::AffineTransform3D *mitk::BaseGeometry::GetIndexToWorldTransform() const.

The same is basically true for 3-Dimensional interpolation.

Revisions and Commits

Event Timeline

kalali triaged this task as Normal priority.Oct 14 2020, 2:55 PM
kalali created this task.

Still valid - although it was not clearly defined what happened. Sorry, too many things going on at the same time. I will add a video to show some strange behavior.

The last thing that happens is a crash.

I cannot reproduce the bug as described (and don't see it in the video), only for a specific - by the segmentation as invalid considered - last time step (like in the video).

If the reference image is a dynamic image with a proportional time geometry, everything works in a static segmentation (US4DCyl).

If the reference image is a dynamic image with an arbitrary time geometry and the time bounds of the last time step are like [160..160] (@floca how is that defined to be handled anyways in MITK?), everything works on every time step in a static segmentation *except* for the last time step (3d+t Heart). This is not only related to the interpolation. Use a manual 2-d tool on that step and a *crash* happens as reported.

While handling this image, you find already suspicious output in the terminal:

390.48 core.mod.sfcInterpolation.controller WARNING: Interpolation cannot be reinitialized. Currently selected timepoint is not in the time bounds of the currently selected segmentation. Time point: 160

404.02 core.mod.seg.interpolationcontroller WARNING: Segmentation image has different image characteristics than reference image.

416.79 core.mod.segUi.slcInp WARNING: Cannot interpolate segmentation. Passed time point is not within the time bounds of WorkingImage. Time point: 160

When drawing in the last time step to provoke the crash, there's also lots of these:

446.15 core.mod.seg.feedbackCntrTl WARNING: Cannot clear feedback contour at current time step. Feedback contour is in invalid state as its time geometry does not support current selected time point. Invalid time point: 160

446.16 core.mod.seg.feedbackCntrTl WARNING: Cannot add vertex to feedback contour. Feedback contour is in invalid state as its time geometry does not support current selected time point. Invalid time point: 160
446.27 core.mod.seg.feedbackCntrTl WARNING: Cannot add vertex to feedback contour. Feedback contour is in invalid state as its time geometry does not support current selected time point. Invalid time point: 160
446.27 core.mod.seg.feedbackCntrTl WARNING: Cannot add vertex to feedback contour. Feedback contour is in invalid state as its time geometry does not support current selected time point. Invalid time point: 160
...

When creating a dynamic segmentation on that image, everything is fine.

kislinsk renamed this task from [Segmentation] Interpolation contour on static segmentation is only shown on timestep 0 to [Segmentation] Crash and interpolation issues in static segmentation on reference image with strange arbitrary time geometry (3d+t heart).Jan 31 2021, 9:46 AM
kislinsk raised the priority of this task from Normal to Unbreak Now!.
kislinsk added a parent task: T28000: MITK v2021.02.

I tested again with UltrasoundImages\4D_TEE_Data_MV.dcm and everything seems to work as expected. So this task is only valid for strange arbitrary time geometry, as the title describes it.
So I guess the refactoring done in the segmentation tools changed most of the bugs and we got now down to the problem mentioned in T28262.

Ok, then I would propose to reuse this task just for the problems that are documented by Stefan above (https://phabricator.mitk.org/T27883#219162 ) and who we deal with them for the release (because T28262 might have a more longterm perspective).

As discussed in T28262 we will use the following workarround for now and the release until the issue is soundly fixed by T28262.

Quickfix:

  • ArbitraryTimeGeometries that have a collapsed final timestep always extend the final timestep by 1ms if queried via the interface. (e.g. GetBounds, GetMaximumTimePoint)
  • Saving the timegeometry will not save this artificial addition.
  • Print function will also indicate it
kislinsk added a revision: Restricted Differential Revision.Feb 3 2021, 5:38 PM

Cherrypicked the fix into the release branch.