Page MenuHomePhabricator

MITK crashes when loading 2D segmentation
Closed, ResolvedPublic

Description

I tried to load a 2D segmentation. MITK crashes with the notification:

[4.190] Exception occured when reading file /home/wirkert/workspace/susi/scripts/caffe_interface/masks/1.tif:
Dimension 2 is not in (3)

This happend in the MITK-2016.3.0-linux64 release.

Event Timeline

kislinsk lowered the priority of this task from Unbreak Now! to Low.Oct 5 2016, 3:41 PM
kislinsk added a subscriber: kislinsk.

MITK should not crash indeed, but we do not support 2D-segmentations. You would need to create a 3D-segmentation with a single slice instead.

Hmmm, but what if I (like in this case), create the segmentation with a seperate program and then load it to MITK. Can't MITK just "expand dims"?

That is actually supposed to be the case. Hence we should investigate further. I'm not even sure if it is related to segmentation as the exception is already thrown when the image is loaded.

the root is in ItkImageIO::Read(). (Which is also used for TIFF images)

It takes the dimension information of itk::ImageIOBase::GetNumberOfDimensions() and constructs the mitk::Image accordingly.

For formats like jpg, tiff, png, this always results in 2D images in the data storage. Therefore whe have 2D masks.

It is the question if we realy should enforce the ItkImageIO util to produce 3D images. In the workbench it makes sense, but in other usecases (e.g. some command line tools) it might be negative to change dimension.

So first of all one should clarify if the >=3D is the policy for the workbench or the complete mitk code base.

True, this is a very fundamental question :-)

Just investigated further with Stefan:

  • MITK only crashes when segmentation plugin is open.
  • If segmentation plugin is not open, MITK crashes as soon as Segmentation plugin is opened.
hentsch added a project: Restricted Project.Feb 1 2018, 1:17 PM
nolden raised the priority of this task from Low to Normal.Oct 26 2018, 11:58 AM
nolden edited projects, added MITK (2018-04); removed Request for Discussion, MITK.
nolden added a subscriber: nolden.

Discussed at MITK meeting: workbench should not crash, no matter how we handle 2D segmentations

kislinsk claimed this task.

I just checked again and I was able to open a 2d image and even create a segmentation for it, which is then a 3d image with a single slice.