preview_widget
anomaly_match_ui.widgets.preview_widget
¶
PreviewWidget: image viewer with transform controls for the detail screen.
PreviewWidget()
¶
Image viewer with transform controls.
Used by :class:ImageDetailScreen to display a single image loaded
from the prediction cache (via display_standalone).
Source code in anomaly_match_ui/widgets/preview_widget.py
display_standalone(image_array, filename, score)
¶
Display an image directly without going through BackendInterface.
Used by the image detail screen to show a single image loaded from the prediction cache. Current display transforms (invert, brightness, contrast, unsharp, channel visibility) are re-applied so that a re-decode triggered by changing upstream normalisation doesn't desync from the toolbar's toggle state — without this, clicking Invert then changing the channel combination would drop the inversion while leaving the user with a button that has to be clicked twice to re-invert.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_array
|
Numpy array (HWC, uint8) of the image. |
required | |
filename
|
The source filename for the label. |
required | |
score
|
The anomaly score for the label. |
required |
Source code in anomaly_match_ui/widgets/preview_widget.py
restore()
¶
Restore the current image to its original state.
Source code in anomaly_match_ui/widgets/preview_widget.py
toggle_invert()
¶
toggle_unsharp_mask()
¶
set_brightness(value)
¶
set_contrast(value)
¶
set_rgb_channels(r=None, g=None, b=None)
¶
Set RGB channel visibility.