File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -524,7 +524,10 @@ def paste_metadata(self) -> None:
524
524
sel_objects = self .objview .get_sel_objects (include_groups = True )
525
525
for obj in sorted (sel_objects , key = lambda obj : obj .short_id , reverse = True ):
526
526
obj .metadata .update (self .__metadata_clipboard )
527
- self .SIG_REFRESH_PLOT .emit ("existing" , True )
527
+ # We have to do a manual refresh in order to force the plot handler to update
528
+ # all plot items, even the ones that are not visible (otherwise, image masks
529
+ # would not be updated after pasting the metadata: see issue #123)
530
+ self .manual_refresh ()
528
531
529
532
def remove_object (self , force : bool = False ) -> None :
530
533
"""Remove signal/image object
@@ -615,7 +618,11 @@ def delete_metadata(
615
618
if index == 0 :
616
619
self .selection_changed ()
617
620
if refresh_plot :
618
- self .SIG_REFRESH_PLOT .emit ("existing" , True )
621
+ # We have to do a manual refresh in order to force the plot handler to
622
+ # update all plot items, even the ones that are not visible (otherwise,
623
+ # image masks would remained visible after deleting the ROI for example:
624
+ # see issue #122)
625
+ self .manual_refresh ()
619
626
620
627
def add_annotations_from_items (
621
628
self , items : list , refresh_plot : bool = True
Original file line number Diff line number Diff line change @@ -295,7 +295,10 @@ def refresh_plot(
295
295
If False, only show the items (do not update them, except if the
296
296
option "Use reference item LUT range" is enabled and more than one
297
297
item is selected). Defaults to True.
298
- force: if True, force refresh even if auto refresh is disabled.
298
+ force: if True, force refresh even if auto refresh is disabled,
299
+ and refresh all items associated to objects (even the hidden ones, e.g.
300
+ when selecting multiple images of the same size and position). Defaults
301
+ to False.
299
302
300
303
Raises:
301
304
ValueError: if `what` is not a valid value
@@ -341,7 +344,7 @@ def refresh_plot(
341
344
scales_dict = {}
342
345
343
346
if oids :
344
- if what != "existing" :
347
+ if what != "existing" and not force :
345
348
oids = self .reduce_shown_oids (oids )
346
349
ref_item = None
347
350
with create_progress_bar (
You can’t perform that action at this time.
0 commit comments