Update dcm2niix within an existing dcm2bids environment

Summary of what happened:

Hello!

sorry for the many questions, any help is appreciated!

The scanner was updated to AX30 and the file format apparently requires the newest version of dcm2niix.
Previously, I was successfully using dcm2bids and would like to continue using it.
a) is this still possible if I update the dcm2niix?
b) are there instructions/tutorials on how to only update the dcm2niix when the environemnt is with Docker? If not, do I need to reinstall/recreate the environment?

The next question is about the new file output received from the scanner.
The old folders, after unzipping them, were as follows:

* - StudyName_Sub#_PIName_date_numbers
*            - MOCOSERIES_001
*            - MPRAGE_002
*            - TASK_003
*                 - study name_PIname_ long string of numbers

New folders are:

>  -StudyName_Sub#_date
>         - study name_PIname_ long string of numbers

With the new system, I don’t have the subfolders telling me which acquisition each files belongs to. How can I fill out the dcm2bids configuration files in this case? I’m also waiting to hear back from the scanner tech to make sure it wasn’t an error when sending me the files.

Once I successfully export the new files to NIFTI, do I need to make changes to fMRIprep and AFNI for processing?
Because part of my participants were acquired before the update, are there specific considerations I need to keep in mind if I want to group them for analyses?

Thank you,
Ilaria

Hi @ilaria,

Yes

You can either (1) ask the developers to release a new container with the latest dcm2niix (@abore) . (2) Bind a local version of dcm2niix into the Docker container when you run it (probably the more complicated, least recommended method). (3) Use dcm2bids in an Anaconda virtual environment, where you can control software versions.

After running dcm2bids_helper you can look at the JSON files and see what can be used to associate with each scan. Usually SeriesDescription is a good bet.

No, as long as the file structure is BIDS valid, fMRIprep should run fine.

Unsure, maybe @neurolabusc would know better?

Best,
Steven

Hello, I am in the same situation (working with XA30 data) but using Heudiconv. I am wondering , would the Anaconda solution work for Heudiconv as well, or alternatively, is there a way to specify the dcm2niix version within the Heudiconv docker command?

Hi @Aisa2 and welcome to neurostars!

Sure! You can install heudiconv in a conda environment with conda install -c conda-forge heudiconv. Then install whatever version of dcm2niix you need in that environment too.

You can, it’s a bit tricky. Basically, you want to trick the container to using a local installation of dcm2niix. This can be achieved by mounting your local dcm2niix overwriting the one in the container. In the most recent container, I ran which dcm2niix and found that the command lives in /opt/dcm2niix-v1.0.20220720/bin/dcm2niix. So, in addition to whatever your current command is, you need to include the following:

dcm2niix_path=$(which dcm2niix) # Make sure this points to the correct version

singularity run -e --containall \
-B ${dcm2niix_path}:/opt/dcm2niix-v1.0.20220720/bin/dcm2niix (REST OF COMMAND GOES HERE)

You may need to bind the folder where you dcm2niix lives as well, in case the command calls on other scripts. Does that make sense?

Best,
Steven

1 Like

Hi Steven,

Thanks for your help! I think I understand. Although since I’m running on docker alone instead singularity, I think the command would be different. Maybe something like:

dcm2niix_path=$(which dcm2niix) \ # Make sure this points to the correct version
docker run -rm -it -v ${dcm2niix_path}:/opt/dcm2niix-v1.0.20220720/bin/dcm2niix (REST OF COMMAND)

Am I on the right track?

Yup, looks right! (although I am not a frequent Docker user)

And you can always do the Anaconda version if it doesn’t work.

Thank you, Steven, I managed to get it working!

Hi @Aisa2,

There is a second way to deal with this issue. You could use the bin available here. Then, you only need to have dcm2niix in your path to make it work.

Best
Arnaud

1 Like