Page MenuHomePhabricator

RTDose image can not be serialized and workbench crashes upon loading
Closed, ResolvedPublic

Description

The workbench crashes when loading a scene in which a RTdose image ist stored.

The following warning is shown during the saving process:

415.82 WARNING: The following properties could not be serialized:

  • GenericProperty associated to key 'MITK.IO.reader.DICOM.PixelSpacingInterpretation'
  • GenericProperty associated to key 'MITK.IO.reader.DICOM.ReaderImplementationLevel'
  • GenericProperty associated to key 'dicomseriesreader.PixelSpacingInterpretation'
  • GenericProperty associated to key 'dicomseriesreader.ReaderImplementationLevel'
  • GenericProperty associated to key 'dose.PrescribedDose'

Revisions and Commits

rMITK MITK
Restricted Differential Revision

Event Timeline

thomass created this task.

If this is now a crash but wasn't before, the TinyXML-2 migration is also a good candidate.
edit: Oh, was already authored in August. Sorry for the noise.

floca added a subscriber: floca.

@thomass Please check the patch provided by https://phabricator.mitk.org/D449. It should solve you problem I hope. Would be cool if you could give feedback.

I tried it with my current develop (not the latest due to ongoing QT issues - wip) and it resolves the last warning (predescibed dose) but not the others. According to the D449 this is the one you changed, so as expected I suppose :) As soon as I get the latest develop up and running I will check the diff further.

GenericProperty associated to key 'MITK.IO.reader.DICOM.PixelSpacingInterpretation'
GenericProperty associated to key 'MITK.IO.reader.DICOM.ReaderImplementationLevel'
GenericProperty associated to key 'dicomseriesreader.PixelSpacingInterpretation'
GenericProperty associated to key 'dicomseriesreader.ReaderImplementationLevel' still need to be changed

Do you have still problems with crashes? If yes, this is almost certainly not due to the GenericProperty thing, as they have no relevance for dose visualization and scenes without dose do not crash but also cannot load the GenericProperty.

The generic property problem itself is covered by T25305 and not in the scope of this task.

As Ralf pointed out, it is actually not related to the GenericProperty as such but it seems that the scene does not even contain any nrrd files after saving and that is why it breaks

could you provied (e.g. via nextcloud) such an invalid scene file?

sorry just saw the message. I put it in the shared folder.

<?xml version="1.0" encoding="UTF-8"?>
<Version Writer="C:\Development\MITK-dev\src\Modules\SceneSerialization\src\mitkSceneIO.cpp" Revision="$Revision: 17055 $" FileVersion="1"/>

<node UID="OBJECT_3d431401-87ea-4e22-995d-3f38888bb5ce">

<data type="Image" file="" UID="88e7439c-12cc-4988-83f9-f4f8094986f9">
    <properties file="baaaaa"/>
</data>
<properties file="caaaaa"/>

</node>

Here the .xml....the file name is empty and that causes the loader to crash

Which node is it? you can look up the name if you look into caaaaa.xml

as name property, the name of the RT node is provided correctly.
I created a working example with Pic3D for comparison.
Looking at both caaaaa.xml files, the only difference I notice is that the corrupted one is encoded with UTF-8 but otherwise it looks similar (as far as I see).

The scene is created successfully if following (deprecated) properties are disabled in mitkDICOMImageBlockDescriptor.cpp:

mitkImage->SetProperty( "files", this->GetProperty( "filenamesForSlices_deprecated" ) );
mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_FILES()), this->GetProperty("filenamesForSlices"));

Errors in the property serialization causes an exception leading to an empty file name and the serializer not saving the file.

Following other (deprecated) properties lead to errors/warnings during the serialization but seem to do no harm to the scene outcome:

mitkImage->SetProperty( "dicomseriesreader.PixelSpacingInterpretation", GenericProperty<PixelSpacingInterpretation>::New( this->GetPixelSpacingInterpretation() ) );
mitkImage->SetProperty( "dicomseriesreader.ReaderImplementationLevel", GenericProperty<ReaderImplementationLevel>::New( m_ReaderImplementationLevel ) );
mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_PIXEL_SPACING_INTERPRETATION()), GenericProperty<PixelSpacingInterpretation>::New(this->GetPixelSpacingInterpretation()));
mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_IMPLEMENTATION_LEVEL()),GenericProperty<ReaderImplementationLevel>::New(m_ReaderImplementationLevel));

Ok. Found the problem. Should now be fixed with the new diff. At least it works on my PC now with the test files.