Dcm2bids for multi echo for AFNI

I’m using a multi echo sequence for the first time, it seems that AFNI requires one data set per echo time. I’m using dcm2bids to convert my dicom to nifti format but it only generates one file with one echo time as shown in the json file; and the resulting nii is really awful as it includes the 3 echo time on random slices
Do you know how to fix that?

Thank you very much in advance.

@Lysianne which version of dcm2niix is installed on your computer ?
@neurolabusc is there a way dcm2niix can fix this issue ? dcm2bids will take care of it once split. dcm2bids dcm2niix

dcm2niix or dcm2niix_afni (the version bundled with afni) should have no problem at all separating out the echoes…unless something has gone very wrong. What type of scanner are you using? And what type of sequence, a built in or a WIP?

It has been a long time since it concatenated echoes (at least, I think it did at some point…). You could always separate the data using something like 3dTcat -tr YOURTR -prefix your_filename_here_echo-1.nii.gz your_bad_data_here.nii,gz'[0..$(3)]' in this case assuming 3 echoes, then just cycle through '[1..$(3)]','[2..$(3)]' to get the others. See here for details: Common Option for Most AFNI Program

@Lysianne dcm2niix should accurately order images and save each echo time as a separate folder. You can remove the dcm2bids wrapper from the equation by running dcm2niix directly on your data:

dcm2niix /path/to/dicoms

You should always ensure you use the latest version of dcm2niix (it is released in the spring and autumn). If you are not using dcm2niix v1.0.20230411
you should upgrade - the DICOM standard, manufacturers implementations, the BIDS specification are all evolving.

It might be worth including the JSON file created by dcm2niix which will reveal the manufacturer and software version of the scanner. My first assumption is that vital details were removed from your DICOM data by an anonymization tool - I would check the provenance of your images and see if you can get the data directly from the scanner.

Thanks you all for your responses,
@abore and @neurolabusc ; the dcm2niix version I have is: v1.0.20230411
I’m attaching the json file here ( as a .txt cause it did not let me upload .json). I think it provides all the information.

But it seems to be a sequence issue so I think I will have to give a try to the splitiing option; thank @dowdlelt for the idea.

scans_[XT-ID_20-M-0159]NNU-_20230823101219_25.txt|attachment (1.9 KB)

I have never seen a GE multi-echo dataset before. Would it be possible to send me a sample datasetr as a link (e.g. globus, google drive, etc) to my institutional email. Alternatively, @mr-jaemin may be able to create simulated GE data.

The JSON indicates a NIH custom sequence was used (epiRTnih).
@Brice it would be great if you could provide a sample dataset to @neurolabusc using GE prototype HyperMEPI, which is also widely used.

Yes, I can have a look at what data I have at hand that can be shared (or acquired a new one whenever possible).
The GE prototype MEPI / HyperMEPI dicoms have been working well with dcm2niix since at least 2015. However, these 2 prototypes are usually used in Multiphase mode and not “fMRI” / “RT” mode.
Once the images are converted, you get 3 NIfTI files one per echo.
It might worth talking to the developer of “epiRTnih”.

Oh they provided me a python script to be able to do that.
Thank you all for your help !


This has been addressed offline, but, in case anyone else comes across this thread, this is a known issue for a site-specific pulse sequence. More details are here: GE Multi-echo sequences · Issue #359 · rordenlab/dcm2niix · GitHub

1 Like