PUMI.pipelines.anat package

PUMI.pipelines.anat.anat2mni module

PUMI.pipelines.anat.anat2mni.anat2mni_ants(wf, ref_head=None, ref_brain=None, **kwargs)[source]

Todo docs

PUMI.pipelines.anat.anat2mni.anat2mni_ants_hardcoded(wf, ref_head=None, ref_brain=None, **kwargs)[source]

Todo docs

PUMI.pipelines.anat.anat2mni.anat2mni_fsl(wf, ref_head=None, ref_brain=None, ref_brain_mask=None, **kwargs)[source]

#Todo Docs

PUMI.pipelines.anat.anat2mni.qc(wf, **kwargs)[source]

Create quality check images for brain coregistration.

Inputs:

in_file (str): Path to the registered brain.

Ouputs:

out_file (str): Path to the quality check image

Sinking:
  • The quality check image

PUMI.pipelines.anat.anat_proc module

PUMI.pipelines.anat.anat_proc.anat_proc(wf, bet_tool='FSL', reg_tool='ANTS', **kwargs)[source]

Performs processing of anatomical images: - brain extraction (with either FSL or HD-BET) - tissue type segmentation with FSL - spatial standardization (with either FSL or ANTS)

ATTENTION: Images should be already “reoriented” (e.g. with fsl fslreorient2std)

Parameters:
  • bet_tool (str) – Set to brain extraction tool you want to use. Can be ‘FSL’ or ‘HD-BET’

  • reg_tool (str) – Set to registration tool you want to use. Can be ‘FSL’ or ‘ANTS’

Inputs:

brain (str): Path to the brain which should be segmented. stand2anat_xfm (str): Path to standard2input matrix calculated by FSL FLIRT. Only necessary when using prior probability maps!

Outputs:

brain (str): brain extracted image in subject space brain_mask (str): brain mask in subject space std_brain (str): spatially standardised brain extracted image head (str): full head image in subjacet space partvol_map (str): hard segmented tissue map anat2mni_warpfield (str): spatial standardization warping field probmap_csf (str): csf probability map. probmap_gm (str): gm probability map. probmap_wm (str): wm probability map mixeltype (str): mixeltype volume file parvol_csf (str): csf partial volume file parvol_gm (str): gm partial volume file parvol_wm (str): wm partial volume file partial_volume_map (str): Path to partial volume map

Acknowledgements:

Adapted from Tamas Spisak (2018) code.

PUMI.pipelines.anat.func_to_anat module

PUMI.pipelines.anat.func_to_anat.func2anat(wf, bbr=True, **kwargs)[source]

Registration of functional image to anat.

Parameters:

bbr (bool) – If True (default), BBR registration is used. If False, linear registration is used.

Inputs:

func (str): One volume of the 4D fMRI (The one which is the closest to the fieldmap recording in time should be chosen e.g: if fieldmap was recorded after the fMRI the last volume of it should be chosen) head (str): The oriented T1w image. anat_wm_segmentation (str): WM probability mask anat_gm_segmentation (str): GM probability mask anat_csf_segmentation (str): CSF probability mask

Acknowledgements:

Adapted from Balint Kincses (2018) code. Modified version of CPAC.registration.registration (https://github.com/FCP-INDI/C-PAC/blob/main/CPAC/registration/registration.py)

PUMI.pipelines.anat.func_to_anat.func2anat_qc(wf, **kwargs)[source]

Create and save quality check image for func2anat workflow

Inputs:

func2anat (str): path to out_file of func2anat workflow wm_bb_mask (str): white matter mask calculated in func2anat workflow

Outputs:

out_file (str): path to quality check image

Sinking

func2anat quality check image

PUMI.pipelines.anat.segmentation module

PUMI.pipelines.anat.segmentation.bet_fsl(wf, fmri=False, volume='middle', **kwargs)[source]

Performs Brain extraction of a 3d-vloume. User can choose the position of the 3d-volume

Parameter:

fmri(bool):

Inputs:

in_file(str): Path to the functional 4d-image.

Outputs:

out_file(str): brain_mask(str):

PUMI.pipelines.anat.segmentation.bet_hd(wf, **kwargs)[source]

Does brain extraction with HD-Bet.

PUMI.pipelines.anat.segmentation.defacing(wf, **kwargs)[source]

Pipeline for defacing anatomical images. Also creates quality check images

Inputs

in_file(str): Path to anat image.

Outputs

out_file(nii.gz) : Defaced anatomical image

deface_mask(str): Path to the defacing mask.

Sinker - Defaced anatomical image

PUMI.pipelines.anat.segmentation.pydeface_wrapper(infile, force)[source]

Workaround to store the defaced image in the correct place with useful name

PUMI.pipelines.anat.segmentation.qc_segmentation(wf, fmri=False, **kwargs)[source]

Create quality check images for background extraction workflows

Inputs:

background (str): Path to the extracted brain. overlay (str): Path to the overlay.

Outputs:

out_file (str): Path to the quality check image

Sinking: - The quality check image

PUMI.pipelines.anat.segmentation.qc_tissue_segmentation(wf, **kwargs)[source]

Create quality check images for tissue segmentation workflows

Inputs:

in_file (str): Path to the partial volume map

Outputs:

out_file (str): Path to the quality check image

Sinking: - The quality check image

PUMI.pipelines.anat.segmentation.tissue_segmentation_fsl(wf, priormap=True, **kwargs)[source]

Perform segmentation of a brain extracted T1w image.

Parameters:

priormap (bool) – Set to True if you want to use prior probability maps. In that case the stand2anat_xfm input is needed (otherwise not).

Inputs:

brain (str): Path to the brain which should be segmented. stand2anat_xfm (str): Path to standard2input matrix calculated by FSL FLIRT.

Only necessary when using prior probability maps!

Outputs:

probmap_csf (str): Path to csf probability map. probmap_gm (str): Path to gm probability map. probmap_wm (str): Path to wm probability map mixeltype (str): Path to mixeltype volume file parvol_csf (str): Path to csf partial volume file parvol_gm (str): Path to gm partial volume file parvol_wm (str): Path to wm partial volume file partial_volume_map (str): Path to partial volume map

Sinking: - The probability maps for csf, gm and wm.

Acknowledgements:

Modified version of CPAC.seg_preproc.seg_preproc (https://github.com/FCP-INDI/C-PAC) and Balint Kinces code (2018)

For a deeper insight: