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

Multi-echo naming problem with Vida fit classic DICOMs #568

Closed
astewartau opened this issue Dec 19, 2021 · 3 comments
Closed

Multi-echo naming problem with Vida fit classic DICOMs #568

astewartau opened this issue Dec 19, 2021 · 3 comments

Comments

@astewartau
Copy link

astewartau commented Dec 19, 2021

Describe the bug

Multi-echo data acquired using Siemens' Vida fit, and exported as classic DICOM are not named properly by dcm2niix in relation to echo numbers when the Echo Number field of the DICOM header is not present. The resultant names produced by dcm2niix indicate that each echo was interpreted to be a single-echo scan from a different 'run', rather than multiple echoes from the same run. It should be possible to fix this by inferring the echo numbers via the required DICOM Echo Time field rather than relying on the presence of the optional Echo Number field.

To reproduce

Steps to reproduce the behavior:

Run the command dcm2niix . in a folder containing multi-echo Siemens Vida fit data exported as classic DICOM with no Echo Number field.

See the output below. Take note of the filenames and echo times in the final output:

$ print-dicom MR*.1.dcm | grep -i echo
(0018, 0081) Echo Time                           DS: "5.0"
(0018, 0091) Echo Train Length                   IS: "4"
$ dcm2niix .
Compression will be faster with 'pigz' installed
Chris Rorden's dcm2niiX version v1.0.20211006  (JP2:OpenJPEG) (JP-LS:CharLS) GCC7.5.0 x86-64 (64-bit Linux)
Found 640 DICOM file(s)
Slices not stacked: echo varies (TE 5, 12.7; echo 1, 1). Use 'merge 2D slices' option to force stacking
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 160 DICOM as ./_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1 (200x256x160x1)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 160 DICOM as ./_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1a (200x256x160x1)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 160 DICOM as ./_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1b (200x256x160x1)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 160 DICOM as ./_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1c (200x256x160x1)
Conversion required 0.387256 seconds (0.385880 for core code).
$ grep -n -H -i "echo" *.json
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1a.json:28:	"EchoNumber": 1,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1a.json:29:	"EchoTime": 0.0127,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1a.json:36:	"EchoTrainLength": 4,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1b.json:28:	"EchoNumber": 1,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1b.json:29:	"EchoTime": 0.0281,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1b.json:36:	"EchoTrainLength": 4,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1c.json:28:	"EchoNumber": 1,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1c.json:29:	"EchoTime": 0.0204,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1c.json:36:	"EchoTrainLength": 4,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1.json:28:	"EchoNumber": 1,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1.json:29:	"EchoTime": 0.005,
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1.json:36:	"EchoTrainLength": 4,

Expected behavior

Each file should be named according to the inferred echo number based on the temporal order of the required Echo Time field, rather than the optional Echo Number field. For instance:

_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e1
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e2
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e3
_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e4

Version

$ dcm2niix -v
Compression will be faster with 'pigz' installed
Chris Rorden's dcm2niiX version v1.0.20211006  (JP2:OpenJPEG) (JP-LS:CharLS) GCC7.5.0 x86-64 (64-bit Linux)
v1.0.20211006

Troubleshooting

  • Used latest stable build on Linux
  • Tried running using development branch on Linux - issue still persists
@neurolabusc
Copy link
Collaborator

This is related to issue 538. The XA30 data format has evolved rapidly (in a good way), but I have very little access to sample datasets. Feel free to send a sample dataset to me (compress the DICOMs, share a link to the compressed file with the personal email in my avatar).

My other suggestion would be to export the data as enhanced DICOM instead of classic DICOM. See issue 236 for more details.

@astewartau
Copy link
Author

Thanks for the informative response - I have sent you an email. :)

@neurolabusc
Copy link
Collaborator

As you note, these DICOMs omit echo number (0018,0086). This is a type 3 attribute, so these are technically valid DICOMs. However, I believe this was resolved with XA30 (and perhaps on your XA20 is you export image as enhanced rather than DICOM). I believe that the XA20 was a stop gap between the impoverished XA10/XA11 images and the more mature XA30. I would certainly see if this instrument is eligible for an upgrade. I worry about the maintainability of adding code to handle this transient release (indeed, the code is already littered with kludges for the early XA aberrations). Please try out the commit to the development branch (v1.0.20211220) which explicitly inserts the echo time into the filename for multi echo sequences where 0018,0086 is omitted. Alternatively, you can use the Matlab based dicm2nii which includes the logic to infer the echo number.

As an aside, I do think that the echo number is reported as the first field in the proprietary ICE dims (0021,1106). For example, the 99th slice of the 4th echo reports X_4_1_1_1_1_99_1_1_1_1_1_277. However, I do not know if echo time is always in this position. Does anyone know whether the order of attributes in 0021,1106 is fixed? It seems like the number of items has grown over time.

Slices not stacked: echo varies (TE 12.7, 28.1). No echo number (0018,0086; issue 568). Use 'merge 2D slices' option to force stacking
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 160 DICOM as /Users/chrisrorden/neuro/issue568/7/7_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e12.7 (200x256x160x1)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 160 DICOM as /Users/chrisrorden/neuro/issue568/7/7_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e28.1 (200x256x160x1)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 160 DICOM as /Users/chrisrorden/neuro/issue568/7/7_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e5 (200x256x160x1)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 160 DICOM as /Users/chrisrorden/neuro/issue568/7/7_t2_swi_tra_p2_1mm_iso_trial_pw_20210728103620_7_e20.4 (200x256x160x1)

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