Skip to content

1.2 Phase: preprocessing

Shun Li edited this page Dec 7, 2023 · 5 revisions

Overview

During the preprocessing phase, NeuroDAP uses the loadSessions() function to

  1. extract relevant signal from all acquisition systems
  2. perform preprocessing (e.g. demodulation) if necessary
  3. synchronize between acquisition systems

After running, relevant files will be stored within the same session folder. You can use a script to preprocess & analysis batch of sessions together. See Shun_loadSessionData.m

Requirements

  1. As different system wires information differently, it is up to the experimenter to write a custom function on assigning each signal. But in general, such function should achieve the following:
    • Assign each relevant behavior event or recording signal to a specific digital/analog channel. For example, sync pulse is stored in channel 1, licking in channel 2, airpuff in channel 3 etc.
    • While optional, perform necessary preprocessing for some channels. For example, licking might be stored in an analog channel, so thresholding is required to find the rising/falling edge to turn it into a digital signal.
  2. While loadSessions() requires minimal input to run (just the session path), user can tweak different preprocessing parameters based on their needs (e.g. rollingWindowTime)
  3. See the corresponding page of loadSessions() for detail algorithm, input options, etc.

Action items

Analysis preparation

  1. Copy concatLabjack_template.m in the tutorials folder and edit the name and content to make it suitable for your specific setup. Check concatLabjack() for more details.
  2. If you are using NIDAQ data, use create your own mapping of channels to behavior/recording signals by using assignChannels(). Still in the process of development.
  3. If you are using camera data acquired through Bonsai, create your own version of assignCameraSignals(). Still in the process of development.
  4. After writing your own version of these functions, do a sample recording in your setup, and try running loadSessions(). See loadSessions() for more details and interpretation of the plots generated.

Batch processing

  1. Running loadSessions() manually can be extremely tedious and error-prone. One of the reason that preprocessing steps are packaged in loadSessions() is a method is that it allows fast, repeatable preprocessing by deploying it in a for loop.
  2. Therefore, its highly recommended to create your version of Shun_loadSessionData.m (in Tutorials folder). In this script, you can create GUIs that allow you to select & input parameters of analysis and behavior. These information will be accordingly stored in params struct and utilized in the following session analysis stage.
    • For example, after recording sessions everyday, I'll select directories of today's sessions, enter parameters in GUI as indicated, and run loadSessions() for all sessions.
    • This process normally only takes several clicks, and it will run the relatively time-consuming process of preprocessing and synchronization, so that later we don't need to do this again.

Clone this wiki locally