openworm / OpenWorm

Repository for the main Dockerfile with the OpenWorm software stack and project-wide issues
http://openworm.org
MIT License
2.65k stars 206 forks source link

Create script to go from worm position and contour to .mat feature file #144

Closed JimHokanson closed 10 years ago

JimHokanson commented 10 years ago

We have access to files containing movement features extracted from videos of real worms. More on the format can be seen at:

https://github.com/JimHokanson/openworm_docs/blob/master/Movement/Data/MRC_HDF5.md

For an artificial worm, we will need to have a similar set of features for comparing the artificial worm to the real worm. Additional processing is needed past the point of the feature files, but it should serve as a nice base for merging model and real data. As should be evident after implementation, there is considerable redundancy in the feature file that might be removed, but to start we'll try and mimic the file.

The inputs to the script/function will be the x and y positions of the worm skeleton, and the width of the skeleton at each point, over time. (I'll be creating another issue with this soon that provides this data ...)

Given these two matrices, create a feature file that is the same as those of the real worms. To start you can ignore:

The code that does this for real worm data can be found here:

https://github.com/JimHokanson/mrc_wormtracker_gui/blob/master/SegWorm/Pipeline/featureProcess.m

Associated files can be found in the mrc_wormtracker_gui or SegWorm repos.

More context around featureProcess.m can be found at: https://github.com/JimHokanson/mrc_wormtracker_gui/blob/master/GUI/progress_verbose.m

As an example, the first feature in the file is: worm.morphology.length

From the code, the length is computed as follows:

Feel free to post any questions here and I'll try my best to answer them.

More on the features can be found in: https://github.com/JimHokanson/openworm_docs/blob/master/Movement/features.md

For bonus points, please update the feature documentation as the code is implemented.

teechap commented 10 years ago

Every link on this issue page 404s. Any updates?

JimHokanson commented 10 years ago

Yes! Many updates. I'll try and update the original description soon.

In the mean time, this effort has moved to: https://github.com/openworm/movement_validation

A more complete Matlab version of this code can be found at: https://github.com/JimHokanson/SegwormMatlabClasses

Current development involves using files from: https://www.dropbox.com/sh/77c9yp1z9mepulx/Mz6_n_vvIl

Files used are from an actual worm video that has already been parsed into skeleton and contour, as well as a few more items (see normalized worm code in movement validation repo). Eventually the goal is to have support for going from skeleton and contour to the features without jumping in to the code in the middle like we are currently doing.

Development is being done by @MichaelCurrie and myself, although we could always use more help.

Again, thanks for pointing out the 404s to me, I'll try and edit that soon.