Inria-Asclepios / medInria-public

Open-source part of the medInria software
https://med.inria.fr/
BSD 4-Clause "Original" or "Old" License
0 stars 9 forks source link

Cannot visualise imported DICOM #83

Closed LoicCadour closed 8 years ago

LoicCadour commented 8 years ago

Import a DICOM folder/files and drop it in Visualisation : "Operation failed"

DimSize required and not defined. MetaObject: Read: MET_Read Failed MetaImage: M_Read: Error parsing file MetaImage: Read: Cannot parse file itk::ERROR: MetaImageIO(0x7fe0827f7000): File cannot be read: /Users/lcadour/Library/Application Support/INRIA_IHU-LIRYC/MUSIC/3e3bf4f5-0f5e-471d-96fb-2f79f4570ead/9857cf23-6032-486f-9dca-7da3d78fc3bc1.mha for reading. Reason: Invalid argument

If you load the file and visualise it, it works. If you import a vtk, mha file it works.

LoicCadour commented 8 years ago

I won't have time to see that soon. @mathildemerle can you have a look?

mathildemerle commented 8 years ago

I can look at it indeed :)

mathildemerle commented 8 years ago

I tested with previous dicom files and i do not have the problem, just with the manips's one.

LoicCadour commented 8 years ago

Actually, I tested with another set of data that was working, ... and well, it used to work. It's here: https://github.com/Inria-Asclepios/data (just take one subfolder, it can take a while otherwise)

mathildemerle commented 8 years ago

I do not have access to your link ^^'

LoicCadour commented 8 years ago

Ok, I was the only one having the access (I don't like to share ;)) Should be good now

mathildemerle commented 8 years ago

Indeed, we can't open them in a workspace

mathildemerle commented 8 years ago

So, i found the code which created this problem. This is because of this PR ( @fcollot ) https://github.com/Inria-Asclepios/medInria-public/pull/48 and only the changes on itkDataImageWriterBase and itkDataImageReaderBase.

fcollot commented 8 years ago

The bug is not in the PR you mentioned. If you print out the metadata you will see it is corrupt. The reader for the initial DICOM files (not the itkDataImageReaderBase) has read the metadata wrong. The bug existed before, and this PR only revealed it because it encapsulates all the metadata in the ITK dictionary (as opposed to before where only specific keys where encapsulated). We could spend days trying to find the original bug in the medInria ITK readers, but I found a workaround by just checking if the metadata is in the metadata registry before encapsulating it.