Page MenuHomePhabricator

[Segmentation] Fill/Erase crashes at non-zero timestep / Issue with ArbitraryTimeGeometry
Closed, InvalidPublic

Description

Branch

releases/2018-04

How to reproduce

Happens on at least on Windows:

  1. Open our 3D+t-Heart image from rMD MITK-Data.
  2. Create a segmentation
  3. Switch to timestep 1
  4. Fill image in axial view

Error message

67.67 core.mod.apputil.safenotify ERROR: An error occurred: MITK Exception:

Description: No iterator at invalid timestep 103. There are only 2 timesteps available.

Filename: D:\MITK\Modules\ContourModel\DataManagement\mitkContourModel.cpp

Line: 269

Event Timeline

kislinsk created this task.

Sometimes I have to change the timesteps multiple times to run into this error. The message differs a little bit, though:

33.25 core.mod.core.loggingadapter: WARNING: In D:\MITK\Modules\Core\src\Algorithms\mitkExtractSliceFilter.cpp, line 118
ExtractSliceFilter (0000023F64CB5EE0): This is not a valid timestep: 103

The actual error is happening as soon as I activate the Fill tool. I added a check to BaseRenderer::GetTimeStep(mitk::BaseData) to trigger a breakpoint when the timestep is > 100. Eventually TimeGeometry::TimePointToTimeStep() is called on the data and the time point is already 103. The time point is calculated in BaseRenderer::GetTime() by calling TimeStepToTimePoint() on the world geometry of the renderer.

These are the details of the time geometry of 3D+t-Heart. The 103 seems to come from the time bounds at the bottom:

TimeGeometry:     ArbitraryTimeGeometry (00000219AC446000)
       TimeSteps: 3

       GetGeometryForTimeStep(0):       SlicedGeometry3D (00000219ABBE1CE0)
         IndexToWorldTransform: 
        Matrix: 
          1.95313 0 0 
          0 1.95313 0 
          0 0 3 
        Offset: [-121.99, -136.405, -48.7224]
        Center: [0, 0, 0]
        Translation: [-121.99, -136.405, -48.7224]
        Inverse: 
          0.512 0 0 
          0 0.512 0 
          0 0 0.333333 
        Scale : 1 1 1 
         BoundingBox:         ( 0,128 0,128 0,39  )
         Origin: [-121.99, -136.405, -48.7224]
         ImageGeometry: 1
         Spacing: [1.95313, 1.95313, 3]
         EvenlySpaced: 1
         DirectionVector: [0, 0, 1]
         Slices: 39

         GetPlaneGeometry(0):         PlaneGeometry (00000219AC67C440)
           IndexToWorldTransform: 
          Matrix: 
            1.95313 0 0 
            0 1.95313 0 
            0 0 3 
          Offset: [-121.99, -136.405, -48.7224]
          Center: [0, 0, 0]
          Translation: [-121.99, -136.405, -48.7224]
          Inverse: 
            0.512 0 0 
            0 0.512 0 
            0 0 0.333333 
          Scale : 1 1 1 
           BoundingBox:           ( 0,128 0,128 0,1  )
           Origin: [-121.99, -136.405, -48.7224]
           ImageGeometry: 1
           Spacing: [1.95313, 1.95313, 3]
           ScaleFactorMMPerUnitX: 1.95313
           ScaleFactorMMPerUnitY: 1.95313
           Normal: [0, 0, 3]
       MinimumTimePoint: 0 ms
       MaximumTimePoint: 160 ms

       min TimeBounds: 
        Step 0: 0 ms
        Step 1: 103 ms
        Step 2: 160 ms

       max TimeBounds: 
        Step 0: 103 ms
        Step 1: 160 ms
        Step 2: 160 ms
kislinsk renamed this task from [Segmentation] Fill/Erase crashes at non-zero timestep to [Segmentation] Fill/Erase crashes at non-zero timestep / Issue with ArbitraryTimeGeopmetry.Jan 28 2019, 10:23 AM
kislinsk renamed this task from [Segmentation] Fill/Erase crashes at non-zero timestep / Issue with ArbitraryTimeGeopmetry to [Segmentation] Fill/Erase crashes at non-zero timestep / Issue with ArbitraryTimeGeometry.
kislinsk removed kislinsk as the assignee of this task.
kislinsk updated the task description. (Show Details)
kislinsk added a subscriber: floca.

Is this still valid? I looked at it but couldn't reproduce the bug.
If you can reproduce it, could you try to reproduce it with Pic2DplusT and MITK-Data/3D+t-ITKIO-TestData as well?

kalali added a project: Restricted Project.Oct 4 2019, 11:07 AM

Also if checking validity, consider T24766.

WuChan_BIT assigned this task to kislinsk.
WuChan_BIT added a subscriber: WuChan_BIT.

Maybe, I solved this bug in this code.

mitk::TimeStepType mitk::ArbitraryTimeGeometry::TimePointToTimeStep(TimePointType timePoint) const
{

mitk::TimeStepType result = 0;

for (auto pos = m_MinimumTimePoints.cbegin(); pos != m_MinimumTimePoints.cend(); ++pos)
{
  if (timePoint <= *pos)
  {
    result = pos - m_MinimumTimePoints.begin();
    break;
  }
}

return result;

}

What happened here? The suggested code is not merged, so this task cannot be resolved.
However, the suggested code is just a revert of the fix I made for T24766 (except for the =, but I tested this in October and it leads to a crash as far as I remember).

Discussion result: @kalali will verify status on the current master (and act accordingly ;))

I still can't reproduce the error.
However, in the meantime things have changed and it is now possible to define a static or dynamic masks. Since it was not clear, what to do, I tested both. In the static case I get an error

core.mod.sfcInterpolation.controller ERROR: Invalid time step requested for interpolation pipeline

I think this is fine.
In the dynamic case, I don't know what to expect but all three time steps get filled.

Anayway, I will close this task as the description does not fit to anything I experienced.