Roi processing - obtain region of interist data from the graphical interphase

Napari is a great program .
Just learnt about it about it about a day ago
Has the feachure - ROI creation i was looking for for a long time
I attempted the feachure
ps : the application i am trying to create is a script
( i use thonny as my ide / and not a notebook)
unfortunately for the moment it appears asif the mask / roi must be
created in the event loop !! before a actually loaded the image
but what i actually need is to load an image ; create the ROI the image graphically ; and import / obtain the data for further use - ie the pixels that are part of the ROI
Is there a way to display an image , paint polygons and labels on the image ; and obtain the data
Maybe : as a sub problem ; zoom the image in the display draw the polygons / roi - but the pixels co ordinates are for the unzoomed images

Hi @kosie, glad you’re enjoying napari

If you just want to computationally define or load your ROI then that can be done outside event loop either before or after image loading, if you want to draw the ROI yourself then you need the event loop running.

It sounds like you want to combine interactive processing and manual annotation all from a script, i.e. have the scrip run, then do something manual, then trigger the rest of the script to run?

I know you said you didn’t want to use a notebook, but notebooks are pretty well suited to this type of interaction pattern. That said maybe an alternative is to use some keybindings to trigger the execution of the rest of your script after you’ve done the manual part.

If you share some code snippets maybe we can help more!