T-19: automated segmentation in freesurfer¶
Coding period starts in 19 days. So I'm focusing on preparing my
dataset for analysis. As I mentioned yesterday, I have structural
MRIs for 10 subjects, in the form of .nii files. Today, I started
automated cortical and subcortical reconstruction using freesurfer.
Below is the bash code I use.
for i in 503 506 507 512 513 517 518 519 522 533;
do fsl_sub -l /data/logs/ recon-all -subjid $i -i {i}_mprage.nii -all;
done
Since MRI reconstruction tends to take several hours per subject,
if you have access to a cluster or more than one processor, its
better to do these in parallel. At my lab, I have access to a local
cluster. The command ...
fsl_sub
sends jobs to my cluster. The argument ...
-l /data/logs/
specifies where to send log files, which come in handy if my code
crashes for some reason.
The rest is freesurfer syntax.
recon-all
tells freesurfer to run cortical reconstruction
-subjid $i
is the id for the current subject
-i {i}_mprage.nii tell
specifies the input file for the structural MRI.
And finally ...
-all
tells freesurfer to setup subject directories and perform
subcortical segmentation.
This code should take about 10 hours to run, so hopefully we
can get started tomorrow.