careylab / LocoMouse_Dev

improving LocoMouse
0 stars 3 forks source link

LocoMouse Tracker v2.0 Development Version

This is a development version meant for members of the Carey lab (Champalimaud Foundation, Lisbon, Portugal) to be tweaked and expanded to meet the changing requirements for different research projects.

While we are trying to keep this process clean, there is no guarantee that all bugs have been found after the latest changes were made at the point you are downloading it.

The code is currently licenced for non-commercial use only. Other licences can be arranged on contact with the authors.

For questions, suggestions or bug reporting please contact Ana Machado (ana.machado@neuro.fchampalimaud.org), Megan Carey, (principal investigator, megan.carey@neuro.fchampalimaud.org).

If you find this code useful, please reference it together with the LocoMouse system paper.

Intro

LocoMouse_Tracker was developed in MATLAB R2013 for tracking mouse features of locomoting mice when observing them from the side and bottom view simultaneously. Since then it is being updated for use in later Matlab versions when necessary for continued use in the Carey Lab. It uses Support Vector Machines to learn image filters for each of the features and a multi-target tracking framework to resolve the most likely tracks from the image observations. This software was developed for specific setup, and so replicating such conditions is essential for it to work as intended. The general framework is, however, flexible enough to be modified for a different setup.

Please read the following files before using this code:

Requirements

Matlab toolboxes:

Additional packages (already included):

Efficient Second Order Multi-Target Tracking with Exclusion Constraints Russel C., Setti F., Agapito L. British Machine Vision Conference (BMVC 2011), Dundee, UK, 2011.

These packages are already included in this release. Please read the respective copyright and license files before using this software.

Content

This section briefly describes the different modules and how to use them. For a more detailed description please refer to the paper and the help sections/comments on the code. A short tutorial with the sequence of steps from labelling to tracking is presented in tutorial.m.

Practical Use and Limitations

The SVM models are dependent on the image conditions used to train them. To use the provided SVM models, please make sure the following conditions apply:

Example data for testing

To run the example you will need a video example. Please go to https://www.dropbox.com/sh/hfu0sayfzwoqwp1/AADcMwYPl0UHw8jTDIRIHBtoa?dl=0 and download 'G6AE1_98_28_1_control_S1T1.avi' and 'G6AE1_98_28_1_control_S1T.png' into the LocoMouse/movies/3_11_2013_S1/G6AE1 folder. Settings: Output Mode: sameOutputFolder Background Mode: perSession Calibration File: IDX_pen_correct_fields2 Model: model_LocoMouse_paper Mouse orientation: auto detect orientation Bounding Box and Weighting Set: Over Ground [Ana]

Questions we were asked

What objective did you use and how far from the corridor is it?

In the first publication using LocoMouse: objective: format is 4/3 inch, focal length 12 mm, iris range F2.0-22 distance to mirror ca 60 cm corridor in view: ca 55 cm

Have you tried locoMouse also on data with lower sampling rates than 400Hz (e.g. 200Hz frame rate) and does it function comparably?

We have, and it also works. However, errors occur when the algorithm tries to assign identity to the potential paws when the paws move too far between frames. One can change the algorithm to allow larger distances, but then you run into the problem that more than one paw is located within the search region. In any case, if you reduce the frame rate, you need to make sure the exposure time does not increase. Longer exposure times lead to motion blurr.

My tracking looks bad, why?

It's most likely to be one of these problems:

Which data do I use for further analysis?

final_tracks_c and tracks_tail_c include pixel data after correction for distortions from optical perspective (this is why you need to run a calibration with LocoMouse_Calibration). You also need to find out the pixel to mm transformation in your setup. Multiply it with your pixel data to get real spatial measures. final_tracks and tracks_tail give you the pixel data before the image is corrected for distortions. They should NOT be used for stride parameter analysis, they are merely for visualization purposes (e.g. plotting the labels on images from the original video).

Do your stride analysis scripts give me publishable data?

I don't know, it depends on what you feed it, so you will have to check it. But my safe bet would be no.

Acknowledgements

This software was develop by Joao Fayad at the Neural Circuits and Behavior Lab from the Champalimaud Neuroscience Programme. It is inspired by previously existing tracking code (unreleased) developed by Ana S. Machado, Dana Darmohray and Megan R. Carey.

Ana S. Machado, Dana Darmohray, Hugo G. Marques and Megan R. Carey contributed with discussions, suggestions and testing of the software.