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
286 stars 139 forks source link

Impossible to resume ROI drawing #153

Open DorianBattivelli opened 2 years ago

DorianBattivelli commented 2 years ago

Hello,

I'm using Simba (last version) on Windows 10, with DLC (one animal model) pose estimation data. I'm trying to analyse ROIs for 8 videos. I drew already the ROI for 3 videos and closed the programm. Now I try to resume, but when I click "load defined ROI tables" and then on the "draw" button of a video for which I had already drawn the ROIs, or on the button of a video for which I have not yet drawn the ROIs, the drawing window does not appear anymore. Instead here what I get:

Schermata 2021-12-15 alle 20 12 39

Do you know what I can do to turn back to draw my ROIs?

Thank you, Best, Dorian

sronilsson commented 2 years ago

Hi @DorianBattivelli - thanks for reporting. I can't see the entire error msg in your screenshot and I can't recreate the error.

But I have inserted a potential fix where SimBA opens the table append mode instead

Could you update SimBA with either pip install simba-uw-tf-dev --upgrade or pip install simba-uw-tf-dev==0.88.8 and see if you still see the same error?

DorianBattivelli commented 2 years ago

Hello @sronilsson ,

Thank you very much for the feedback. I did the update, but I still can't resume the drawing:

When I click "load defined ROI tables" and then on the "draw", I get "ROI definitions saved..." while when I click "delet" I get "Cannot delete ROI definitions" message, as you can see:

Schermata 2021-12-16 alle 07 39 51

The only way that work to draw the ROI, is by using the new interface area underneath (New SimBA ROI interface - experimental). From there, by clicking "draw" the frame pops out and I can proceed to drawing... but from scratch. Maybe I deleted my previous drawing yesterday when I tried different strategies to make the ROI interface work... So for the future, in case i want to resume to an interrupted drawing, must I use the new interface area only?

Also, when do you think it will be possible to draw shapes with specific precise sizes? I need to draw several shapes of the same dimensions with very precise lengths. But this is very difficult because the option to define lengths is not yet functional and the drawing of the shapes does not yet allow to make squares with the 4 sides automatically having the same length.

Thank you for the help and for developping this amazing soft,

Best, Dorian

sronilsson commented 2 years ago

Hi @DorianBattivelli! I’m not sure why this happened at the moment but a possibility:

Your drawing information is stored in a file located at project_folder/logs/measures/ROI_definitions.h5. This file is created the first time you use the “standard” ROI drawing interface for a project, or the first time you use the new “experimental” interface. If the file already exists, then SimBA will open it instead of a creating a new file when you click load defined ROI tables or when open the experimental interface. If you have created ROI drawings in the experimental interface, you won’t be able to open it in the old interface, or vice versa. So better stick to one. The error could also happen if you change video or file-names after you have created your ROI drawings. For the future, I would stick to using the experimental interface. Future updates and bug fixes will be made to this interface in mind.

I will insert the Drawing ROIs with pre-set dimensions, but it is not on top of the list. For now, I would recommend the duplicate ROI function:

https://github.com/sgoldenlab/simba/blob/master/docs/ROI_tutorial_new.md#duplicating-rois

This at least makes sure that all your shapes are the same dimensions. You can also make sure that they are perfectly aligned and exactly the same dimensions with this function:

https://github.com/sgoldenlab/simba/blob/master/docs/ROI_tutorial_new.md#aligning-rois

I know that this does not allow you to draw multiple shapes of one specific metric dimensions, but it is the best we can do, for now.