Timeseries Extraction

C-PAC lets you easily export BOLD timeseries in a number of different ways. This can be useful for those wishing to undertake advanced analysis not included in C-PAC, but still take advantage of its robust pre-processing features. For instructions on how to use these seeds within C-PAC , please see Seed-based Correlation Analysis.

ROI Timeseries Extraction allows you to export the timeseries for one or more regions of interest (ROIs). This is done by calculating the average timeseries across all voxels within an ROI. As such, C-PAC will output one timeseries for each ROI specified by you.

_images/roi_timeseries.png

When an ROI is placed within a functionally homogeneous area, averaging signals in this way can produce a timeseries which may more accurately reflect the overall activity pattern in the region than does the timeseries of any individual voxel. Voxel Timeseries Extraction will export the individual timeseries of all voxels within one or more masks.

_images/voxel_timeseries.png

Configuring ROI Time Series Extraction

_images/tse_gui.png
  1. Extract ROI Time Series - [Off, On]: Extract the average time series of one or more ROIs/seeds. Must be enabled if you wish to run seed-based correlation analysis.
  2. TSE ROI Paths - [path dialogue]: Clicking on the + icon to the right of the box here will bring up a dialog where you can define multiple paths to NifTIs containing ROI masks. You may add multiple ROIs to the box. Three columns within the box can be checked on and off to enable specific types of TSE:
    • Avg - For each ROI, output the average of the all the voxel time series within that ROI.
    • Voxel - For each ROI, output the individual voxel time series for all voxels within that ROI.
    • SpatialReg - Use a spatial map as a spatial regressor in a GLM to find the time series associated with the voxels in that map (see dual regression).
  3. Output Options - [CSV, NUMPY]: Choose to save voxelwise time series extraction outputs as a csv file or a Numpy array. Voxelwise TSE outputs are saved as a text file and 1D file by default. ROI Average TSE outputs are saved as a tab-delimited value file (‘roi_stats.csv’) only.

Configuration Without the GUI

The following key/value pairs must be defined in your pipeline configuration YAML for C-PAC to run time series extraction:

ROI Average TSE

Key Description Potential Values
runROITimeseries Extract the average time series of one or more ROIs/seeds. Must be enabled for seed-based correlation analysis. A list where ‘1’ represents ‘yes’ and ‘0’ represents ‘no’ (e.g., ‘[1]’).
roiSpecificationFile Full path to a text file containing a list of ROI NifTIs. Each line in this file should be the path to a NIfTI file containing one or more ROIs. All ROI mask values are converted to integers in C-PAC. A path.
roiSpecificationFileForSCA Same as roiSpecificationFile, but used for seed-based correlation analysis. A path.
roiTSOutputs Extracted voxelwise time series are written as both a text file and a 1D file by default. With this option, you may also save them out as CSV files or Numpy arrays. A two-element list, where the first element is a boolean (‘True’ or ‘False’) for whether or not to save out a CSV and the second element is a boolean for whether or not to save a Numpy array.

ROI Voxelwise TSE

Key Description Potential Values
runVoxelTimeseries Extract the time series of all voxels within one or more ROIs/seeds. A list where ‘1’ represents ‘yes’ and ‘0’ represents ‘no’ (e.g., ‘[1]’).
maskSpecificationFile Full path to a text file containing a list of mask NifTIs. Each line in this file should be the path to a NIfTI file containing a single mask. If you only wish to extract time series for newly defined spherical seed ROIs, set this field to None. A path or ‘None’.
maskSpecificationFileForSCA Same as maskSpecificationFile, but used for seed-based correlation analysis. A path or ‘None’.
voxelTSOutputs Extracted time series are written as both a text file and a 1D file by default. With this option, you may also save them out as CSV files or Numpy arrays. A two-element list, where the first element is a boolean (‘True’ or ‘False’) for whether or not to save out a CSV and the second element is a boolean for whether or not to save a Numpy array.

Spatial Regression

Key Description Potential Values
runSpatialRegression Extract the time series from one or more existing spatial maps (such as an ICA map). Required if you wish to run Dual Regression. A list where ‘1’ represents ‘yes’ and ‘0’ represents ‘no’ (e.g., ‘[1]’).
spatialPatternMaps Full path to a text file containing a list spatial maps. Each line in this file should be the path to a 4D NIfTI file containing one spatial map per volume. A path.
spatialDemean Demean spatial maps before running spatial regression. A boolean (‘True’ or ‘False’).