Preprocessing step

code.analysis.run_preprocess()

RUN_PREPROCESS runs a whole preprocessing configuration on an input data. The steps are applied in the order of the configuration.

Parameters:
  • config (list of struct) – the preprocessing configuration details

  • data (2D matrix) – the data to preprocess

Returns res:

the result of the input data after processing using the preprocessing steps in config

Returns preprop_deets:

the detailed parameteres that were used to preprocess the data

Note: This will process any 2D matrix. As the output of the processing is a 2D matrix that will be used within Mapper, the output rows will be reduced by the Mapper. If you want to reduce the columns instead, you can use the transpose preprocessing step. Usually for fMRI data, if we want to process the dynamics, we use rows as the time points (TRs) and columns as the ROIs, with the value being the BOLD response at a ROI at that point in time.

Possible preprocessing steps:

  • zscore: normalizes the input data by subtracing the mean and diving by the standard deviation of the input data.

  • zscore-baseline: normalizes the input data by subtracing the mean and diving by the standard deviation of the baseline data. The baseline data indices are defined within the preprocess step as min and max.

  • transpose: simply transposes the data.

  • drop-nan: drop Not-A-Number (nan) values in two steps: (1) drop rows (e.g., TRs) that are all nan; (2) drop columns (e.g., ROIs) that contain at least one nan value.

  • drop-lowvar: drop all columns (e.g., ROIs) that have a variance below the one provided as value var.