fcMRI oriented scripts¶
Tip
For more information on script inputs, see Params/Instructions files.
fcMRI_preproc_161012.csh¶
fcMRI preprocessing including nuisance variable regression
Attention
fcMRI_preproc_161012
assumes successful completion of BOLD preprocessing (cross_bold_pp_161012.csh).
Usage: fcMRI_preproc_<version>.csh <params file> [instructions file]
Examples:
fcMRI_preproc_161012.csh VB16168.params
Required parameters
Variable | Values | Description |
---|---|---|
patid | <str> | unique identifier for current subject/session |
target | <img> | atlas to be used for alignment |
FSdir | <str> | freesurfer directory containing mri/aparc+aseg.mgz |
srcdir | <str> | source directory path (contains run directories) |
fcbolds | <array> | list of bold run folders |
TR_vol | <flt> | time per frame (s) |
CSF_lcube | <int> | cube dimension (in voxels) used by qntv_4dfp for CSF (recommended: 3) |
CSF_sd1t | <flt> | threshold CSF sd1 image (recommended: 25) |
CSF_svdt | <flt> | limit regressor covariance condition number to (1/{})^2 for CSF (recommended: .2) |
WM_lcube | <int> | cube dimension (in voxels) used by qntv_4dfp for WM (recommended: 5) |
WM_svdt | <flt> | limit regressor covariance condition number to (1/{})^2 for WM (recommended: .15) |
Optional parameters
Variable | Values | Default | Description |
---|---|---|---|
FCdir | <str> | FCmaps | output directory name |
day1_patid | <str> | patient directory for first session (if patid is not patient’s first session) | |
MB | 0,1 | 0 | skip slice timing correction and debanding |
blur | <flt> | no blur | f_half for spatial blur |
bpss_params | <array> | options for bandpass_4dfp (only -E,M,F specified by default; no default bands) | |
conc | <str> | pre-existing conc file to use | |
fmtfile | <str> | format file | |
FDthresh | <flt> | frame displacement thresholds | |
FDtype | 1,2 | 1 | frame displacement calculation (1 = absolute value, 2 = squares) |
anat_aveb | <flt> | 0 | run_dvar_4dfp preblur in mm (for small voxels, set to 10mm) |
anat_avet | <flt> | (compute) | run_dvar_4dfp criterion |
min_frames | <int> | numframes / 2 | minimum number of remaining frames after scrubbing for participant to be included |
CSF_excl_lim | <flt> | 0.126 | mask threshold for CSF |
task_regressor | <str> | optional externally supplied task regressor | |
noGSR | 1 | 0 | suppress global signal (WB) regression |
Processing steps
Step description | Function | Output |
---|---|---|
Generate FS masks if they don’t already exist | Generate_FS_Masks_AZS.csh | atlas/ <patid>_orig_to_<target>_t4 <patid>_FSWB_on_<target>_333.4dfp.img <patid>_GM_on_<target>_333_comp_b60.4dfp.img <patid>_(WM,CS)_erode_on_<target>_333_clus.4dfp.img |
Create conc file | conc_4dfp | <FCdir>/ $conc or, <patid>[_faln_dbnd]_xr3d_uwrp_atl.conc |
Compute frame censoring using FD (if $FDthresh specified) and DVARS – skipped if $fmtfile is specified | FD.awk, run_dvar_4dfp | movement/ <patid>[_faln_dbnd]_xr3d.FD atlas/ <patid>[_faln_dbnd]_xr3d.FD.format (if $FDthresh) <patid>_func_vols(.vals, .dat, .crit, .xmgr, .format) |
Create average censored image | actmapf_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_ave.4dfp.img |
Compute defined mask and apply it | compute_defined_4dfp, maskimg_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_dfnd.4dfp.img atlas/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_dfndm.4dfp.img |
Compute initial sd1 mean | var_4dfp, qnt_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_sd1.4dfp.img |
Make timeseries zero mean | var_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_uout.conc |
Make movement regressors for each bold run | mat2dat, conc_4dfp, bandpass_4dfp, 4dfptoascii | <FCdir>/ <patid>[_faln_dbnd]_xr3d_dat.conc <patid>[_faln_dbnd]_xr3d_dat_bpss.conc <patid>_<patid>_mov_regressors.dat |
Temporal bandpass filter using $bpss_params | bandpass_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss.conc |
Make whole brain regressors including the 1st derivative | qnt_4dfp | <FCdir>/ <patid>_WB_regressors_dt.dat |
Make extra-axial CSF regressors (thresholded at $CSF_excl_lim) | maskimg_4dfp, qntv_4dfp | <FCdir>/ <patid>_CSF_mask.4dfp.img <patid>_CSF_dies.4dfp.img <patid>_CSF_regressors.dat |
Make venticle regressors | maskimg_4dfp, qntv_4dfp | <FCdir>/ <patid>_vent_mask.4dfp.img <patid>_vent_dies.4dfp.img <patid>_vent_regressors.dat |
Make white matter regressors | maskimg_4dfp, qntv_4dfp | <FCdir>/ <patid>_WM_mask.4dfp.img <patid>_WM_dies.4dfp.img <patid>_WM_regressors.dat |
Paste nuisance regressors (mov, CSF, vent, WM, task) together and run covariance analysis | covariance (-D250) | |
Paste together WB and WB derivative, and covaried nuissance regressors | <FCdir>/ <patid>_nuisance_regressors.dat | |
Remove nuisance regressors out of volumetric time series | glm_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss_resid.conc <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss_coeff.4dfp.img |
Compute sd1 mean for bandpass-filtered and nuisance regressed data | var_4dfp, qnt_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss_resid_sd1.4dfp.img (comparison to initial WB mean reported to stdout) |
Spatial blur with f_half = $blur if specified | gauss_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss_resid_g<blur>.conc |
Compute sd1 mean for blurred data if $blur | var_4dfp, qnt_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss_resid_g<blur>_sd1.4dfp.img (mean reported to stdout) |
seed_correl_161012.csh¶
compute multi-volume correlation maps
Attention
seed_correl_161012
assumes successful completion of BOLD preprocessing (cross_bold_pp_161012.csh) and fcMRI preprocessing (fcMRI_preproc_161012.csh).
Usage: seed_correl_161012.csh <parameters file> [instructions] [options]
Examples:
seed_correl_161012.csh VB16168.params
Options
-noblur | analyze unblurred version of preprocessed data |
-A | use format in atlas subdirectory (default FCmaps directory) |
Required variables
Variable | Values | Description |
---|---|---|
patid | <str> | unique identifier for current subject/session |
ROIdir | <str> | directory containing ROI image(s) |
skip | <int> | number of pre-steady state frames |
ROI specification variables (required)
Variable | Values | Description |
---|---|---|
Option 1 | ||
ROIimg | <str> | base filename for single ROI image |
Option 2 | ||
ROIlist | <str array> | list of base filenames for ROI images |
Option 3 | ||
ROIlistfile | <str> | list file (.lst) of base filenames for ROI image |
Optional variables
Variable | Values | Default | Description |
---|---|---|---|
FCdir | <str> | FCmaps | output directory name |
MB | 0,1 | 0 | skip slice timing correction and debanding |
blur | <flt> | no blur | f_half for spatial blur |
bpss_params | <array> | options for bandpass_4dfp (only -E,M,F specified by default; no default bands) | |
conc | <str> | pre-existing conc file to use | |
fmtfile | <str> | format file |
Processing Steps
Step description | Function | Output |
---|---|---|
Create (multi-volume) ROI image if $ROIlistfile or $ROIlist specified | paste_4dfp | |
Calculate seed (ROI) regressors | qntm_4dfp | <FCdir>/ <patid>_seed_regressors.dat <patid>_seed_regressors.rec |
Compute total correlations | glm_4dfp (-t) | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss_resid[_g<blur>]_tcorr.4dfp.img |
Mask total correlation image by defined voxels | maskimg_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss_resid[_g<blur>]_tcorr_dfnd.4dfp.img |
Fisher z transform total correlation | rho2z_4dfp | <FCdir>/ <patid>[_faln_dbnd]_xr3d_uwrp_atl_bpss_resid[_g<blur>]_tcorr_dfnd_zfrm.4dfp.img |
Compute zero-lag ROI-ROI correlation matrix (if number of ROIs <= 256) | covariance (-u, -o, -m0) | <FCdir>/ <patid>_seed_regressors_CCR.dat |
Generate_FS_Masks_AZS.csh¶
generate Freesurfer masks for whole brain, WM, GM, CSF
Usage: Generate_FS_Masks_AZS.csh <parameters file> [instructions]
Examples:
Generate_FS_Masks_AZS.csh FCS_039_A_1.params ../uwrp_process_Stroke_SMG_Subjects.params
Variable | Values | Description |
---|---|---|
patid | <str> | unique identifier for current subject/session |
FSdir | <str> | freesurfer directory containing mri/aparc+aseg.mgz |
target | <img> | atlas to be used for alignment |