Flint/bliss: Allow to lock ROIs location
Feedback from ID01, @leake
We have calibrated ROIs, we move a detector, the beam position changes, we draw an ROI around the center and horizontal/vertical thin ROIs for alignments to this reference (they then remain until we move the detector - could be 5 minutes/ could be 6 days). Once we have calibrated them we don't want them to change. i.e. when you go to
edit_roi_counters
they are automatically unchecked so the user cannot modify them. A locked or fixed prefix would also work as it is clear for the user but it is not true from the beamline side.We then have an intermediate level of ROIs which change more regularly but are controlled by scripts. Then the users are free to make whatever ROIs they want. We try to stick to a naming convention (but we didn't think hard about this,
"det_"
prefix for these rois), could also be"bliss_"
or"bl_"
. Maybe for simplicity we can group the fixed and intermediate into simply"bl_"
as these are modified by beamline scripts it is transparent they shouldn't be modified.Given all the naming conventions it seems sensible to stick a default prefix on user (flint) made ROIs to keep them clean i.e.
"user_"
or "u_".
Proposal 1
I propose to add a lock property to the BLISS ROIs.
tomocam.roi_counters.get("roi1").locked = True
Then we have to decide if is would allow or not to edit the ROIs in BLISS (or inly in Flint) when it is locked.
tomocam.roi_counters["roi1"] = 10,10,20,20
!!! === Exception: ROI "roi1" is locked === !!! ( for more details type cmd 'last_error(0)' )
Proposal 2
If you don't like the idea of lock in BLISS ROIs, i propose to add tags for general use cases.
This way i can define a set of tags for flint in the ROIs. And do the interpretation i want.
tomocam.roi_counters.get("roi1").tags.add("flint:locked")
This way i could use it to display them in disabled state during edition. Or to use other tags more easely for other use cases.
For example for the tomo project we have some specific ROIs which are for a specific sinogram
use case.
This tags could be useful to retrieve this ROIs in BLISS.