mooch443 / trex

TRex, a fast multi-animal tracking system with markerless identification, and 2D estimation of posture and visual fields.
https://trex.run
GNU General Public License v3.0
81 stars 8 forks source link

Regions of interest (ROIs) #204

Open roaldarbol opened 1 year ago

roaldarbol commented 1 year ago

Is your feature request related to a problem? Please describe. Many setups have animals divided into separate tubes, dishes, enclosures etc. In those cases, it would be great to be able to select regions of interest, especially as identification won't be needed and ID swapping could be avoided (which also makes life much easier on a CPU-only setup).

Describe the solution you'd like I'd suggest making an intuitive way to draw shapes (e.g. boxes or ellipses) in which to track. Additionally, if one could decide how many animals were in each ROI (or even assign animal IDs to each ROI), that would ensure amazing consistency. It would also assure that artefacts such as shadows would be discounted.

Describe alternatives you've considered So far I've just done the normal tracking, and had to come up with creative analysis pipelines to assure there were only one animal in each tube and that the ID stayed the same

Additional context ROIs are also a really useful feature used in idtracker.ai.

mooch443 commented 1 year ago

This is a very good idea. Indeed I have something like that already in the software (with track_ignore/track_include + recognition_shapes + recognition_border). However, these do not fulfill the exact use-case you are describing. What you mean would be more along the lines of "track these areas of interest separately"? Because this is kind of what the algorithm does automatically if individuals dont come close together (+ settings like max_speed are set correctly). It will put them in matching groups/cliques (display using gui_show_cliques). Of course what you say goes a bit further, say if an individual is lost it will only be reassigned within the same ROI. So maybe this is something specifically that I should add. Also the number of individuals / ROI.

I would use polygons, btw, since that is what I am using nowadays anyway and it's the most versatile.

I will strongly consider this, as I think it would be a great addition! Thanks for the suggestion, -Tristan

roaldarbol commented 1 year ago

That sounds good, and yes, "track these areas of interest separately" is kind of what I mean. And particularly, the "only reassigning within the ROI is the sticking point I think. Using polygons sound like a good middle way for sure, I agree. Thanks, and I look forward to the new version!