Sign inSign up

ccplabwustl/dcm2bids

By ccplabwustl

•Updated over 5 years ago

Image
0

886

ccplabwustl/dcm2bids repository overview

⁠DCM2BIDS:

This container is developed by the Cognitive Control & Psychopathology Laboratory at Washington University St. Louis to convert dicom images to Nifti images and to structure the resulting images into BIDS format.

⁠Installation

First you will want to Download the container using either singularity or docker

⁠Download the container using docker:
docker pull ccplabwustl/dcm2bids:latest
⁠Download the container using singularity:
singularity build dcm2bids.simg docker://ccplabwustl/dcm2bids:latest

This will create a singularity image name dcm2bids.simg in the location you are currently in.

⁠Usage

⁠Example:

singularity run -B /data/nil-external/ccp/Jeffers/Session_downloads/132017:/mnt/mydata \
/data/nil-bluearc/ccp-hcp/SingularityImages/dcm2bids-04-07-19.simg \
--configFile /mnt/mydata/132017_proactive_BIDS_config.ini \
--inputDir /mnt/mydata/proactive/132017_proactive/ \
--outputDir /mnt/mydata \
--overwrite \
--cleanup \
--addSession
⁠Explain:

In this section I'll explain the usage of each of the

--configFile (Required) should be an .ini File that will be used to format your data. This is the crux of the program I have some example ones here: /data/nil-bluearc/ccp-hcp/SingularityImages/BIDSconfigs Please take a look at these. I highly suggest you make a copy of one of these and fill it out for your own session

--inputDir (Required) This is where your dicom scans live
--outputDir (Required) This is where you would like your output to be located. a file called BIDS will be located in this direcotry
--overwrite (Optional) This tells the program to overwrite whatever a previously made BIDS folder in the outputDir. Use this if you tried to run once but it failed for some reason
--cleanup (Optional) This will cleanup the BIDS folder when completed, removing any unused nifti and json files.
--addSession(Optional) This will allow you to place a new session in a previously created BIDS folder

⁠Config.ini File:

.ini files are used to configure the conversion, renaming and storage of the images. Below will be some examples of the ini file in cases where there is known scan numbers and unknown scan numbers.

⁠Known Scan Numbers .ini File

The below use case is where we know the exact scan numbers for a subject in a given session.

[DEFAULT]
subject=4001
session=01

buildBIDSDirectories=true
dcm2niix=true
defaceAnats=true

useAnats=true
useBolds=true
useSBRefs=true
useFMaps=true

[ANAT]
# This is a list of your anatomical images that you would like to use for this session. you can use as many as you want just make sure you add them to the:
# Anatlist and add the scan number as below

AnatNaming=sub-[subject]_ses-[session]_[anat]

AnatList=T1w T2w

T1w=13
T2w=17


[FUNC]
# This is a list of your task images that should be used for this session
# each task should have its own section with three parameters
# taskname-Bold which is the scan numbers of the desired bold images
# taskname-ExpectedNumOfTRs which is the expected number of frames for the each data set
# if you dont have an expected number of frames or if your task is variable length put a star
# taskname-sbref this is a list of the sbrefs for each of these scans


BoldNaming=sub-[subject]_ses-[session]_task-[task]_acq-mb[MB][DIR]_run-[runNum]_bold
SBRefNaming=sub-[subject]_ses-[session]_task-[task]_acq-mb[MB][DIR]_run-[runNum]_sbref

FuncList=COGED EFFRT REST1 REST2

COGED-Bold=20 22 24
COGED-ExpectedNumOfTRs=* * *
COGED-SBRef=19 21 23

EFFRT-Bold=28 30 32
EFFRT-ExpectedNumOfTRs=* * *
EFFRT-SBRef=27 29 31

Rest1-Bold=34
Rest1-ExpectedNumOfTRs=*
Rest1-SBRef=33

Rest2-Bold=36
Rest2-ExpectedNumOfTRs=*
Rest2-SBRef=35


[FMAP]
# This is the FMapField These scans will be placed in the fmap folder in the bids directory
# Each feild mab will be given a intended for field in their jsons
 
FMapNaming=sub-[subject]_ses-[session]_acq-mb4[DIR]_dir-[DIR]_run-[runNum]_epi

fmap=7 8 25 26
⁠Unknown Scan Numbers .ini File

Below is an example where we dont know the exact scan numbers for each task. If you're wanting to run multiple subjects this would be a good option to automate the conversion process.

[DEFAULT]
subject=150423
session=wave1rea

buildBIDSDirectories=true
dcm2niix=true
defaceAnats=false

useAnats=false
useBolds=true
useSBRefs=true
useFMaps=true

[ANAT]
# This is a list of your anatomical images that you would like to use for this session. you can use as many as you want just make sure you add them to the:
# Anatlist and add the scan number as below

AnatNaming=sub-[subject]_ses-[session]_[anat]

AnatList=T1w T2w

T1w=11
T2w=13


[FUNC]
# This is a list of your task images that should be used for this session
# each task should have its own section with three parameters
# taskname-Bold which is the scan numbers of the desired bold images
# taskname-ExpectedNumOfTRs which is the expected number of frames for the each data set
# if you dont have an expected number of frames or if your task is variable length put a star
# taskname-sbref this is a list of the sbrefs for each of these scans

BoldNaming=sub-[subject]_ses-[session]_task-[task]_acq-mb[MB][DIR]_run-[runNum]_bold
SBRefNaming=sub-[subject]_ses-[session]_task-[task]_acq-mb[MB][DIR]_run-[runNum]_sbref

FuncList=Axcpt Cuedts Stern Stroop Rest

Axcpt-RegEx=\w*(tfMRI_Axcpt)\w*.nii.gz\b
Axcpt-Bold=auto
Axcpt-ExpectedNumOfTRs=* *
Axcpt-SBRef=auto

Cuedts-RegEx=\w*(tfMRI_Cuedts)\w*.nii.gz\b
Cuedts-Bold=auto
Cuedts-ExpectedNumOfTRs=* *
Cuedts-SBRef=auto

Stern-RegEx=\w*(tfMRI_Stern)\w*.nii.gz\b
Stern-Bold=auto
Stern-ExpectedNumOfTRs=* *
Stern-SBRef=auto

Stroop-RegEx=\w*(tfMRI_Stroop)(?!Test)\w*.nii.gz\b
Stroop-Bold=auto
Stroop-ExpectedNumOfTRs=* *
Stroop-SBRef=auto

Rest-RegEx=\w*(rfMRI_Rest)\w*.nii.gz\b
Rest-Bold=auto
Rest-ExpectedNumOfTRs=* *
Rest-SBRef=auto



[FMAP]
# This is the FMapField These scans will be placed in the fmap folder in the bids directory
# Each feild mab will be given a intended for field in their jsons
 
FMapNaming=sub-[subject]_ses-[session]_acq-mb4[DIR]_dir-[DIR]_run-[runNum]_epi
fmap-RegEx=\w*(SpinEchoFieldMap)\w*.nii.gz\b
fmap=auto

Tag summary

Content type

Image

Digest

Size

4.2 GB

Last updated

about 6 years ago

docker pull ccplabwustl/dcm2bids