-
Notifications
You must be signed in to change notification settings - Fork 1
DICOM Conversion
Here we will outline how to modify the scripts that are used to convert the DICOM files (raw files obtained from the scanner) to NIFITI files (files that will be used for all processing and analyses.
THIS IS THE STEP THAT YOU DO ONCE FILES ARE COPIED FROM CD TO HPC
First you'll need to navigate to the following directory: /home/data/madlab/scripts/preproc_scripts
In this directory you'll find three files that are essential for the dicom conversion process:
1) convert_dicoms_{NAME OF STUDY}.sh
2) dicomconvert2.py
3) heuristic_{NAME OF STUDY}.py
-
The convert_dicoms_{NAME OF STUDY}.sh script is the submission script. You'll need to change the directory pointing to the dicoms (-d), change the directory pointing to the output (-o), change which heuristic_{NAME OF STUDY}.py file we are using, and change the subject ID (this can be a list of subject IDs).
-
The dicomconvert2.py script is the main script that does all of the work. This has been modified from the following file (https://gist.github.com/satra/8701942) to work with GE scanner dicoms and dicoms for a single study distributed across many directories.
-
The heuristic_{NAME OF STUDY}.py file is the study specific file that needs to change and determines how your file naming and directory structure will be established. You will use information obtained from the scanner protocol (i.e., number of volumes; scan name - so think carefully when setting up a new protocol, etc...). You may need to run the create_dicominfo.py script on a single participant to identify the relevant information to appropriately name things during the conversion process.
Once the scripts are edited you can submit the jobs to the queue via the LSF scheduler with the following command from the /home/data/madlab/scripts/preproc_scripts directory:
bsub -q PQ_madlab -e /scratch/madlab/crash/dcmcnvt_err -o /scratch/madlab/crash/dcmcnvt_out < convert_dicoms_{NAME OF STUDY}.sh
This, if successful, will take a couple of hours to run (3-4). If everything finishes without any errors you should find folders and data corresponding to the data collected at the scanner in the following locations:
/home/data/madlab/data/mri/{PROJECT}/{SUBJECT_ID}
replace {PROJECT} with the specific project name and {SUBJECT_ID} with the specific subject id of the participants run
Within that base directory you'll find an anatomy directory which contains the following files and directories:
T1_001_dicom T1_001.nii.gz T1_001_prov.ttl T1_001_scaninfo.json
In the T1_001_dicom directory you'll find the dicoms (symlinked) that make up the T1-weighted anatomical scan. The T1_001.nii.gz is the actually scan; use afni or fslview to look at the scan and make sure it looks like a brain.
You'll also find a bold directory which contains the following files and directories:
bold_001 bold_002 bold_00{TOTAL NUMBER OF RUNS}
replace {TOTAL NUMBER OF RUNS} with the number of runs collected at the scanner
Within the run specific directories you'll find files that correspond to the actually data bold.nii.gz take a look at this file using afni or fslview to make sure it looks like a T2* weighted EPI image and use 3dinfo bold.nii.gz to make sure that it has the appropriate number of volumes (i.e., what you collected at the scanner).
You'll also find dmri and rsfmri directories (if they were collected) which contain the files corresponding to the diffusion weighted data and the resting state data.
Use the same tools mentioned above to visualize the data and make sure that no scanner or conversion related artifacts are in the data.
ALWAYS VISUALIZE YOUR DATA AFTER CONVERTING IT!!!
IF YOU SEE ABNORMALITIES TELL SOMEONE.
- Moving DICOMs to HPC
- DICOM Conversion
- Freesurfer Recon_All, Quality Assurance, and Resubmission
- Preprocessing
- Normalization To Be Completed
- Creation of EV Files
- First Level Analysis
- Second Level Analysis To Be Completed
- Group Level Analysis To Be Completed
- DWI To Be Completed