sgoldenlab / simba

SimBA (Simple Behavioral Analysis), a pipeline and GUI for developing supervised behavioral classifiers
https://simba-uw-tf-dev.readthedocs.io/
GNU General Public License v3.0
287 stars 140 forks source link

Issue to measure distance #107

Closed DorianBattivelli closed 3 years ago

DorianBattivelli commented 3 years ago

Hello,

I finally finished my analysis of ROIs and distance, but while ROIs times seems to be good (coherent given what I can see watching the video), the distance are clearly wrong and even incoherent given the output SimBA gives for the ROIs times.

For ex, in this case, I have mouse 1 (lowshaved) that stays during the whole video almost only in compartment 1, while mouse 2 (uppershaved) is roaming freely into the 4 compartments of the device, and indeed, SimBA "sees" this:

Untitled

But when I look at the distances for each mouse, mouse 1 performed a huge distance compared to mouse 2:

Untitled2

So, it seems that mouse 2 walked only 4 cm while he was continuously walking for 10 min. It should be the opposite, but in any case, both walked far more than 4 cm. I also looked at the movement within ROIs, and the results are totally differents:

Untitled3

The cells, from left to right show movement in compartment 1 to 4 for mouse 1, and for mouse 2. These data fit more what I observe (overall mouse 2 walked more than mouse 1), but still, it seems that mouse 2 walked only 3 meters overall which is no true, he walked much more for sure (our device is 2.5 meter long and it crossed it several times).

Finally while mouse 1 never entered compartment 4, SimBA quantified a non-null movments / distance there. I don't understand cause, after having corrected the ID swaps on DLC, there is no more frame with mouse 1 in the compartment 4.

Would you have a suggestion to get a reliable quantification of distance for each mouse?

Thank you, Best, Dorian

sgoldenlab commented 3 years ago

Thanks @DorianBattivelli - this sounds like an issue that was reported and fixed on April 14th on Gitter, it related to the headers being scrambled up - animal 2 did not move 4cm, it's likely to be the animals velocity - headers where in the wrong order and I fixed it but here it seems like it may be introduced again - can you make sure you are running the latest version of simba-uw-tf-dev before I check how the bug could have been reintroduced again?

DorianBattivelli commented 3 years ago

Thanks @sgoldenlab ,

Sure, how can I check the version that is installed?

DorianBattivelli commented 3 years ago

As far as I remember, the last upgrade I installed was 0.83.3

sgoldenlab commented 3 years ago

@DorianBattivelli - if you type pip show simba-uw-tf-dev you should see version 0.83.3.

Also, if you if you type pip show simba-uw-tf there should be nothing printed out (this to make sure you don't have two versions of SimBA installed)

DorianBattivelli commented 3 years ago

All seems to be good:

Untitled

sgoldenlab commented 3 years ago

Hi @DorianBattivelli - sorry there will be some delay in looking into this, I will try to replicate what you are seeing but it will have to be later this week - a lot going on. Am I right in that you have 4 rectangle ROIs, and 2 mice?

DorianBattivelli commented 3 years ago

Hello @sgoldenlab , no problem, thank you for the support! Yes, 4 rectangle ROIs, and 2 mice are good,

Best!

sgoldenlab commented 3 years ago

Hi @DorianBattivelli - I am not sure what was going on here with the headers.. might have been some version number clashes.

Can you update to simba-uw-tf-dev==0.83.4 and see if the numbers make more sense now?

DorianBattivelli commented 3 years ago

Hi @sgoldenlab, I think it solved the issue, thank you!

Best