Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flipping body axis between head and taill while drosophila tracking #219

Open
beepathu opened this issue Feb 22, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@beepathu
Copy link

Describe the bug
I am encountering an issue with the Trex tracking software while attempting to analyze the turning of flies. The software frequently flips between detecting the head and tail as the body axis, leading to inaccuracies in the data, mainly angle of turning.
Any guidance on adjusting parameters to address the flipping body axis problem would be greatly appreciated.

The parameter settings that i currently use for trex are:
meta_real_width = 11.3
frame_rate = 20
posture_direction_smoothing = 16
outline_smooth_step = 12
midline_invert = true
track_max_speed = 24
output_invalid_value = "nan"
output_format = "csv"
individual_prefix = "fly"
gui_show_number_individuals = true
gui_playback_speed = 0.4
gui_show_selections = false
track_max_individuals = 19
auto_minmax_size = true

I am attaching some images below in hope that you get a better idea of the issue.

Here is a screenshot of our video in the Trex that shows a circular arena with 20 flies:
image (16)

Here is an example of how the head and tail switches in a fly, these images were taken in consecutive frames:
trex_error_2
trex_error

@beepathu beepathu added the bug Something isn't working label Feb 22, 2024
@mooch443
Copy link
Owner

Hey,

this is difficult to determine from the images alone. But,

  • posture_direction_smoothing should probably be disabled for now. this is more a bandate than a solution. the reason the posture may be flipping back and forth is that the shape does not really have a "pointy end". so determining tail/head would be inconsistent.
  • outline_smooth_step should be default
  • less smoothing in general would be better, and then use outline_approximate instead (e.g. 2 or 3) since it allows for one end to be smaller
  • you could try to have lower threshold when converting so you get the wings (in case they have any), which would make the shape less symmetrical / one end pointier, and then approximate

If this does not help, then it's likely a data-problem. Meaning the shapes are just not pointy enough to be automatically determined. I think it should though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants