Page MenuHomePhabricator

Dicom reader crashes
Closed, ResolvedPublic

Assigned To
Authored By
neher
Apr 13 2018, 9:33 AM
Referenced Files
F1017965: test.log
Apr 23 2018, 6:29 PM
F1010561: logfile.txt
Apr 13 2018, 1:48 PM

Description

Simply use default DICOM reader --> crash

Test data: /E130-Personal/Neher/projects/Neurochirurgie/KOPF_UNTERSUCHUNG_20170419_164344_842000/T1_MPRAGE_TRA_512_1_3MM_KM_0016/

Event Timeline

neher triaged this task as Normal priority.Apr 13 2018, 9:33 AM
neher created this task.

Terminal output:

Only crashes in release mode.

Only crashes on linux. Basic workbench application is affected without additional plugins.

neher raised the priority of this task from Normal to High.Apr 23 2018, 8:16 AM

Also happens with the normal MITK test data.
Apparently in some cases m_SortCriterion is NULL.
https://phabricator.mitk.org/source/mitk/browse/master/Modules/DICOMReader/src/mitkDICOMTagBasedSorter.cpp$249

If I catch this case the application does not crash but also cannot load the image:

ERROR: Exception occured when reading file /media/neher/Rumpelkammer/mitk/build/release/MITK-Data/DICOMReader/OT-MONO2-8-colon.dcm:
Invalid tag values when constructing tilt information from origin1 '', origin2 '', and orientation ''

In combination with the previous post commenting out different combinations of reader configuration resource files resolves the issues for different types of input data.

For example everything works fine for the test data posted above when removing

configurations/3DnT/imageposition_byacquisition.xml
configurations/3DnT/imageposition_bytriggertime.xml

but CR-MONO1-10-chest-spacing-none.dcm in MITK-Data still fails to load. Without the nullpointer check, also the first possibility does not work and the application crashes, meaning the m_SortCriterion is still NULL.

Side note:

If I catch this case the application does not crash but also cannot load the image:

ERROR: Exception occured when reading file /media/neher/Rumpelkammer/mitk/build/release/MITK-Data/DICOMReader/OT-MONO2-8-colon.dcm:
Invalid tag values when constructing tilt information from origin1 '', origin2 '', and orientation ''

This problem should be traceable in debug mode.

Regarding our latest test discussion @floca
DICOM test results on a fresh Ubuntu 16.04 release build:

No additional cmake options changed. Current release branch T24609-v2018.04-alpha, but my previous results indicate that it's the same on the current master.

Thanks for the update. Hm, strange the master built fine in its nightly build. Your failed tests ran through with no problem.
I will check it on my on VM. You have the problems with the current head of the alpha branch. Right?

If it is something maschine dependent, I don't get it right now.

@kislinsk: Could we also set up a Continuous and/or Nightly for the alpha branch? I think that would be usefull.

I think there is an issue in mitk::DICOMITKSeriesGDCMReader::EnsureMandatorySortersArePresent. This method is adding a DICOMTagBasedSorter which does not contain a DICOMSortCriterion.

Catching the nullpointer. All test pass now adn for my test data the loading works. FOr some data in the MITK Data folder the issue

ERROR: Exception occured when reading file /media/neher/Rumpelkammer/mitk/build/release/MITK-Data/DICOMReader/OT-MONO2-8-colon.dcm:
Invalid tag values when constructing tilt information from origin1 '', origin2 '', and orientation ''

still remains. Since the tests pass, maybe these test datasets are not valid or why are they unused?

Catching the nullpointer. All test pass now adn for my test data the loading works. FOr some data in the MITK Data folder the issue

ERROR: Exception occured when reading file /media/neher/Rumpelkammer/mitk/build/release/MITK-Data/DICOMReader/OT-MONO2-8-colon.dcm:
Invalid tag values when constructing tilt information from origin1 '', origin2 '', and orientation ''

still remains. Since the tests pass, maybe these test datasets are not valid or why are they unused?

I would propse to split it into two tasks. This task covers the crash problem you fixed.
The quoted error should be investigated in another task (T24710: Check failing dicom data in MITK-Data).

kislinsk claimed this task.

The branch above is already merged. Closing this one.