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
DICOM reading multi-frame files does not always work #18
Comments
I also have a DICOM dir with multiple sequences that cannot be read:
otherwise, any ideas on how to just extract a single series? |
Sorry, not really. PyDicom might do it if you're lucky. Any chance for me to get my hands on that data? Or can you have a look? A first simple check could be to check what file it chokes on. If this is some kind of meta file, we might be able to fix it by detecting that and skipping it. If it is a real file with data, we should make the plugin able to read it. |
pydicom didn't work because the file was compressed. I managed to uncompress it with |
Ok, good. Do you know how we can detect that, so we can give a more appropriate error? |
I just ran into the same problem using pydicom and had hoped that imageio would have been able to read the data (alas it did not). pydicom returns a helpful error saying which UID wasn't supported: I reckon it would be easier to have the plugin add pydicom as an optional dependency to imageio or have people pass along a pydicom object, from which you can ask whatever you want. In the end I ended up opening it with GDCM, but I'd rather not depend on that. So any hints on what would need to happen to make similar functionality available in imageio? |
Firstly, the dicom plugin needs better error reporting on this. The dicom plugin in imageio was made standalone because at the time of writing pydicom was not available in py3k. It actually uses almost the same code. The extra code in pydicom is for 95% or so aimed at reading all the fancy tags, and for writing dicom files. At some point imageio would need a solution to allow reading more/all tags from the data though. The problem with JPEG 2000 is that (afaik) there is no way to decode it from pure Python. There are libs/programs that can, so we might look into a solution like "please install X to read JPEG 2000" files, where X can be GDCM, DCMTK, or maybe even libjpeg. |
@rossant i suspect that the issue that you saw was due to a bug where the reader tried to read a specific JPEG format. @ivoflipse the error message is now a bit more clear I added primitive funtionality to try to recover the dcmtkdjpeg executable (from Office dcmtk) and use it to convert the image on the fly. This is something that should probably extended in the future, but this is a start. For the record, the original issue of not being able to load multi-page images still stands, AFAIK. |
The file
dicom_file_2.dcm
does not work. I am pretty sure that code has worked on some multi-frame data, but this one obviously does not, while it does work in PyDicom.The text was updated successfully, but these errors were encountered: