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

What is the current state with respect to enhanced MRI (3D DICOMs)? #71

Open
Spenhouet opened this issue Apr 23, 2020 · 8 comments
Open

Comments

@Spenhouet
Copy link

Spenhouet commented Apr 23, 2020

I just tested an enhanced MR image from a Siemens device and got an exception telling me that time is missing:

The extension is not valid: Missing required base classification time

dcm2niix had no issue converting the enhanced MR image.

Should this generally work? Or is this not yet implemented?

I did successfully load the enhanced MR image via pydicom, but it fails on adding it to the stack:

my_stack = dcmstack.DicomStack()
src_dcm = pydicom.read_file(str(dicom_file_path))
my_stack.add_dcm(src_dcm)  #<- fails here

What is still missing for this to work? Could you need support implementing this? Do you need an example file that I can send you?

@Spenhouet
Copy link
Author

Spenhouet commented Jul 2, 2020

@moloney Any feedback on this?

@moloney
Copy link
Owner

moloney commented Aug 5, 2020

Sorry to be so slow to reply. My colleague and some other folks have done some work to improve "enhanced" (multiframe) handling in nibabel, but it isn't leveraged in dcmstack. At this point I prefer to put any time I have towards getting dcmstack functionality into nibabel, rather than implementing new functionality here.

@Spenhouet
Copy link
Author

@moloney Thank you for your reply and the clarification on the maintenance / state of this project.
I was not aware of the efforts put into nibabel and that the goal is to provide the current dcmstack functionality in nibabel. That is great news. How can we follow the state of these efforts? Are there open issues on the nibabel project with respect to this which you can link to? Or is there another way to follow the progress?

We will probably need to switch to the new nibabel implementation as soon as it is available. As of the coming October all Siemens devices here will be switched/updated to "enhanced" (multiframe).

@Spenhouet
Copy link
Author

I found this repository: https://github.com/matthew-brett/czi-nibabel (not sure if that is supposed to be public).
This looks like a really cool project!

Going by this:

The grant starts at January 1, 2021 and the milestone is to have the DICOM to NIfTI integration into Nibabel ready 3 months after that. So basically this functionality is supposed to be available in April 2021. Correct me if that is a wrong assumption.

Not sure if that includes the multiframe handling.

Sadly we will have to somehow cope with this differently. As mentioned, as of October we (and probably many more) will have be able to handle multiframe DICOMs. We really like dcmstack and did hope that we could stick to it (or the Nibable replacement), but if the above mentioned timeframe is accurate, then we will need to switch to something like dcmtk.

@yarikoptic
Copy link
Contributor

yarikoptic commented Aug 31, 2022

became also a problem for heudiconv: nipy/heudiconv#582 with the link to sample dicoms at nipy/heudiconv#582 (comment) . Detailed traceback from local execution

Traceback (most recent call last):
  File "/home/yoh/proj/heudiconv/heudiconv-master/venvs/dev3/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 398, in run
    runtime = self._run_interface(runtime)
  File "/home/yoh/proj/heudiconv/heudiconv-master/venvs/dev3/lib/python3.10/site-packages/nipype/interfaces/utility/wrappers.py", line 142, in _run_interface
    out = function_handle(**args)
  File "<string>", line 28, in embed_dicom_and_nifti_metadata
  File "/home/yoh/deb/gits/pkg-exppsy/dcmstack/src/dcmstack/dcmstack.py", line 1226, in parse_and_stack
    results[key] = stack_group(group, warn_on_except, **stack_args)
  File "/home/yoh/deb/gits/pkg-exppsy/dcmstack/src/dcmstack/dcmstack.py", line 1180, in stack_group
    result.add_dcm(dcm, meta)
  File "/home/yoh/deb/gits/pkg-exppsy/dcmstack/src/dcmstack/dcmstack.py", line 605, in add_dcm
    nii_wrp = NiftiWrapper.from_dicom_wrapper(dw, meta)
  File "/home/yoh/deb/gits/pkg-exppsy/dcmstack/src/dcmstack/dcmmeta.py", line 1561, in from_dicom_wrapper
    result = klass(nii_img, make_empty=True)
  File "/home/yoh/deb/gits/pkg-exppsy/dcmstack/src/dcmstack/dcmmeta.py", line 1280, in __init__
    self.meta_ext.check_valid()
  File "/home/yoh/deb/gits/pkg-exppsy/dcmstack/src/dcmstack/dcmmeta.py", line 306, in check_valid
    raise InvalidExtensionError('Missing required base '
dcmstack.dcmmeta.InvalidExtensionError: The extension is not valid: Missing required base classification time

@yarikoptic
Copy link
Contributor

We got another user reporting the same issue in heudiconv: nipy/heudiconv#613 . I wonder on either @matthew-brett et al in czi-nibabel achieved the desired functionality which could be used in dcmstack to handle such DICOMs?

@moloney
Copy link
Owner

moloney commented Feb 10, 2023

I just opened a PR with something that seems to be working for 3D enhanced DICOM files. Feel free to test it out and give feedback, I just want to add tests before merging. Adding support for 4D enhanced DICOM files would probably also be doable, but so far isn't a priority for me.

@psadil
Copy link

psadil commented Jan 18, 2024

What else is needed to get that pull request finished?

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

4 participants