Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MHA created from DM3 with SCIFIO not readable due to header #57

Open
romangrothausmann opened this issue Nov 8, 2019 · 5 comments
Open

Comments

@romangrothausmann
Copy link

I stumbled over the problem (romangrothausmann/ITK-CLIs@4fa8431) 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

@romangrothausmann
Copy link
Author

Not sure if this is a SCIFIO issue or if it should go to https://github.com/Kitware/MetaIO?

@dzenanz
Copy link
Contributor

dzenanz commented Nov 8, 2019

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?

@romangrothausmann
Copy link
Author

Thanks @dzenanz for taking a look

Does read .dm3, write .mha, read .mha create the problem?

Yes, in romangrothausmann/ITK-CLIs@4fa8431 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).

@dzenanz
Copy link
Contributor

dzenanz commented Nov 8, 2019

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.

@romangrothausmann
Copy link
Author

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.

romangrothausmann added a commit to romangrothausmann/ITK-CLIs that referenced this issue Nov 8, 2019
scifio/scifio-imageio#57

stat output.mha
DimSize required and not defined.
MetaObject: Read: MET_Read Failed
MetaImage: M_Read: Error parsing file
MetaImage: Read: Cannot parse file
/opt/ITK-CLIs/bin/stat: exception caught !

itk::ExceptionObject (0x55abf10e44d0)
Location: "unknown"
File: /opt/compilation/ITK-git/Modules/IO/Meta/src/itkMetaImageIO.cxx
Line: 94
Description: itk::ERROR: MetaImageIO(0x55abf10e2960): File cannot be read: output.mha for reading.
Reason: No such file or directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants