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
272 stars 137 forks source link

Analyze ROI data not working for multiple videos #363

Open breannashi opened 1 month ago

breannashi commented 1 month ago

Here are the steps I took: 1.) added video and DLC csv to existing project 2.) added a measurement for the new video in video parameters 3.) Defined ROI for the new video 4.) run analyze roi data aggregates and Analyze Distances Problem: for step 4 I am only getting results for the first video, when I want results for the new video. Video of what I am seeing on my end found here: https://youtu.be/yxb-5UfGMjw

Thank you!

sronilsson commented 1 month ago

Hi @breannashi - I think (maybe wrong) someone reported this issue a few weeks ago and we fixed it.

Which version of SimBA are you running? pip show simba-uw-tf-dev

If you run pip install simba-uw-tf-dev --upgrade do you still see this error?

PS. I think github has fixed so you can drag and drop video mp4 files straight into these chats.

sronilsson commented 1 month ago

Ah I can see the version number in your video :) Anyway, try to upgrade to latest as above, and let me know if that fixes it or not please.

breannashi commented 1 month ago

This did not fix the error. It is functioning exactly the same.

breannashi commented 1 month ago

for context: Simba: SimBA v.1.94.2 OS: Ubuntu 22.04.4 LTS

sronilsson commented 1 month ago

Thanks @breannashi - very helpful. So I better understand the issue, please correct me if I am wrong:

You first define ROIs on more than one videos, you then analyze ROI aggregate data including distances moved for these videos. However, the results you see in only contain data for a single video?

Sorry I only have a Mac at present, but are you essentially doing this process in the video below, but the final CSV only has data for one video?

https://github.com/sgoldenlab/simba/assets/34761092/f1a76cfc-8739-4df8-8923-1bca9c1c4342

breannashi commented 1 month ago

Yes that's right. and where your simba prints that it runs on both videos mine only prints one.

sronilsson commented 1 month ago

Thanks @breannashi, two more questions:

1) Can you send me your /project_folder/logs/measures/ROI_definitions.h5 file and I will take a look at it? This file stores your drawn ROI definitions. You should be able to zip it and drop it into this chat thread.

2) How many files do you have represented in the /project_folder/csv/outlier_corrected_movement_location directory of your SimBA project - can you send me a screenshot of the content of this directory?

breannashi commented 1 month ago

Thank you! here are the files requested! image image ROI_definitions.zip

sronilsson commented 1 month ago

Thanks @breannashi!

For the screenshoot, I can see that you have data for a single video (CC1_tank_exploration_29-11-22).

Opening the ROI definitions, I can also see that you have polygons drawn for two videos (with or without the _29-11-22 suffix):

image

If you want to compute the ROI data for both CC1_tank_exploration_29-11-22 and CC2_Tank_exploration, there needs to be data-files inside the /project_folder/csv/outlier_corrected_movement_location directory representing the two videos.

The reason you are getting results for only a single video file, is likely because there is only a single file in this directory, SimBA can't find any more data. Let me know if that makes sense.

breannashi commented 1 month ago

That makes sense. I am wondering why it defaults to add my regions to video 1 csv rather than make a new one? and will the .h5 also need to be altered?

sronilsson commented 1 month ago

Hi @breannashi - I am note completly sure what you mean. When you say "defaults" what do you mean?

Some notes that may be relevant:

The videos you see listed in the image below are videos that SimBA find in the project_folder/videos/ directory of your SimBA project. If the video is not there, there is nothing to draw your regions on. Add the video to that folder to be able to draw on it.

image

To duplicate the ROIs you've drawn on one video, to all the other videos listed, click the Apply to all button. For example, of I have drawn polygons on the first video in the list, but not the others, but I want the same polygons on the remaining 7 videos, I click the apply to all button associated with row 1:

image
breannashi commented 1 month ago

Never-mind! I did not read properly. The problem is I forgot to click skip outlier correction. Thank you for your help!!

sronilsson commented 1 month ago

No problem, just let me know if anything else comes up