Anatomical Preprocessing

CPAC.anat_preproc.create_anat_preproc(method='afni', already_skullstripped=False, wf_name='anat_preproc')[source]

The main purpose of this workflow is to process T1 scans. Raw mprage file is deobliqued, reoriented into RPI and skullstripped. Also, a whole brain only mask is generated from the skull stripped image for later use in registration.

anat_preproc : workflow
Anatomical Preprocessing Workflow

Source

Workflow Inputs::
inputspec.anat : string
User input anatomical (T1) Image, in any of the 8 orientations

Workflow Outputs:

outputspec.refit : string
    Path to deobliqued anatomical image

outputspec.reorient : string
    Path to RPI oriented anatomical image

outputspec.skullstrip : string
    Path to skull stripped RPI oriented mprage file with normalized intensities.

outputspec.brain : string
    Path to skull stripped RPI brain image with original intensity values and not normalized or scaled.

Order of commands: - Deobliqing the scans.

3drefit -deoblique mprage.nii.gz
  • Re-orienting the Image into Right-to-Left Posterior-to-Anterior Inferior-to-Superior (RPI) orientation ::
    3dresample -orient RPI
    -prefix mprage_RPI.nii.gz -inset mprage.nii.gz
  • Skull-Stripping the image ::
    Using AFNI ::
    3dSkullStrip -input mprage_RPI.nii.gz
    -o_ply mprage_RPI_3dT.nii.gz
    or using BET ::
    bet mprage_RPI.nii.gz
  • The skull-stripping step modifies the intensity values. To get back the original intensity values, we do an element wise product of RPI data with step function of skull-stripped data ::
    3dcalc -a mprage_RPI.nii.gz
    -b mprage_RPI_3dT.nii.gz -expr ‘a*step(b)’ -prefix mprage_RPI_3dc.nii.gz

High Level Workflow Graph: .. image:: ../images/anatpreproc_graph.dot.png

width:500

Detailed Workflow Graph: .. image:: ../images/anatpreproc_graph_detailed.dot.png

width:500
>>> from CPAC.anat_preproc import create_anat_preproc
>>> preproc = create_anat_preproc()
>>> preproc.inputs.inputspec.anat = 'sub1/anat/mprage.nii.gz'
>>> preproc.run() #doctest: +SKIP