aslprep.niworkflows.func.util module
Utility workflows.
- init_enhance_and_skullstrip_asl_wf(brainmask_thresh=0.5, name='enhance_and_skullstrip_asl_wf', omp_nthreads=1, pre_mask=False)[source]
Enhance and run brain extraction on a ASL image.
- This workflow takes in a ASL
average/summary (e.g., a reference image
averaging non-steady-state timepoints), and sharpens the histogram with the application of the N4 algorithm for removing the INU bias field and calculates a signal mask.
Steps of this workflow are:
Calculate a tentative mask by registering (9-parameters) to fMRIPrep’s EPI -aslref template, which is in MNI space. The tentative mask is obtained by resampling the MNI template’s brainmask into aslref-space.
Binary dilation of the tentative mask with a sphere of 3mm diameter.
Run ANTs’
N4BiasFieldCorrection
on the input ASL average, using the mask generated in 1) instead of the internal Otsu thresholding.Calculate a loose mask using FSL’s
bet
, with one mathematical morphology dilation of one iteration and a sphere of 6mm as structuring element.Mask the INU-corrected image with the latest mask calculated in 3), then use AFNI’s
3dUnifize
to standardize the T2* contrast distribution.Calculate a mask using AFNI’s
3dAutomask
after the contrast enhancement of 4).Calculate a final mask as the intersection of 4) and 6).
Apply final mask on the enhanced reference.
Step 1 can be skipped if the
pre_mask
argument is set toTrue
and a tentative mask is passed in to the workflow throught thepre_mask
Nipype input.- Workflow graph
- Parameters:
brainmask_thresh (
float
) – Lower threshold for the probabilistic brainmask to obtain the final binary mask (default: 0.5).name (str) – Name of workflow (default:
enhance_and_skullstrip_asl_wf
)omp_nthreads (int) – number of threads available to parallel nodes
pre_mask (bool) – Indicates whether the
pre_mask
input will be set (and thus, step 1 should be skipped).
- Inputs:
in_file (str) – ASL image (single volume)
pre_mask (bool) – A tentative brain mask to initialize the workflow (requires
pre_mask
parameter setTrue
).
- Outputs:
bias_corrected_file (str) – the
in_file
after N4BiasFieldCorrectionskull_stripped_file (str) – the
bias_corrected_file
after skull-strippingmask_file (str) – mask of the skull-stripped input file
out_report (str) – reportlet for the skull-stripping
- init_enhance_and_skullstrip_bold_wf(brainmask_thresh=0.5, name='enhance_and_skullstrip_bold_wf', omp_nthreads=1, pre_mask=False)[source]
Enhance and run brain extraction on a BOLD EPI image.
This workflow takes in a BOLD fMRI average/summary (e.g., a reference image averaging non-steady-state timepoints), and sharpens the histogram with the application of the N4 algorithm for removing the INU bias field and calculates a signal mask.
Steps of this workflow are:
Calculate a tentative mask by registering (9-parameters) to fMRIPrep’s EPI -boldref template, which is in MNI space. The tentative mask is obtained by resampling the MNI template’s brainmask into boldref-space.
Binary dilation of the tentative mask with a sphere of 3mm diameter.
Run ANTs’
N4BiasFieldCorrection
on the input BOLD average, using the mask generated in 1) instead of the internal Otsu thresholding.Calculate a loose mask using FSL’s
bet
, with one mathematical morphology dilation of one iteration and a sphere of 6mm as structuring element.Mask the INU-corrected image with the latest mask calculated in 3), then use AFNI’s
3dUnifize
to standardize the T2* contrast distribution.Calculate a mask using AFNI’s
3dAutomask
after the contrast enhancement of 4).Calculate a final mask as the intersection of 4) and 6).
Apply final mask on the enhanced reference.
Step 1 can be skipped if the
pre_mask
argument is set toTrue
and a tentative mask is passed in to the workflow throught thepre_mask
Nipype input.- Workflow graph
- Parameters:
brainmask_thresh (
float
) – Lower threshold for the probabilistic brainmask to obtain the final binary mask (default: 0.5).name (str) – Name of workflow (default:
enhance_and_skullstrip_bold_wf
)omp_nthreads (int) – number of threads available to parallel nodes
pre_mask (bool) – Indicates whether the
pre_mask
input will be set (and thus, step 1 should be skipped).
- Inputs:
in_file (str) – BOLD image (single volume)
pre_mask (bool) – A tentative brain mask to initialize the workflow (requires
pre_mask
parameter setTrue
).
- Outputs:
bias_corrected_file (str) – the
in_file
after N4BiasFieldCorrectionskull_stripped_file (str) – the
bias_corrected_file
after skull-strippingmask_file (str) – mask of the skull-stripped input file
out_report (str) – reportlet for the skull-stripping
- init_skullstrip_asl_wf(name='skullstrip_asl_wf')[source]
Apply skull-stripping to a ASL image.
It is intended to be used on an image that has previously been bias-corrected with
init_enhance_and_skullstrip_asl_wf()
- Workflow Graph
- Inputs:
in_file (str) – ASL image (single volume)
- Outputs:
skull_stripped_file (str) – the
in_file
after skull-strippingmask_file (str) – mask of the skull-stripped input file
out_report (str) – reportlet for the skull-stripping
- init_skullstrip_bold_wf(name='skullstrip_bold_wf')[source]
Apply skull-stripping to a BOLD image.
It is intended to be used on an image that has previously been bias-corrected with
init_enhance_and_skullstrip_bold_wf()
- Workflow Graph
- Inputs:
in_file (str) – BOLD image (single volume)
- Outputs:
skull_stripped_file (str) – the
in_file
after skull-strippingmask_file (str) – mask of the skull-stripped input file
out_report (str) – reportlet for the skull-stripping