rapidtide#

qx_utilities.processing.rapidtide.rapidtide(sinfo, options, overwrite=False, thread=0)#

rapidtide [... processing options]

This command executes rapidtide, it calculates a similarity function between a signal and every voxel of a BOLD fMRI dataset. It then determines the peak value, time delay, and width of the similarity function to determine when and how strongly that probe signal appears in each voxel.

See (https://rapidtide.readthedocs.io/en/latest/usage_rapidtide.html) for additional details.

Parameters

--batchfile (str, default ''):

The batch.txt file with all the sessions information.

--sessions (str, default ''):

A list of sessions to process.

--sessionsfolder (str):

The path to the study/sessions folder, where the imaging data is supposed to go.

--parsessions (int, default 1):

How many sessions to run in parallel.

--parelements (int, default 1):

How many elements (e.g. bolds) to run in parallel.

--overwrite (str, default 'no'):

Whether to overwrite existing data (yes) or not (no). Note that previous data is deleted before the run, so in the case of a failed command run, previous results are lost.

--logfolder (str, default ''):

The path to the folder where runlogs and comlogs are to be stored, if other than default.

--bolds (str, default 'rest'):

Which bold images to process. You can select bolds through their number, name or task (e.g. rest), you can chain multiple conditions together by providing a comma separated list. By default, rest bolds will be used.

--nifti_tail (str, ''):

The tail of BOLD NIfTI images to use. For example, if bold is rfMRI_REST1_AP and tail is _hp0_clean_rclean_tclean, then the HCP processed BOLD image that will be used is rfMRI_REST1_AP_hp0_clean_rclean_tclean.nii.gz.

--despecklepasses (int, 4):

Detect and refit suspect correlations to disambiguate peak location in PASSES passes. Set to 0 to disable.

--filterband (str, 'lfo'):

Filter data and regressors to specific band. Use None to disable filtering. Ranges and options are: vlf: 0.0-0.009Hz, lfo: 0.01-0.15Hz, cardiac: 0.66-3.0Hz, hrv_ulf: 0.0-0.0033Hz, hrv_vlf: 0.0033-0.04Hz, hrv_lf: 0.04-0.15Hz, hrv_hf: 0.15-0.4Hz, hrv_vhf: 0.4-0.5Hz, lfo_legacy: 0.01-0.15Hz, lfo_tight: 0.01-0.1Hz, resp.

--searchrange (str, '-30.0 30.0'):

Space separated limits for a range of lags.

--nprocs (int, 1):

Number of worker processes for multiprocessing. Setting to less than 1 sets the number of worker processes to number of CPUs.

--nofitfilt (flag):

Do not zero out peak fit values if fit fails.

--similaritymetric (str, 'correlation'):

Similarity metric for finding delay values. Choices are correlation, mutualinfo, and hybrid.

--ampthresh (str, '-1.0'):

For refinement, exclude voxels with correlation coefficients less than the set value. Note htat ampthresh will automatically be set to the p<0.05 significance level determined by the --numnull option if --nomnull is set greater than 0 and this is not manually specified.

--outputlevel (str, 'normal'):

The level of file output produced. "min" produces only absolutely essential files, "less" adds in the sLFO filtered data (rather than just filter efficacy metrics), "normal" saves what you would typically want around for interactive data exploration, "more" adds files that are sometimes useful, and "max" outputs anything you might possibly want. Selecting "max" will produce ~3x your input datafile size as output.

--spatialfilt (str, '-1.0'):

Spatially filter fMRI data prior to analysis using the set value in mm. Set negative to have rapidtide set it to half the mean voxel dimension (a rule of thumb for a good value). Set to 0 to disable.

--simcalcrange (str, '-1 -1'):

2 space separated values that limit correlation calculation to data between them in the fmri file. If the end value is set to -1, analysis will go to the last time-point. Negative start values wil be set to 0. Default is to use all time-points.

--brainmask (str):

This specifies the valid brain voxels. No voxels outside of this will be used for global mean calculation, correlation, refinement, offset calculation, or denoising. Will be set to BOLD's brainmask_fs.2.nii.gz from HCP pipelines by default if it file exists. Set to "None" to disable brain mask.

--graymattermask (str):

This specifies a gray matter mask registered to the input functional data. If not set flirt will be used to automatically calculate 2 mm aparc+aseg. Set to "None" to disable gray matter mask.

--whitemattermask (str):

This specifies a white matter mask registered to the input functional data. If not set flirt will be used to automatically calculate 2 mm aparc+aseg. Set to "None" to disable white matter mask.

--refineexclude (str):

Do not use voxels in the provided file for regressor refinement. By default BOLD's dropouts from HCP pipelines will be used if they exist. Set to "None" to disable refinement exclusion.

--nodenoise (flag):

Turn off regression filtering to remove delayed regressor from each voxel (disables output of fitNorm). Does not perform denoising, only calculates the maps.

--rapidtide_extra_args (str, ''):

Additional arguments to pass to rapidtide. This is useful for passing any additional arguments that are not yet exposed through QuNex command line options. The string will be passed to rapidtide as is.

Examples

qunex rapidtide \
    --sessionsfolder="/data/qunex_study/sessions" \
    --batchfile="/data/qunex_study/processing/batch.txt"

qunex rapidtide                 --sessionsfolder="/data/jdemsar/studies/hca_alzheimer/sessions"                 --bolds="rfMRI_REST1_AP,rfMRI_REST1_PA,rfMRI_REST2_AP,rfMRI_REST2_PA"                 --despecklepasses="4"                 --filterband="lfo"                 --searchrange="-7.5 15.0"                 --nprocs="4"                 --nofitfilt                 --similaritymetric="hybrid"                 --ampthresh="0.15"                 --outputlevel="normal"                 --spatialfilt="3"                 --simcalcrange="100 -1"

The first command uses rapidtide defaults across all sessions and their rest bolds in the batch file. The second one uses a sensible setup for HCP style acquisition data.