Open romangrothausmann opened 5 years ago
Not sure if this is a SCIFIO issue or if it should go to https://github.com/Kitware/MetaIO?
It might need to go into https://github.com/Kitware/MetaIO. Does read .dm3, write .mha, read .mha create the problem? Or are there additional ingredients necessary?
Thanks @dzenanz for taking a look
Does read .dm3, write .mha, read .mha create the problem?
Yes, in https://github.com/romangrothausmann/ITK-CLIs/commit/4fa84310e05451aaf94322d0f93f554d21d905a8 it was a mere conversion from DM3 to MHA (https://github.com/romangrothausmann/ITK-CLIs/blob/412a55c708056f28fd6cf7132067d05aafae171d/file_converter.cxx) and then reading the MHA again for getting the stats (https://github.com/romangrothausmann/ITK-CLIs/blob/412a55c708056f28fd6cf7132067d05aafae171d/stat.cxx).
If any of the metadata fields contain a line break, that will be a problem. Some other stuff might be offensive too, I am not sure which.
Well, I guess the question is whether SCIFIO creates some inappropriate headers from this DM3 or whether MetaIO has problems with some headers that are acceptable. NB: When reading an image series of DM3s and saving that as MHA/MHD (with e.g. file-series_reader or subimage_extract_series) the probem does not arise.
I stumbled over the problem (https://github.com/romangrothausmann/ITK-CLIs/commit/4fa84310e05451aaf94322d0f93f554d21d905a8) that an MHA created from a DM3 with SCIFIO was not readable by ITK again. It seems that is due to the very long/verbose header possibly containing some info that ITK's metaIO cannot cope with. The test DM3 can be found here: https://github.com/romangrothausmann/ITK-CLIs/blob/4fa84310e05451aaf94322d0f93f554d21d905a8/tests/data/test.dm3