-
Notifications
You must be signed in to change notification settings - Fork 5
Workflow
Workflow modules coordinate the various resource modules to construct the actual pipeline used on MRI data. Currently three workflows exist, one for controlling AFNI resources, one for ASHS, and one for refacing T1w files (for NDA submissions). It is planned to add workflows for FreeSurfer and fMRIprep.
ASHS and reface modules/pipelines are simply a call for their respective resource module, but are included here despite their redundancy for project consistency.
Detailed descriptions are available here, assuming sphinx is cooperative.
Automated segmentation of hippocampal subfields for a single subject is controlled by control_ashs.control_hippseg
. While not interacting with EPI data, these masks will likely be used to target HC subfield regions for functional analyses. Requires a singularity image of this container.
This workflow supports defacing, refacing (default), or reface_plus (so special) of T1w files. We currently do not incorporate de/re/plus facing in our pre-processing pipelines, hence the separate workflow, but reface T1w files for NDA hosting.
A number of AFNI-based pipelines are available in this workflow module, both for single-subject and group-level analyses and also for task-based and resting state analyses. The various pipelines use fMRIprep to do the initial pre-processing, but then AFNI takes over for some additional steps in preparation for the AFNI-based deconvolution. BIDS formatting and file names are assumed and largely employed, but some reversion to AFNI naming convention occurs.
The various AFNI functions operate by creating, passing, and updating a dictionary (afni_data) between the various modules. This dictionary employs a {key: file_path} format (e.g. struct-t1: /path/to/subj/t1.nii.gz), and it is via this dictionary that the various modules will orient to required files. Required afni_data keys are specified in the docstrings for each module.
Post fMRIprep AFNI-based pre-processing for task and resting state analyses is controlled by this function. The steps involve an optional blur/smoothing via a boolean "do_blur" option (ETAC blurring in the group-level analyses accounts for this toggle), the construction of EPI-anatomic intersection, tissue (ATROPOS), and minimum EPI masks. EPI data is then scaled, and motion and censor files are generated in AFNI format.
Both task and resting state pipelines use control_preproc (hence the option to blur), and control_preproc constructs the initial afni_data dictionary for use in subsequent modules.
Task-based deconvolution is available via this function. By default, regressors will consist of unique behaviors for the session/task, referencing the BIDS foo_events.tsv available for each run. User-specified timing files can be injected via the "decon_plan" option, see the function notes. An example of such an injection can be found in the qc directory (no_valence).
Currently, a stripped-down version of 3dDeconvolve is supported, with a default duration (2s) and two gamma basis function. Future updates to resources.afni.deconvolve may increase the flexibility of this workflow. 3dDeconvolve is used to generate the deconvolution matrices, and deconvolution is accomplished via 3dREMLfit.
The bolus of the resting state pipeline involves setting up for and projecting a correlation matrix. First a principal components analysis is conducted to identify the CSF timeseries. Next a deconvolution is employed, utilizing only nuissance regressors (polynomials, motion, and CSF timeseries) to produce "cleaned" signal (which loads on the model residual). Finally, two correlation projections are supported, traditional and anaticor (default). If anaticor is selected an eroded white matter mask is generated from which another nuissnace timeseries is extracted and incorporated into the regression projection. Additionally, this workflow also produces metrics of TSNR, GCOR, and total noise estimations.
A seed-based correlation matrix (Z-transformed) will be generated from the projected regression matrix above. Currently only a coordinate-based seed is supported, but resources.afni.process.resting_seed could be update to accept an ROI mask.
First a group gray matter intersection mask is constructed. This is the product of (a) every participants' EPI-T1w intersection mask with (b) a template gray matter mask. This helps constrain analyses to only gray matter regions for which meaningful signal exists across all participants.
Next, an "A vs not-A" test is conducted via 3dttest++ (using the ETAC updates). This will test at various p-values and conduct noise simulations to arrive at the ideal FWE=0.05. Recommendations are to let ETAC manage blurring, so if you follow this don't blur as part of the pre-processing. Updates to resource.afni.group.resting_etac could update this test for other hypotheses.
As in control_resting_group, first a group gray matter intersection mask is constructed. This mask is then used to limit the number of voxels being tested to those that are relevant, which helps constrain the multiple comparison correction.
An "A vs B" test will then be conducted with ETAC methods via 3dttest++. Behaviors A and B will be supplied by the list "beh_list", and the module will identify the appropriate sub-bricks for the corresponding behaviors in each subject's deconvolved file for 3dttest++ inclusion; only subjects with both behaviors will be included in the model. Again, this could be updated in resources.afni.group.task_etac.