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

Possible enhancement to BIDS output #108

Closed
seandoyle opened this issue Jun 20, 2017 · 4 comments
Closed

Possible enhancement to BIDS output #108

seandoyle opened this issue Jun 20, 2017 · 4 comments

Comments

@seandoyle
Copy link

Hi -
I want to make some additions to the BIDS format data but I'd like to do it in a way that would be useful to others. I'm just reading up on BIDS tonight for the first time. I have two questions:

  1. Is there a dictionary of existing DICOM fields? for example - I want to add the FrameOfReferenceUID. This would be useful to see if two NIFTI files are in the same geometric space.
  2. Is it an abuse of BIDS to add sets of objects in a JSON file? Specifically - I'd like to add an array of images. Each image would contain attributes that enabled easy matching back to the original DICOM. Perhaps SOPInstanceUID, InstanceNumber... maybe SliceLocation (although that should be able to be calculated from other NIFTI data.

Use case for #1: A DICOM study might have two series - one with 2.5mm slices and another with 5.0mm slices. If they are in the same frame of reference - I might algorithmically find a feature on the thin slices but report it back to a user reading the thick slices.

Use case for #2: if I export DICOM to NIFTI for machine learning algorithms and a separate process generates findings on a particular slice - it's easy to map it back to the original data. Alternatively - if another process generates annotations on the original DICOM data - I can link it to the NIFTI slices.

Of course - if I keep adding attributes to then in the limit we get DICOM again!

I don't know if this is the correct forum for asking this sort of question. If there is a better one (or a better approach) please let me know. My goal is to close a loop - we export data as NIFTI for processing - but then return the results to a clinical context.

Thanks

Sean

@neurolabusc
Copy link
Collaborator

Sean-

Short answer:

This is not the correct forum - this software implements the BIDS standard but does not define it. If you can get this feature added to the specification, I will include it.

Long answer:

First of all, dcm2niix is really designed for speed, and does not allow the user to request specific DICOM elements. You might be able to hack a solution by piping the output of the logorrheic verbosity ("-v 2"). However, I think other tools like the Python-based dcmstack or Matlab-based dicm2nii might be better suited. On the other hand, you can always fork dcm2niix and modify it in any way you wish (hint: the softwareVersions works just the way you envision, copying a DICOM-based string to the BIDS format).

In general, I am open to the idea of adding useful elements to the BIDS output. However, in this particular case I am worried about unintended consequences. Consider the case of two scans from the same series with identical slice angulation but one being a 2D acquisition and the other being 3D. In this case, the former preserves orientation (required for slice timing correction) where in the latter the image is losslessly rotated to match the NIfTI identity matrix as closely as possible. My sense is the most robust solution is to read the NIfTI SForm or QForm to determine the spatial coordinates and axis. While this may be more complicated, it provides a robust, universal solution.

If you look at the current BIDS output of dcm2niix you will see I have attempted to include (1) all of the information I can that is required by the BIDS specification plus (2) a few elements that I think are useful and unambiguous. I admit the latter set is arbitrary, and @chrisfilo ultimately maintains the BIDS implementation in dcm2niix. If he wants something added or removed, I always defer to him.

@seandoyle
Copy link
Author

seandoyle commented Jun 20, 2017 via email

@chrisgorgo
Copy link
Collaborator

chrisgorgo commented Jun 20, 2017 via email

@seandoyle
Copy link
Author

seandoyle commented Jun 20, 2017 via email

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

3 participants