erlab.interactive.imagetool.viewer_linking¶
Linking and history decorators for ImageTool viewer widgets.
Functions
|
Sync decorated methods across multiple |
|
Log history before calling the decorated method. |
|
Ignore history changes made within the decorated method. |
Classes
|
Internal class for handling linked |
- erlab.interactive.imagetool.viewer_linking.suppress_history(method=None)[source]¶
Ignore history changes made within the decorated method.
- erlab.interactive.imagetool.viewer_linking.record_history(method=None)[source]¶
Log history before calling the decorated method.
- erlab.interactive.imagetool.viewer_linking.link_slicer(func=None, *, indices=False, steps=False, color=False)[source]¶
Sync decorated methods across multiple
ImageSlicerAreainstances.- Parameters:
func (
Callable|None, default:None) – The method to sync across multiple instances ofImageSlicerArea.indices (
bool, default:False) – IfTrue, the input argument namedvaluegiven tofuncare interpreted as indices, and will be converted to appropriate values for other instances ofImageSlicerArea. The behavior of this conversion is determined bysteps. IfTrue, An input argument namedaxisof type integer must be present in the decorated method to determine the axis along which the index is to be changed.steps (
bool, default:False) – IfFalse, considersvalueas an absolute index. IfTrue, considersvalueas a relative value such as the number of steps or bins. See the implementation ofSlicerLinkProxyfor more information.color (
bool, default:False) – Boolean whether the decorated method is related to visualization, such as colormap control.
- class erlab.interactive.imagetool.viewer_linking.SlicerLinkProxy(*slicers, link_colors=True)[source]¶
Bases:
objectInternal class for handling linked
ImageSlicerAreas.- Parameters:
*slicers (
ImageSlicerArea) – The slicers to link.link_colors (
bool, default:True) – Whether to sync color related changes, by defaultTrue.
- sync(source, funcname, arguments, indices, steps, color, transaction_id, keep_pending)[source]¶
Propagate changes across multiple
ImageSlicerAreas.This method is invoked every time a method decorated with
link_slicer()in a linkedImageSlicerAreais called.- Parameters:
source (
ImageSlicerArea) – Instance ofImageSlicerAreacorresponding to the called method.funcname (
str) – Name of the called method.arguments (
dict[str,Any]) – Arguments included in the function call.indices (
bool) – Arguments given to the decorator. Seelink_slicer()steps (
bool) – Arguments given to the decorator. Seelink_slicer()color (
bool) – Arguments given to the decorator. Seelink_slicer()