-
Notifications
You must be signed in to change notification settings - Fork 14
Using APT tracking data in JAABA
JAABA is software developed by the Branson lab for interactive training of behavior classifiers based on trajectory data. We modified JAABA to use part tracking data from APT as tracking input to behavior classification. If you have not used JAABA before, please refer to JAABA for general software use instructions.
- Recent version of JAABA https://github.com/kristinbranson/JAABA (post 20190801)
- APT project file (.lbl file)
- Movie tracked with APT project (.trk file)
StartJAABA, create a new project and chose 'Target type' = Import from APT.
Select the APT project file (.lbl file). JAABA reads landmark information from the project file. This opens the APTProject GUI.
In APTProject GUI:
- Add the algorithm suffix to the trk file name
- Select whether project has body tracking trx data and if it does JAABA target type
- List landmark pairs that will be used to calculate features ('1 2, 2 3'). The order within a pair does not matter. '1 2' is same as '2 1'
- List landmark triplets that will be used to calculate features ('1 2 3, 2 3 4'). Order within a triad does not matter if the second point is the same i.e., '1 2 3' is same as '3 2 1', but not '1 3 2'.
- If you want to use customized features, list the name of the features.
When finished hit 'Done', and this returns to your JAABA project set up. Proceed as normal for JAABA projects.
After adding the experiment directory to project, GUI will list apt features as missing and ask 'Generate now?' Push the 'Yes' button if you want to generate APT features.
This is followed by 'Regenerate existing file?' GUI. You should select 'Leave Alone' if nothing has changed since you generated body tracking based features.
Global reference frame
- velmag - velocity magnitude in global reference frame
Body reference frame
- velmag - velocity magnitude
- distcenter - distance to trx center.
- ddistcenter - time derivative of distance to trx center
- x - x location with trx center as the origin
- y - y location with trx center as the origin
- dx - time derivative of x location
- dy - time derivative of y location
- dtheta - time derivative of angle to the trx center
- sin - sin of the above angle
- cos - cos of the above angle
- x - x location of second landmark relative to first landmark
- y - y location of second landmark relative to first landmark
- dx - time derivative of above
- dy - time derivative of above
- dtheta - time derivative of angle of second land landmark relative to first.
- sin - sin of the above angle
- cos - cos of the above angle
- areaswept - area between the segments between landmark 1 and landmark 2 at time t and t + 1
- dist - Distance between the pairs
- ddist - time derivative of the above distance.
- velmag - velocity magnitude of second landmark relative to first landmark
- area - Area of the triangle
- darea - time derivative of above area
- sin - sin of the angle p1 - p2 - p3
- cos - cos of the same angle.
- dangle - time derivative of the above angle.
- dlen - difference between the length of segment p1-p2 and p2-p3.
These features are computed for all the APT landmarks. Eg: apt_view1_social_cos_13
- dist - Closest distance between the APT landmark on current animal to all the APT landmarks on all the other animals. For the example feature we will compute the distance between landmark 13 on the current animal the all the landmarks on all the other animals.
- ddist - time derivative of above distance
- cos - For the APT landmark (x) on the current animal, we find the closest landmark (y) on all the other animals. We then find the angle of this segment (x to y) relative to the current animal's orientation. The cosine of this angle is used as a feature to indicate the relative position of the closest animal.
- sin - Sine of the above angle
These features are computed for pairs specified when creating the project. The features are computed as same as above except that instead of using all the landmarks to find the closest distance, we only use specified landmark. For example in apt_view1_socialpair_dist_1_7, the pair is "1 7", and we will compute the distance between only landmark 1 on the current animal and landmark 7 on all the other animals.
For multianimal trk files, the centroid of the calculated trx is the average of the nose and tail. For non-multianimal trk files, the centroid is the average of the landmarks selected by the user during trk importation. Zero for angle calculations in body coordinates is straight up (aligned with the y-axis).