- Freesurfer
- MATLAB
There is a strict expected directory structure. It is depicted below.
subjects/:
The folders in subjects/ are created by recon-all. You should not create them manually, or recon-all will give an error that it was previously run.
studies/:
You create all the folders in studies/.
- There should be one folder for each of your studies (experiments)
- Within
study_1/:
analysis/contains all your codes for running the analysis. This repository is my analysis directory.rawdata/is a record of the files that come directly from the scanner.- The
run_01_unpack.shscript converts and reorganizes the data from therawdata/folder tounpackdata/and into either3danat/orbold/depending on whether it is EPI or MPRAGE data.
run_01_unpackdata.sh
- Calls dcm2niix
- Must be preformed locally because the rawdata has face and MARCC is not HIPAA compliant
- The script may need to be modified depending on the run orders
run_02_deface.sh
- Calls mri_deface
- Removes the face from the MPRAGE
- Inputs are the subject name and folder name of the anatomical run
- Must be done locally for same reason as above
- FS
mri_defacehas been deprecated, so if there is an error, there is not good support to solve the problem. pydeface may be a good alternative although FSL is a dependency. Seerun_02_pydeface.shfor an example with - Example call:
source run_02_deface.sh s001 002
run_03_reconall.sh
- Calls recon-all
- Performs the cortical reconstruction on the defaced MRPAGE
- Inputs are again the subject name and the folder name of the anatomical run
- Must be done on MARCC
- Takes approximately 16 hours
- Example call:
sbatch run_03_reconall.sh s001 002
run_04_preproc.sh
- Calls preproc-sess
- Runs the processing for all functional runs
- Input is the subject name
- Performed on MARCC
- Takes about an hour
- Example call:
sbatch run_04_preproc.sh s001
run_00_mksess_loc.sh and run_00_mksess_main.sh
- Calls mkanalysis-sess and mkcontrast-sess
- These call freesurfer functions that define how the analysis will be conducted. They only have to be one one for the entire project.
- Example call:
source run_00_mkses_main.sh s001 lh - Should be done on MARCC
run_05_glm.sh
- Calls selxavg3-sess
- Finds the beta values for the specified analysis
- Must be called separately for all analyses (and hemispheres)
- Inputs are the subject name, analysis name, and
-run-wiseor nothing run-wiseis called for the maintask only- Done on MARCC
- Takes about 15-30 minutes
- Example call:
sbatch run_05_glm.sh s001 maintask-surface-lh-sm0 -run-wise - Example call:
sbatch run_05_glm.sh s001 psts-surface-lh-sm5
run_06_MNImain.sh and swurm_06_MNImain.sh
- Calls mri_surf2surf
- Converts the maintask beta values from native space to MNI space
- The swurm scrip submits many batch calls of
run_06_MNImain.sh - Inputs are the subject name and the hemisphere
- Must be called for both the left and right hemispheres
- Done on MARCC
- Takes about 1 minute
- Example call:
source swurm_06_MNImain.sh s001 lh
run_07_MNIloc.sh and swurm_06_MNIloc.sh
- Calls mri_surf2surf
- Same as above but with the localizer name
- Must be done for all localizers and hemispheres
- Done on MARCC
- Takes about 1 minute
- Example call:
source swurm_07_MNIloc.sh s001 lh FBO
Prior to the next to steps:
- On the MARCC login node:
interact -X -t 2:00:00 module load matlabmatlab-- A MATLAB GUI will open
run_08_probROIs.m
- Run in MATLAB and uses MRIread and MRIwrite
- Defines the ROIs using parcellations
- Input is the subject name
- Call in the MATLAB command line
- Example call:
run_08_probROIs('s001')
run_09_reorgdata.m
- Run in MATLAB and uses MRIread
- Selects the data within each ROI and saves it in a format for further analysis
- Input is the subject name
- Call in the MATLAB command line
- Example call:
run_09_reorgdata('s001')
check_surf.sh
- Uses freeview
- Input is the subject number
- Done after
run_03_reconall.sh - Done locally
- Example call:
source check_surf.sh s001
check_registration.sh
- Uses tkregisterfv
- Input is the subject number
- Done after
run_04_preproc.sh - Done locally
- Example call:
source check_registration.sh s001
check_motion.sh
- Uses plot-twf-sess
- Input is the subject number
- Done after
run_04_preproc.sh - Done on MARCC in an interactive session, but the png file that is created in
unpackdata/${sid}/bold/will not open - Example call:
source check_motion.sh s001
check_ROIs.sh
- Uses tksurferfv
- Inputs are the subject number, hemisphere, ROI, and contrast
- Done after
run_08_probROIs.shand after the data has been transferred from MARCC to your local machine - Done locally
- Example call:
source check_ROIs.sh s001 lh biomotion motion_translation
Licensed with MIT License
