Functional Preprocessing¶
Ingress¶
Motion¶
Functions for calculating motion parameters
NodeBlockFunction: calc_motion_stats
- CPAC.func_preproc.func_motion.calc_motion_stats(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
Calculate motion statistics for motion parameters.
- CPAC.func_preproc.func_motion.estimate_reference_image(in_file)[source]¶
fMRIPrep-style BOLD reference Ref: https://github.com/nipreps/niworkflows/blob/maint/1.3.x/niworkflows/interfaces/registration.py#L446-L549
NodeBlockFunction: motion_correction
NodeBlockFunction: motion_correction_only
- CPAC.func_preproc.func_motion.func_motion_correct_only(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
NodeBlockFunction: motion_estimates
- CPAC.func_preproc.func_motion.func_motion_estimates(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
Calculate motion estimates using 3dVolReg or MCFLIRT.
NodeBlockFunction: get_motion_ref
- CPAC.func_preproc.func_motion.motion_correct_3dvolreg(wf, cfg, strat_pool, pipe_num)[source]¶
Calculate motion parameters with 3dvolreg
- CPAC.func_preproc.func_motion.motion_correct_connections(wf, cfg, strat_pool, pipe_num, opt)[source]¶
Check opt for valid option, then connect that option.
- CPAC.func_preproc.func_motion.motion_correct_mcflirt(wf, cfg, strat_pool, pipe_num)[source]¶
Calculate motion parameters with MCFLIRT
NodeBlockFunction: motion_estimate_filter
- CPAC.func_preproc.func_motion.motion_estimate_filter(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
Filter motion parameters.
Changed in version 1.8.6: Beginning with version 1.8.6, C-PAC outputs both the unfiltered and the filtered motion parameters and uses the unfiltered parameters in QC. Previous versions only reported the filtered parameters and used the filtered parameters for QC.
Preprocessing¶
Functional preprocessing
- CPAC.func_preproc.func_preproc.anat_based_mask(wf_name='bold_mask')[source]¶
reference DCAN lab BOLD mask
- CPAC.func_preproc.func_preproc.anat_refined_mask(init_bold_mask=True, wf_name='init_bold_mask')[source]¶
NodeBlockFunction: bold_mask_afni
NodeBlockFunction: bold_mask_anatomical_based
- CPAC.func_preproc.func_preproc.bold_mask_anatomical_based(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
- Generate the BOLD mask by basing it off of the anatomical brain mask.
Adapted from DCAN Lab’s BOLD mask method from the ABCD pipeline.
NodeBlockFunction: bold_mask_anatomical_refined
- CPAC.func_preproc.func_preproc.bold_mask_anatomical_refined(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
NodeBlockFunction: bold_mask_anatomical_resampled
- CPAC.func_preproc.func_preproc.bold_mask_anatomical_resampled(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
- Resample anatomical brain mask in standard space to get BOLD brain mask in standard space
Adapted from DCAN Lab’s BOLD mask method from the ABCD pipeline.
NodeBlockFunction: bold_mask_ccs
- CPAC.func_preproc.func_preproc.bold_mask_ccs(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
- Generate the BOLD mask by basing it off of the anatomical brain.
Adapted from the BOLD mask method from the CCS pipeline.
NodeBlockFunction: bold_mask_fsl
NodeBlockFunction: bold_mask_fsl_afni
- CPAC.func_preproc.func_preproc.bold_mask_fsl_afni(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
- fMRIPrep-style BOLD mask
NodeBlockFunction: bold_masking
- CPAC.func_preproc.func_preproc.create_scale_func_wf(scaling_factor, wf_name='scale_func')[source]¶
Workflow to scale func data.
- Workflow Inputs::
- inputspec.funcfunc file or a list of func/rest nifti file
User input functional(T2*) Image
- Workflow Outputs::
- outputspec.scaled_funcstr (nifti file)
Path to Output image with scaled data
Order of commands: - Scale the size of the dataset voxels by the factor ‘fac’. For details see 3dcalc:
3drefit -xyzscale fac rest.nii.gz
- CPAC.func_preproc.func_preproc.create_wf_edit_func(wf_name='edit_func')[source]¶
Workflow to edit the scan to the proscribed TRs.
Workflow Inputs:
inputspec.func : func file or a list of func/rest nifti file User input functional(T2*) Image inputspec.start_idx : str Starting volume/slice of the functional image (optional) inputspec.stop_idx : str Last volume/slice of the functional image (optional)
Workflow Outputs:
outputspec.edited_func : str (nifti file) Path to Output image with the initial few slices dropped
Order of commands:
Get the start and the end volume index of the functional run. If not defined by the user, return the first and last volume.
get_idx(in_files, stop_idx, start_idx)
Dropping the initial TRs. For details see 3dcalc:
3dcalc -a rest.nii.gz[4..299] -expr 'a' -prefix rest_3dc.nii.gz
NodeBlockFunction: func_despike
NodeBlockFunction: func_despike_template
- CPAC.func_preproc.func_preproc.func_despike_template(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
NodeBlockFunction: func_mask_normalize
- CPAC.func_preproc.func_preproc.func_mask_normalize(wf, cfg, strat_pool, pipe_num, opt=None)[source]¶
NodeBlockFunction: func_mean
NodeBlockFunction: func_normalize
NodeBlockFunction: func_reorient
NodeBlockFunction: func_scaling
NodeBlockFunction: func_slice_time
NodeBlockFunction: func_truncate
- CPAC.func_preproc.func_preproc.get_idx(in_files, stop_idx=None, start_idx=None)[source]¶
Method to get the first and the last slice for the functional run. It verifies the user specified first and last slice. If the values are not valid, it calculates and returns the very first and the last slice
- Parameters:
in_file (
str (nifti file)
) – Path to input functional runstop_idx (
int
) – Last volume to be considered, specified by user in the configuration filestop_idx – First volume to be considered, specified by user in the configuration file
- Returns: