aslprep.workflows.asl.resampling module
Resampling workflows for ASLPrep.
TODO: Remove once fMRIPrep releases 23.2.0.
- init_asl_surf_wf(*, mem_gb: float, surface_spaces: List[str], medial_surface_nan: bool, metadata: dict, cbf_3d: List[str], cbf_4d: List[str], att: List[str], output_dir: str, name: str = 'asl_surf_wf')[source]
Sample functional images to FreeSurfer surfaces.
For each vertex, the cortical ribbon is sampled at six points (spaced 20% of thickness apart) and averaged.
Outputs are in GIFTI format.
The two main changes for ASLPrep are: prepare_timing_parameters is dropped and DerivativesDataSink is imported outside the function. The former is because prepare_timing_parameters relies on fMRIPrep’s config, which will be uninitialized when called by ASLPrep. ASLPrep can work around this with a context manager though. The latter is because, when DerivativesDataSink is imported within the function, ASLPrep can’t use a context manager to override it with its own version. TODO: Replace with fMRIPrep workflow once DerivativesDataSink import is moved out.
I’ve made a bunch of further changes to write out CBF maps instead.
- Workflow Graph
- Parameters:
surface_spaces (
list
) – List of FreeSurfer surface-spaces (eitherfsaverage{3,4,5,6,}
orfsnative
) the functional images are to be resampled to. Forfsnative
, images will be resampled to the individual subject’s native surface.medial_surface_nan (
bool
) – Replace medial wall values with NaNs on functional GIFTI files
- Inputs:
source_file – Original BOLD series
subjects_dir – FreeSurfer SUBJECTS_DIR
subject_id – FreeSurfer subject ID
fsnative2t1w_xfm – ITK-style affine matrix translating from FreeSurfer-conformed subject space to T1w
- Outputs:
surfaces – BOLD series, resampled to FreeSurfer surfaces
- init_bold_fsLR_resampling_wf(grayord_density: Literal['91k', '170k'], omp_nthreads: int, mem_gb: float, name: str = 'bold_fsLR_resampling_wf')[source]
Resample BOLD time series to fsLR surface.
This is copied from fMRIPrep and can be replaced with an fMRIPrep import once 23.2.0 is released.
This workflow is derived heavily from three scripts within the DCAN-HCP pipelines scripts
Line numbers correspond to the locations of the code in the original scripts, found at: https://github.com/DCAN-Labs/DCAN-HCP/tree/9291324/
- Workflow Graph
-
(Source code, png, svg, pdf)
- Parameters:
- Inputs:
bold_file (
str
) – Path to BOLD file resampled into T1 spacewhite (
list
ofstr
) – Path to left and right hemisphere white matter GIFTI surfaces.pial (
list
ofstr
) – Path to left and right hemisphere pial GIFTI surfaces.midthickness (
list
ofstr
) – Path to left and right hemisphere midthickness GIFTI surfaces.midthickness_fsLR (
list
ofstr
) – Path to left and right hemisphere midthickness GIFTI surfaces in fsLR space.sphere_reg_fsLR (
list
ofstr
) – Path to left and right hemisphere sphere.reg GIFTI surfaces, mapping from subject to fsLRcortex_mask (
list
ofstr
) – Path to left and right hemisphere cortical masks.volume_roi (
str
or Undefined) – Pre-calculated goodvoxels mask. Not required.
- Outputs:
bold_fsLR (
list
ofstr
) – Path to BOLD series resampled as functional GIFTI files in fsLR space