trajectorytools midline package

27 views
Skip to first unread message

Carolyn Tett

unread,
Feb 29, 2024, 2:37:07 AMFeb 29
to idtracker.ai users group
Hi all,

I'm new to using idtracker.ai/idmatcher.ai, and I think my future projects will greatly benefit from what functions I've discovered so far; however, an important function of the trajectory data I am used to are the midline or "posture" data for the fish I am tracking. I've tried using the various fishmidline python classes here https://gitlab.com/polavieja_lab/midline/-/tree/master but I think several of the python objects (i.e. video_object.npy, blobs_collection.npy files) are no longer produced from the current idtracker.ai versions.

Is there an updated fishmidline python package that anyone knows about? Or is there some type of raw data I could pull from idtracker.ai from which I could obtain fish midline data?

PS I followed the other midline software recommended on the idtracker.ai FAQs page (SLEAP and DeepLabCut), but neither are quite ideal for the hundreds of hours of video my projects produce.

Thanks!
Carolyn

idtrackerai

unread,
Mar 1, 2024, 6:08:46 AMMar 1
to idtracker.ai users group
Hi Carolyn,

You are right, nowadays https://gitlab.com/polavieja_lab/midline is completely outdated. Updating and inlcuding it in the main software is on our "To Do" list but unfurtunatelly not a priority right now.

If you want to work with blob's contours (numpy arrays), you can do so by loading the list of blobs and accessing them like this:

from idtrackerai import ListOfBlobs

list_of_blobs = ListOfBlobs.load("session_whatever/preprocessing/list_of_blobs.pickle")

# iterate over the main list
for frame, blobs_in_frame in enumerate(list_of_blobs.blobs_in_video):
for blob in blobs_in_frame:
do_something(frame, blob.contour)

# or iterate over a flattened view of the list
for blob in list_of_blobs.all_blobs:
do_something(blob.contour)

I hope I have time to work a bit on this and include this "midline" project to the main idtrackerai now that I know there is at least one user intersted.

Jordi

idtrackerai

unread,
Mar 9, 2024, 12:18:03 PMMar 9
to idtracker.ai users group
Hi Carolyn and all,

I finally updated the Fish Midline repository. It won't be merged into the main idtracker.ai software since this repo is intended to work with fish data and we can't guarantee good results with other species. Feel free to check it, it's no longer an installable package but a short script that you can use to get your own results. I hope it's helpful for your research.

Jordi
Reply all
Reply to author
Forward
0 new messages