Skip to content

Analysis Module

cjgabrie edited this page Feb 25, 2022 · 10 revisions

Getting Started with BehaviorDEPOT

Formatting Data

Pose Estimation Format (DLC Output)

Video Format

Using the BehaviorDEPOT GUI

Running an Analysis Session (single)

Analysis Module - (In Progress)

This section will demonstrate how to run a session in the Analysis Module:

  1. After installation, launch BehaviorDEPOT from the App tab within Matlab.

  2. Select which classifiers to use:

    • Certain classifiers have adjustable parameters. Click on ‘Edit Params’ to adjust those parameters.
  3. Set distance calibration

    • Calibration can be calculated using ImageJ. Open a frame from a video and measure out the pixel distance of a known dimension (e.g. arena length). Use that to calculate the pixel-to-centimeter ratio.
  4. Enter number of custom ROIs (in addition to classifier-based ROIs, e.g. Elevated Plus Maze, Open Field Test)

  5. Choose whether or not to filter based on frame-locked events

    • Input for these is required to be a spreadsheet file (.csv, .xlsx), with each event as a row, the start frame in the first column and the end frame in the second column.
  6. Select plotting preferences

    • ‘View Spatial Trajectory’ plots all the positions of the animal across the session.
    • ‘View spatiotemporal trajectory’ plots position across time, color coding the location points.
    • ‘View behavior location’ overlays a marker on the locations where behavior(s) of interest occurred.
  7. Select single session or batch process

    • Single session for analyzing one paired DLC output and video file.
    • Batch process for analyzing multiple files with the same parameters. The required input structure for batch processing:
      • Grandparent folder, which is selected for analysis.
        • Parent folder 1 (Containing exclusively a single, matching pair of spreadsheet and video files) A single event file can also be included, and must be indicated with ‘cue’ in the filename (eg myevents_cue.csv)
        • Parent folder 2 (same as above)
        • Parent folder n (same as above)
  8. Hit Start.

  9. Follow the onscreen prompts to enter and customize your data. Depending on your settings:

    • If doing ‘single session’, you will be prompted to use the directory browser to select the spreadsheet and video files for analysis.
    • If doing ‘batch process’, you will be prompted to select the folder containing directories for analysis (see batch process instructions for data organization)
    • You may be prompted by the GUI to draw and name ROIs or parts of the arena, depending on your settings.
    • You will be prompted to select the body part corresponding to your custom named part.
    • You may be prompted to select timestamp files containing the start and stop frames of temporal events, and then name those events.
  10. Results will be saved in a new folder in the same directory as the data.

Running Batch Analysis

Converting Human Annotations to hB Files (In Progress)

  1. Save manual annotations as a 3 column table (1st: Start Frame, 2nd: Stop Frame, 3rd: Behavior Label)

    • Function is compatible with data tables in .mat or .csv files ** To import data from larger excel/csv files, select "import data" in Matlab and create 3 column tables for each video analyzed. After importing data as a table, save the table file as a .mat
  2. Run convertHumanAnnotations function in Matlab

    • Inputs:
        1. table_filename: str/char pointing to MATLAB table file (requires path if not in current directory)
        1. total_frames: int, optional total number of frames in analyzed video
        • NOTE: if total_frames is empty, function will use the video file IF IN SAME FOLDER AS INPUT TABLE
        1. output_filename: str/char, optional; (default behavior = hB_[original filename])
  3. Results will be saved as an hBehavior structure (similar in format to Behavior structures from Analysis Module)

    • File name will be 'hB_[original filename]' or named as [output_filename] if applicable

Clone this wiki locally