xcp_d.workflows.anatomical module
Anatomical post-processing workflows.
- xcp_d.workflows.anatomical.init_ants_xfm_to_fsl_wf(mem_gb, omp_nthreads, name='ants_xfm_to_fsl_wf')[source]
Modify ANTS-style fMRIPrep transforms to work with Connectome Workbench/FSL FNIRT.
- Workflow Graph
- Parameters:
- Inputs:
anat_to_template_xfm – ANTS/fMRIPrep-style H5 transform from T1w image to template.
template_to_anat_xfm – ANTS/fMRIPrep-style H5 transform from template to T1w image.
- Outputs:
world_xfm – TODO: Add description.
merged_warpfield – TODO: Add description.
merged_inv_warpfield – TODO: Add description.
- xcp_d.workflows.anatomical.init_generate_hcp_surfaces_wf(output_dir, mem_gb, omp_nthreads, name='generate_hcp_surfaces_wf')[source]
Generate midthickness, inflated, and very-inflated HCP-style surfaces.
- Workflow Graph
- Parameters:
output_dir (
str
) – Path to the output directory forxcp_d
derivatives. This should not include thexcp_d
folder. For example, “/path/to/dset/derivatives/”.mem_gb (
float
) – Memory limit, in gigabytes.omp_nthreads (
int
) – Maximum number of threads an individual process may use.name (
str
, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “generate_hcp_surfaces_wf”.
- Inputs:
- xcp_d.workflows.anatomical.init_postprocess_anat_wf(output_dir, input_type, t1w_available, t2w_available, target_space, dcan_qc, omp_nthreads, mem_gb, name='postprocess_anat_wf')[source]
Copy T1w, segmentation, and, optionally, T2w to the derivative directory.
If necessary, this workflow will also warp the images to standard space.
- Workflow Graph
- Parameters:
output_dir (
str
) – Path to the output directory forxcp_d
derivatives. This should not include thexcp_d
folder. For example, “/path/to/dset/derivatives/”.input_type ({“fmriprep”, “dcan”, “hcp”, “nibabies”}) – The format of the incoming preprocessed BIDS derivatives. DCAN- and HCP-format derivatives will automatically be converted to a more BIDS-compliant format. fMRIPrep and Nibabies derivatives are assumed to be roughly equivalent in terms of file organization and naming.
t1w_available (bool) – True if a preprocessed T1w is available, False if not.
t2w_available (bool) – True if a preprocessed T2w is available, False if not.
target_space (
str
) – Target NIFTI template for T1w.dcan_qc (
bool
) – This flag determines if DCAN-related QC steps will be taken. Enabling this flag will trigger the following steps:Brainsprite figures will be generated.
The executive summary will be generated.
DCAN QC files will be generated.
omp_nthreads (
int
) – Maximum number of threads an individual process may use.mem_gb (
float
) – Memory limit, in gigabytes.name (
str
, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “postprocess_anat_wf”.
- Inputs:
t1w (
str
) – Path to the preprocessed T1w file. This file may be in standard space or native T1w space.t2w (
str
or None) – Path to the preprocessed T2w file. This file may be in standard space or native T1w space.anat_dseg (
str
) – Path to the T1w segmentation file.anat_to_template_xfm (
str
) – Path to the T1w-to-MNI transform file. May be “identity”, for testing purposes. We need to use MNI152NLin6Asym for the template.template (
str
) – The target template.
- Outputs:
- xcp_d.workflows.anatomical.init_postprocess_surfaces_wf(fmri_dir, subject_id, dcan_qc, process_surfaces, mesh_available, standard_space_mesh, shape_available, output_dir, t1w_available, t2w_available, mem_gb, omp_nthreads, name='postprocess_surfaces_wf')[source]
Postprocess surfaces.
- Workflow Graph
- Parameters:
fmri_dir
subject_id
dcan_qc (
bool
) – This flag determines if DCAN-related QC steps will be taken. Enabling this flag will trigger the following steps:Brainsprite figures will be generated.
The executive summary will be generated.
DCAN QC files will be generated.
process_surfaces (bool)
mesh_available (bool)
standard_space_mesh (bool)
shape_available (bool)
output_dir (
str
) – Path to the output directory forxcp_d
derivatives. This should not include thexcp_d
folder. For example, “/path/to/dset/derivatives/”.t1w_available (bool) – True if a T1w image is available.
t2w_available (bool) – True if a T2w image is available.
mem_gb (
float
) – Memory limit, in gigabytes.omp_nthreads (
int
) – Maximum number of threads an individual process may use.name (
str
, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “postprocess_surfaces_wf”.
- Inputs:
t1w – Preprocessed T1w file. May be in native or standard space.
t2w – Preprocessed T2w file. May be in native or standard space.
anat_to_template_xfm (
str
) – Path to the T1w-to-MNI transform file. May be “identity”, for testing purposes.template_to_anat_xfm (
str
) – Path to the MNI-to-T1w transform file. May be “identity”, for testing purposes.lh_pial_surf, rh_pial_surf
lh_wm_surf, rh_wm_surf
lh_sulcal_depth, rh_sulcal_depth
lh_sulcal_curv, rh_sulcal_curv
lh_cortical_thickness, rh_cortical_thickness
- xcp_d.workflows.anatomical.init_warp_one_hemisphere_wf(participant_id, hemisphere, mem_gb, omp_nthreads, name='warp_one_hemisphere_wf')[source]
Apply transforms to warp one hemisphere’s surface files into standard space.
- Workflow Graph
- Parameters:
- Inputs:
hemi_files (list of str) – A list of surface files for the requested hemisphere, in fsnative space.
world_xfm
merged_warpfield
merged_inv_warpfield
freesurfer_path – Path to FreeSurfer derivatives. Used to load the subject’s sphere file.
participant_id – Set from parameters.
- Outputs:
warped_hemi_files
- xcp_d.workflows.anatomical.init_warp_surfaces_to_template_wf(fmri_dir, subject_id, output_dir, omp_nthreads, mem_gb, name='warp_surfaces_to_template_wf')[source]
Transform surfaces from native to standard fsLR-32k space.
- Workflow Graph
- Parameters:
fmri_dir (
str
) – Path to the preprocessed derivatives dataset. For example, “/path/to/dset/derivatives/fmriprep/”.subject_id (
str
) – The participant ID. This SHOULD NOT include thesub-
prefix.output_dir (
str
) – Path to the output directory forxcp_d
derivatives. This should not include thexcp_d
folder. For example, “/path/to/dset/derivatives/”.omp_nthreads (
int
) – Maximum number of threads an individual process may use.mem_gb (
float
) – Memory limit, in gigabytes.name (
str
, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “warp_surfaces_to_template_wf”.
- Inputs:
anat_to_template_xfm (
str
) – Path to the T1w-to-MNI transform file. May be “identity”, for testing purposes. The template in question should match the volumetric space of the BOLD CIFTI files being processed by the main xcpd workflow. For example, MNI152NLin6Asym for fsLR-space CIFTIs.template_to_anat_xfm (
str
) – Path to the MNI-to-T1w transform file. May be “identity”, for testing purposes. The template in question should match the volumetric space of the BOLD CIFTI files being processed by the main xcpd workflow. For example, MNI152NLin6Asym for fsLR-space CIFTIs.lh_pial_surf, rh_pial_surf (
str
) – Left- and right-hemisphere pial surface files in fsnative space.lh_wm_surf, rh_wm_surf (
str
) – Left- and right-hemisphere smoothed white matter surface files in fsnative space.
- Outputs: