tracefunctions

This module provides a set of functions for extracting and processing traces from Regions of Interest (ROIs) in SLAP2 data. It is particularly useful for analyzing neuronal activity and other time-series data extracted from image sequences.

Functions

slap2_utils.functions.tracefunctions.cleanVolumeTrace(datafile, zId, rawTrace)

Clean the raw trace data by averaging over slices.

This function extracts the slice index information and averages the raw trace data for the given zId.

Parameters:
  • datafile (SLAP2_Utils Datafile Object) – The datafile containing metadata and header information.

  • zId (int) – Z index to be cleaned.

  • rawTrace (array) – The raw trace data.

Returns:

cleanTrace – The cleaned trace data.

Return type:

array

slap2_utils.functions.tracefunctions.returnAllTrace(datafile, chIdx=1, zIdx=1, window=10, expectedWindowWidth=100)

Return a dictionary of traces for all ROIs in the datafile.

This function iterates through all ROIs in the datafile metadata and processes traces for each ROI.

Parameters:
  • datafile (SLAP2_Utils Datafile Object) – The datafile containing metadata and header information.

  • chIdx (int, optional) – Channel index (default is 1).

  • zIdx (int, optional) – Z index (default is 1).

  • window (int, optional) – Window size for processing the trace (default is 10).

  • expectedWindowWidth (int, optional) – Expected window width for processing the trace (default is 100).

Returns:

traces – Dictionary of traces where the key is the ROI index.

Return type:

dict

slap2_utils.functions.tracefunctions.returnVolumeTrace(datafile, roiIndex, chIdx=1)

Return volume traces for a given ROI.

This function processes and cleans the volume trace data for a specified ROI.

Parameters:
  • datafile (SLAP2_Utils Datafile Object) – The datafile containing metadata and header information.

  • roiIndex (int) – Index of the ROI.

  • chIdx (int, optional) – Channel index (default is 1).

Returns:

  • _trace1 (array) – The raw trace data.

  • _trace (array) – The cleaned trace data.

slap2_utils.functions.tracefunctions.superPixelTraces(datafile, roiIdx, zIdx=1, chIdx=1)
Parameters:
  • datafile – SLAP2_Utils Datafile Object

  • roiIdx – int index value of roi in the roi list

  • zIdx – Z-Plane Index

  • chIdx – int Index of the channel being recorded

Returns:

array

An array of floats of a raw signal for each super pixel

Return type:

_pixSignal