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

ROI analysis - not possible ROI definition #337

Open DanaeNikol opened 4 months ago

DanaeNikol commented 4 months ago

Hi there! *ROI definition not possible After the outlier correction, when trying to proceed to the ROI analysis, it is impossible to define the shape and number of ROIs. When I try to draw the ROIs for an individual video, after selecting the shape, I get stuck in the shape definition where I get the following:

Screenshot at 2024-02-24 14-50-27

There is no traceback error on the prompt or any sign that anything is going on. If I try to proceed to the drawing(after the frozen "Define shape" window), then I get the following Error:

Screenshot at 2024-02-24 15-00-04

To Reproduce Steps to reproduce the behavior:

  1. Go to 'ROI" tab on your project
  2. Click on 'Define ROIs'
  3. Select Draw for one video
  4. Select shape type of ROI

****If I try to close the window of "define shape", I get a message that it is not responding.

I am using the last Simba update.

Desktop (please complete the following information):

Thanks a lot!

sronilsson commented 4 months ago

Hi @DanaeNikol! Thanks for reporting. Just before I start to dig:

Which version of SimBA do you see if you run pip show simba-uw-tf-dev ?

I ask because I had some issues related to threading introduced a week-ish ago and I thought I'd fixed recently, I want to make sure its not the same issue.

sronilsson commented 4 months ago

Couple more question - as I can see the Define shape window is bank.

When you first open the window by clicking on DRAW, do you see any warnings or errors in the terminal complaining about not being able to open the video file?

Do you get the same error for all the video files, or is it specific to this video?

image

Are the project located on a server with any read or write permissions that could block you opening the video and reading frames, or is it locally in the e.g., /home/ dir somewhere?

DanaeNikol commented 4 months ago

It seems like I am using version 1.82.7.

The same situation happens on another couple of videos I tried to also draw ROIs for. The project is located on a server but I would guess this should not be a problem, since the permissions are all set to read and write access for everyone.

image

DanaeNikol commented 4 months ago

I just found out that I needed to put a name on the shape name for the frame to appear. Then it actually allows me to draw. Thanks a lot!

sronilsson commented 4 months ago

Thanks for letting me know @DanaeNikol - I just found myself a linux computer and was about to see if I could recreate this problem, but will leave it for now as it seems to be running? But I have it now, if another issue pops up I can attempt to recreate.

DanaeNikol commented 4 months ago

Thank you @sronilsson! A very quick question: in ROI definition is there a way to move all ROIs together at once? I tried different key combinations and went through the documentation, but found nothing. And it would be a very helpful tool :)

sronilsson commented 4 months ago

It's a good point, I have not written a function like that.. just to confirm how it would work, when you move all ROIs, you would click once on the image - it would then lock to the current centroid of all ROIs. Then you would move your mouse and click again. That would cause all ROI centroids to move the delta(x) and delta(y) which is the difference between the first mouse click and the second mouse click? (and the other outer boundaries would of course be corrected but remain the same relative to the new centroid location).

... I can see the possibility of moving some ROIs by mistake outside the image lol so have to have some control for that

DanaeNikol commented 4 months ago

I would guess this could be a good idea, yes. Could it potentially also be possible to select the ROIs one wants and not all of them potentially? But then I guess it would be a bit more complicated with the centroid and all?

sronilsson commented 4 months ago

Thanks @DanaeNikol - that's even better I think.

Just trying to get my head around anticipated behavior. Say you have selected several ROIs by holding down the shift key. What happens next? You click on a final location without holding down the shift key, and then do the first selected ROI end up in the clicked location and all the other clicked ROIs move but keep their relative position to the first ROI location?