Here are some examples for each of the 25 Freesurfer commands, along with their definitions:
Command | Definition | Example |
---|---|---|
recon-all | The main pipeline for processing structural MRI images. | recon-all -i input.nii.gz -s subject -all |
mri_convert | Converts MRI data between different file formats. | mri_convert input.dcm output.nii.gz |
mris_inflate | Inflates the cortical surface to better visualize gyral and sulcal patterns. | mris_inflate lh.white lh.inflated -n 50 |
mri_ca_register | Registration of an individual subject to a probabilistic atlas. | mri_ca_register -subjid subject -hemi lh -align-after talsrcimg.mgz |
mri_label2vol | Transforms a cortical surface label to a 3D volume. | mri_label2vol --label label.lh --temp orig.mgz --o label.nii.gz --identity |
mris_calc | Performs mathematical operations on the values between two surfaces. | mris_calc lh.thickness lh.area lh.volume |
mri_vol2surf | Projects data from a volumetric file to a cortical surface. | mri_vol2surf --src input.nii.gz —hemi lh --o output.nii.gz |
mri_watershed | Skull-stripping algorithm to remove non-brain tissue from an image. | mri_watershed -T1 brain_preprocessed.mgz brain_watershed.mgz |
mri_surf2surf | Transfers data between different subjects' cortical surfaces. | mri_surf2surf --hemi lh --srcsubject source --trgsubject target --sval source.mgz --tval target.mgz |
mri_segstats | Computes statistics on segmented volumes. | mri_segstats --seg aseg.mgz --ctab cortex_labels.txt --summaryout stats.txt |
mri_robust_register | Robust registration of two MRI images using intensity-based correlation. | mri_robust_register --mov source.mgz --dst target.mgz --lta register.lta |
mris_smooth | Smoothes the cortical surface. | mris_smooth -i input.mgz -o output.mgz --n 5 |
mri_gcaatlas | Performs atlas-based segmentation using a Gaussian Classifier Atlas. | mri_gcaatlas -t transforms.lta -n 5 -a gcatlas.mgz -o output.mgz |
mri_aparc2aseg | Combines cortical and subcortical segmentations into a single file. | mri_aparc2aseg --s subject --o asegup.mgz |
mris_anatomical_stats | Computes various anatomical statistics about the cortical surface. | mris_anatomical_stats -f output.txt -l label.lh |
mri_pose_estimate | Estimates the subject's head position within the MRI scanner. | mri_pose_estimate --input orig.mgz --output pose.txt |
mris_preproc | Preprocesses surface data for analysis. | mris_preproc --s subject --hemi lh --meancurv --out preprocessed_output.mgz |
mri_concat | Combines multiple MRI volumes into one. | mri_concat --i input1.mgz --i input2.mgz --o combined.mgz |
mris_fwhm | Computes the full-width at half-maximum smoothness of a surface dataset. | mris_fwhm --s subject --hemi lh --smooth-only --fwhm 5 |
mris_curvature | Computes the curvature of a surface. | mris_curvature -thresh 0.999 -sulc lh.sulc -output lh.curvature_output.nii.gz |
mri_ca_normalize | Normalizes intensity values in an MRI volume using a probabilistic atlas. | mri_ca_normalize -c ctrl_point.mgz -mask brainmask.mgz -atlas gcaatlas.mgz -o norm_output.mgz |
mri_binarize | Binarizes an MRI volume by thresholding the intensity values. | mri_binarize --i input.mgz --min 50 --max 100 --o binary_output.mgz |
mri_label2label | Transforms labels between subjects and/or hemisphere surfaces. | mri_label2label --srclabel label.lh --srcsubject source --trgsubject target --trglabel target_label.lh --regmethod surface |
mri_cvs_register | Registers a subject to a common coordinate system used for group analysis. | mri_cvs_register --mov input.mgz --cvs cvsatlas --lta output.lta --interp 5 |
mri_diff | Computes the difference between two MRI volumes. | mri_diff --in1 input1.mgz --in2 input2.mgz --diff diff_output.mgz |
Here are the top problems encountered while trying to install Freesurfer, along with their solutions and Linux-specific commands:
wget
and extract it:wget -c https://link/to/freesurfer_download.tar.gz
tar -zxvf freesurfer_download.tar.gz
df -h
.
export FREESURFER_HOME=/path/to/freesurfer
export SUBJECTS_DIR=$FREESURFER_HOME/subjects
source $FREESURFER_HOME/SetUpFreeSurfer.sh
sudo apt-get update
sudo apt-get install tcsh libjpeg62
rm -rf /path/to/old_freesurfer/
sudo
where needed.sudo apt-get install some_required_library
md5sum
or sha256sum
:md5sum input_file.nii.gz
sha256sum input_file.nii.gz