The purpose of this document is to explain the structure and protocol of the sleep lab Lewis Cluster Group
The sleep lab group has the following major directories: raw, preprocessing, preprocessed, software, and Psychometric.
This directory contains all of the raw MRI files for SPIN2 and SPINCWP. Every participant visit has a unique folder (i.e. if the participant had multiple visits, they will have a folder for each visit). Every visit folder contains the MRI and thermal data for that visit. The MRI data is in DICOM format, and the thermal data is in an excel file.
This directory contains all of the MRI files that have additional pre-processing steps to be performed. Once all pre-processing steps are performed on an MRI file, the participant folder should be moved to PREPROCESSED.
Every MRI file in this directory should be a .nii. The first script (see PSYCHOMETRIC folder) converts the raw DICOM MRI data to compressed niifti files (.nii.gz).
If the dicom2niix script worked correctly, a folder will be created for each participant that contains the following example files: SPIN2_359_gre_field_mapping_s11_ph.nii.gz, SPIN2_359_SAG_T2_SPACE_s03.nii.gz, SPIN2_359_V1_p_run1.nii.gz, SPIN2_359_V1_p_run2.nii.gz, SPIN2_359_V1_p_run3.nii.gz, SPIN2_359_V1_r_run1.nii.gz, SPIN2_359_V1_r_run2.nii.gz, SPIN2_359_V1_t1.nii.gz
If the dicom2niix script did not work successfully, then these files will not appear as shown above. They may appear as DEIDENTIFIED, in which case they need to re-exported immediately from Radiology.
This folder contains all of the MRI files from the visits that have gone through the entirety of the preprocessing steps.
Basic order of scripts: "convert_dicom.sh", "Mc_step2_preprocessing.m", "Mc_step2_2_maxvals.m", "Mc_step3_norm123.m".
Description: This script takes a raw DICOM file in the RAW folder, converts it to .nii format, compresses the file, and places the .nii files in a new folder in PREPROCESING
The script can be ran from any directory with the absolute path name, followed by the SPIN2 ID, the visit #, and the treatment assignment.
Note, the treatment assignment can be re-specified later, so it is not essential to include in the script.
The script will assume that the visit is V1 if not otherwise specified, and it will assume an unknown treatment assignment
Command: "/storage/hpc/group/sleeplab/Psychometric/automated_processing/convert_dicom.sh SPIN2_xxx V2"
enter "Mc_step2_preprocessing.m", and allow it to run through all of the steps. If there is an error, then there is likely a problem with the .nii file or its name
- Sets path of files to be processed
- Gets subject list
- anat pattern
- functional pattern
- number of runs
- numbers of volumes, slices and TR of the fMRI scans
- slice order
- reslices to voxel size of 2mm
- specifies the bounding box of the data
- set smoothing kernel of epi data (set at 6mm)
- compute time to acquisition
- find subjects in root folder
- create subject list of all the files in the group path
- for loop to do all the following
- set primary path
- gzips all the files
- locates the corrects files
- checks to make sure the correct number of files are present
- checks the number of slices
- converts the data to float 32 to reduce precision loss
- smooths structural (FWHM 12mm)
- coregister the smoothed structural to the old T1 template
- segments the structural
- normalizes the segmented files to the T1 template
- skull strips the segmented structural files
- generates functional file names
- corrects slice timing of functional
- motion correction and realignment
- smooths the mean functional image
- coregisters the functional to the epi template
- coregisters the functional to the T1 (this is done so the anat file can be overlaid on the functional files)
- normalizes the epi data to MNI
- smooth the epi data (FWHM 6mm) ####### END OF SCRIPT
NOTE: This script was used prior to the Atlanta trip to identify excessive motion
NOTE: After the Atlanta trip we will use the ART toolbox (as of January 16, 2020 = WIP)