Page MenuHomePhabricator

Should all MITK.IO infos be stored in serialzed file?
Open, NormalPublic

Description

Currently the following properties are persisted by default (thus stored again in meta infos if image is saved).

AddPropertyPersistence(mitk::IOMetaInformationPropertyConstants::READER_DESCRIPTION());
AddPropertyPersistence(mitk::IOMetaInformationPropertyConstants::READER_INPUTLOCATION());
AddPropertyPersistence(mitk::IOMetaInformationPropertyConstants::READER_MIME_CATEGORY());
AddPropertyPersistence(mitk::IOMetaInformationPropertyConstants::READER_MIME_NAME());
AddPropertyPersistence(mitk::IOMetaInformationPropertyConstants::READER_VERSION());
AddPropertyPersistence(mitk::IOMetaInformationPropertyConstants::READER_OPTIONS_ANY());

I am not sure if we should store all of them if writing files
E.g. the input location might convey information (encoded in the path) a user does not want to leak but does not think about it.

Event Timeline

Input location is used by the SegmentationTaskList and SegmentationTaskListIO.

Input location is used by the SegmentationTaskList and SegmentationTaskListIO.

What do you mean with used? I guess we are talking about different things. It is not about the props you have available after reading. It is about the props that a writen into files.
Currently the nrrds look like this:

NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: unsigned short
dimension: 4
space: left-posterior-superior
sizes: 2 256 256 49
space directions: none (1,0,0) (0,1,0) (0,0,3)
kinds: vector domain domain domain
endian: little
encoding: gzip
space origin: (0,0,0)
DICOM_0008_0060:={"values":[{"z":0, "t":0, "value":"SEG"}]}
DICOM_0008_103E:={"values":[{"z":0, "t":0, "value":"MITK Segmentation"}]}
MITK_IO_reader_description:=MITK Multilabel Segmentation
MITK_IO_reader_inputlocation:=C:/Dev/MITK/test labels2.nrrd
MITK_IO_reader_mime_category:=Images
MITK_IO_reader_mime_name:=application/vnd.mitk.image.nrrd
MITK_IO_reader_version:=2022.10.99-30d8c257
modality:=org.mitk.multilabel.segmentation

And it is the question if we want/need all the MITK_IO_* info...

You're right. I already suspected it to be different things but better safe than sorry. :D

Wait, maybe we are talking about the same thing. In mitkSegmentationTaskListIO.cpp:181-184 the written properties are used in case everything is read from a scene file. Then, the original input location is read as search path for relative data that isn't contained within the scene file. Which I know is not a perfect situation in the first place but better than nothing in particular for users using the save button to checkpoint their progress.

if I not mistaken this is something different, because scene serialization uses as different mechanism (it always stores all props of data and nodes; no matter what). Property persistence service is only relevant for reading or writing data to "directly" to files.

kislinsk triaged this task as Normal priority.Apr 19 2023, 11:26 AM

It was discussed that the old reader information is not of any value and shouldn't be written into the files.

Unknown Object (User) added a subtask: Unknown Object (Maniphest Task).Jun 28 2023, 9:32 AM
Unknown Object (User) added a subscriber: Unknown Object (User).Jun 28 2023, 9:51 AM
This comment was removed by kislinsk.