1.1 Phase: recording - shunnnli/NeuroDAP GitHub Wiki

Overview

During the recording phase, user acquire data using their acquisition system of choice and store everything under the same session folder (see below). NeuroDAP is minimally involved in this process except for requirements below to be compatible for downstream preprocessing.

Requirements

  1. A common sync pulse of random inter-pulse interval should be sent to all acquisition system. Otherwise synchronization during preprocessing will not be possible
  2. If labjack-based recording is used, there're two important scripts/functions:
    • run_labjack.mat: this script defines the labjack settings (see below) and runs the acquisition of labjack during recording. It will automatically save inside the session folder (ie sessionName/Photometry)
    • concatLabjack_setupName.mat: this function should be customized/edited based on individual rig setup. This defines the content of each channels and fills in empty labjack fields for analysis later.
  3. In run_labjack.mat
    • There should be a labjack struct that contains following information. These information will be used during preprocessing phase for analysis steps like demodulation/detrending/z-score.
      • labjack.name: name of each recorded channel (eg {'NAc','LHb','PMT'} or {'NAc-green','NAc-Isosbestic'})
      • labjack.record: whether the channel is recorded/use for analysis (eg [1,0,0] if I don't have LHb recording)
      • labjack.mod: whether the channel is amplitude modulated (eg [1,1,0])
      • labjack.modFreq: what is the frequency of amplitude modulation for each channel (eg [200,250,nan])
      • labjack.LEDpowers: average power output of LEDs (calibrate every day)
      • labjack.LEDpower2: average power output of LED2 (calibrate every day)
      • labjack.LEDpowerMin1: minimal power output of LED1 (~5uW for me)
      • labjack.LEDpowerMin2: minimal power output of LED2 (~5uW for me)
    • User can define at which frequency the signal is modulated at. The script will takes into account to lowest power that user provided (to avoid absolutely no signal) and autocalculate the maximal amplitude of modulation to prevent clipping. The average power will be the same as labjack.LEDpower
  4. In concatLabjack_setupName.mat
    • As this function is heavily dependent on rig setup, please refer to the corresponding code

Action items

Recording preparation

  1. Download run_labjack.mat in the tutorials folder, saved its parent folder to the recording computer. You can copy and modified it to make it suitable depending on your setup needs
  2. Name your signals in labjack.name, set the number of channels to record in labjack.record. labjack.nSignals should be automatically updated without manual setting.
  3. Determine amplitude modulation parameters for each channel respectively, this involves:
    • Determine sampling frequency (labjack.samplerate)
    • Determine amplitude modulation frequency for each signal channel (labjack.modFreq)
  4. Determine the minimal LED power (~5uW for me), saved it in labjack.LEDpowerMin
  5. Everyday: calibrate the LED power to desired average intensity (~25uW for me), enter this number in labjack.LEDpowers. The script will automatically calculate amplitude modulation traces using [getModPowers()](), and store it in labjack.Modpowers1andlabjack.Modpowers2` for respective LEDs.

Start recording

  1. Open an new acquisition window for NIDAQ (if needed to record NIDAQ data).
  2. Run run_labjack.mat. When running the script, it will show a popup window asking you to confirm whether labjack info is correct. Click yes if the info are confirmed correct.
  3. A popup window will show with a text box, enter the name of the session (should be the same as the session name in NIDAQ system)
  4. Another popup window will show to remind you to start NIDAQ recording as well (by pressing 'Enable recording', as I recorded my behavior in NIDAQ acquisition system). Ignore or delete this if it does not apply to you.
  5. Click yes in the final popup window to start recording of labjack.
  6. If needed, start camera recording in Bonsai as well.
  7. After all acquisition system starts recording, start the task in Arduino.

End recording

  1. Stop the arduino task.
  2. Stop camera, NIDAQ and Labjack recording. To stop labjack recording, type Ctrl-C in the command window to stop it.
  3. Take animal off the rig, and clean the rig.
  4. Drag NIDAQ+Labjack containing session folder to server, then drag the camera data to server.