TSTagger: Difference between revisions

From CCN Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
         condition column
         condition column
   
   
    tr: scan interval (E.g. 2.047)
tr: scan interval (E.g. 2.047)
     mat: a cell array of time series matrices
     dat: a cell array of structs: {dat.expinfo, dat.mat}, where expinfo comes
    expinfo: a cell array of the runtime expinfo structures corresponding
      from the PsychToolBox runtime .mat files, and mat is a (usually) normalized
        to the timeseries matrices
      timepoints x regions matrix of BOLD data generated by the
      gettimecourses.sh BASH script
      
      
   '''Optional arguments:'''
   '''Optional arguments:'''
Line 23: Line 24:
         all paired data files, otherwise the values will be applied to the
         all paired data files, otherwise the values will be applied to the
         corresponding dat argument cell
         corresponding dat argument cell
    precision: input values will be rounded to PRECISION decimal places
    (default: 3)
    jitter: n vectors will be generated for each event, where each element
    vector is randomly selected from the lower quartile, median or upper
    quartile of values within the window. (default: 1 - only 1 vector using
    the median is generated for each event)
    jitter_p: jittered vectors will have jitter_p proportion of values
    randomly replaced with the lower and upper quartile value. (default:
    0.1, where 0.05 are replaced by lower, and 0.05 are replaced by upper)
    bias: when jittering, the lower and upper quartile values will be
    pulled towards the median value with a weighting of bias:1. (default:
    2, meaning that each jittered value is weighted 2:1 in favour of the
    median)

Revision as of 10:12, 28 June 2019

A MATLAB function named TSTagger has been written to facilitate assigning volumes from a time series to a particular condition for supervised learning in a neural network. The function has no return value, but instead writes a series of .csv files. Each row in the .csv file represents an event from the time series. The input patterns are the median values from each column of the time series within a 5-second window following the event onset.

function TSTagger(varargin)
 Isolate TimeSeries data associated with each condition in a .mat runtime
 file
 
 Mandatory arguments:
   condition: a cell array of condition codes matching values in the
       condition column

	tr: scan interval (E.g. 2.047)
   dat: a cell array of structs: {dat.expinfo, dat.mat}, where expinfo comes
     from the PsychToolBox runtime .mat files, and mat is a (usually) normalized 
     timepoints x regions matrix of BOLD data generated by the
     gettimecourses.sh BASH script 
   
 Optional arguments:
   duration: a scalar indicating the number of volumes for each event
   (default: 1)

   volumes_dropped: number of INITIAL volumes dropped (i.e., volumes from 
       the start of the run), either as a single value or else as a vector
       of numbers. If a single value is provided, it will be applied to
       all paired data files, otherwise the values will be applied to the
       corresponding dat argument cell

   precision: input values will be rounded to PRECISION decimal places
   (default: 3)

   jitter: n vectors will be generated for each event, where each element
   vector is randomly selected from the lower quartile, median or upper
   quartile of values within the window. (default: 1 - only 1 vector using
   the median is generated for each event)

   jitter_p: jittered vectors will have jitter_p proportion of values
   randomly replaced with the lower and upper quartile value. (default:
   0.1, where 0.05 are replaced by lower, and 0.05 are replaced by upper)

   bias: when jittering, the lower and upper quartile values will be
   pulled towards the median value with a weighting of bias:1. (default:
   2, meaning that each jittered value is weighted 2:1 in favour of the
   median)