Skip to content

jessedmarshall/CAPTURE_demo

Repository files navigation

Image

CAPTURE: Continuous Appendicular and Postural Tracking Using Retroreflector Embedding

CAPTURE is a technique for making continous high-precision recordings of 3D rat kinematics. This repository contains demonstration code for preprocessing raw 3D kinematic data collected using CAPTURE, and then performing behavioral segmentation using t-SNE and watershed clustering. It also includes scripts for visualizing kinematic data. The main demo files are preprocess_dannce.m and CAPTURE_quickdemo.m. The preprocessing script inputs raw 3D marker positions, smooths them using a simple median filter in each coordinate, and aligns them into an egocentric reference frame centered on the animal. The behavioral analysis script generates a set of behavioral features based on (1) postural features, which are eigendecompositions of the animal's posture, body segment lengths, and joint angles and (2) dynamical features, which are the wavelet transform of these features. It then uses to tSNE to obtain a low-dimensional representation of the behavior. An additional function Behavioral_Analysis\find_sequences_states_demo.m further organizes these behaviors into different repreated behavioral patterns. Some visualization scripts are also included to view the results.

Image Image Image Image Image

Data Directories

You can download the DANNCE dataset and test CAPTURE dataset from:

This code uses functions from the following open source software:

The software is already included in the utilities folder.

Compatibility. This code has been tested in 64-bit MATLAB 2017b and 2019b running on Windows 10.

QuickStart Demo

 filename_in = `predictions.mat`;
 filename_out = 'predictions_preprocessed.mat';
 species_name = 'my_animal'
 preprocess_dannce(filename_in,filename_out,species_name)

About

Demo code for CAPTURE and DANNCE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages