Timeseries Analysis

CPAC.timeseries.gen_roi_timeseries(data_file, template, output_type)[source]

Method to extract mean of voxel across all timepoints for each node in roi mask

Parameters:
data_filestring

path to input functional data

templatestring

path to input roi mask in functional native space

output_typelist

list of two boolean values suggesting the output types - numpy npz file and csv format

Returns:
out_listlist

list of 1D file, txt file, csv file and/or npz file containing mean timeseries for each scan corresponding to each node in roi mask

Raises:
Exception
CPAC.timeseries.gen_vertices_timeseries(rh_surface_file, lh_surface_file)[source]

Method to extract timeseries from vertices of a freesurfer surface file

Parameters:
rh_surface_filestring (mgz/mgh file)

left hemisphere FreeSurfer surface file

lh_surface_filestring (mgz/mgh file)

right hemisphere FreeSurfer surface file

Returns:
out_liststring (list of file)

list of vertices timeseries csv files

CPAC.timeseries.gen_voxel_timeseries(data_file, template)[source]

Method to extract timeseries for each voxel in the data that is present in the input mask

Parameters:
datafilestring (nifti file)

path to input functional data

templatestring (nifti file)

path to input mask in functional native space

output_typelist

list of two boolean values suggesting the output types - numpy npz file and csv format

Returns:
out_listlist of files

Based on ouput_type options method returns a list containing path to npz and csv file having timeseries of each voxel in the data that is present in the input mask.The row header corresponds to voxel’s xyz cordinates and column headers corresponds to the volume index in the csv. By default it outputs afni compatible 1D file with mean of timeseries of voxels across timepoints.

Raises:
Exception
CPAC.timeseries.get_roi_timeseries(wf_name='roi_timeseries')[source]

Workflow to extract timeseries for each node in the ROI mask. For each node, mean across all the timepoint is calculated and stored in csv and npz format.

Parameters:
wf_namestring

name of the workflow

Returns:
wflowworkflow object

workflow object

Notes

Source

Workflow Inputs:

inputspec.rest : string  (nifti file)
    path to input functional data
inputspec.output_type : string (list of boolean)
    list of boolean for csv and npz file formats
input_roi.roi : string (nifti file)
    path to ROI mask

Workflow Outputs:

outputspec.roi_ts : numpy array
    Voxel time series stored in numpy array, which is used to create ndmg graphs.

outputspec.roi_outputs : string (list of files)
    Voxel time series stored in 1D (column wise timeseries for each node),
    csv and/or npz files. By default it outputs timeseries in a 1D file.
    The 1D file is compatible with afni interfaces.
CPAC.timeseries.get_spatial_map_timeseries(wf_name='spatial_map_timeseries')[source]

Workflow to regress each provided spatial map to the subjects functional 4D file in order to return a timeseries for each of the maps

Parameters:
wf_namestring

name of the workflow

Returns:
wflowworkflow object

workflow object

Notes

Source

Workflow Inputs:

inputspec.subject_rest : string  (nifti file)
    path to input functional data
inputspec.subject_mask : string (nifti file)
    path to subject functional mask
inputspec.spatial_map : string (nifti file)
    path to Spatial Maps
inputspec.demean : Boolean
    control whether to demean model and data

Workflow Outputs:

outputspec.subject_timeseries: string (txt file)
    list of time series stored in a space separated
    txt file
    the columns are spatial maps, rows are timepoints
CPAC.timeseries.get_vertices_timeseries(wf_name='vertices_timeseries')[source]

Workflow to get vertices time series from a FreeSurfer surface file

Parameters:
wf_namestring

name of the workflow

Returns:
wflowworkflow object

workflow object

Notes

Source

Workflow Inputs:

inputspec.lh_surface_file : string (nifti file)
    left hemishpere surface file
inputspec.rh_surface_file : string (nifti file)
    right hemisphere surface file

Workflow Outputs:

outputspec.surface_outputs: string (csv and/or npz files)
    list of timeseries matrices stored in csv and/or
    npz files
CPAC.timeseries.get_voxel_timeseries(wf_name='voxel_timeseries')[source]

Workflow to extract time series for each voxel in the data that is present in the input mask

Parameters:
wf_namestring

name of the workflow

Returns:
wflowworkflow object

workflow object

Notes

Source

Workflow Inputs:

inputspec.rest : string  (nifti file)
    path to input functional data
inputspec.output_type : string (list of boolean)
    list of boolean for csv and npz file formats
input_mask.masks : string (nifti file)
    path to ROI mask

Workflow Outputs:

outputspec.mask_outputs: string (1D, csv and/or npz files)
    list of time series matrices stored in csv and/or
    npz files.By default it outputs mean of voxels
    across each time point in a afni compatible 1D file.

High Level Workflow Graph: