Skip to content

Qt widgets

Qt widgets for building your own window around a CellierController. Each one reads and writes the controller's models through its event bus. The convenience API's controls= models build these for you; the same widgets for notebooks are on the anywidget page.

A widget for one appearance field (a toggle, a spin box, a colour) lists only what it adds; what they all share (widget, close, subscription_specs, visual_ids, field, control, value) is documented once, on QtAppearanceField under Building blocks.

Canvas and dims

cellier.gui.qt.QtCanvasWidget

Wraps a render canvas above a QtDimsControl panel.

Composes the two elements in a QVBoxLayout so that the canvas expands to fill available space while the dims control sits below it at a fixed height. The dims control includes the 2D/3D toggle button when the scene can be shown both ways (see from_scene_and_canvas), so no separate toggle widget is needed.

Prefer constructing via from_scene_and_canvas rather than calling __init__ directly.

Parameters:

Name Type Description Default
canvas_view

A CanvasView instance; its .widget property provides the render surface to embed.

required
dims_control QtDimsControl

An already-constructed QtDimsControl instance.

required
parent QWidget | None

Optional Qt parent widget.

None

widget property

widget: QWidget

The outer QWidget to insert into a layout.

dims_control property

dims_control: QtDimsControl

The QtDimsControl panel embedded below the canvas.

from_scene_and_canvas classmethod

from_scene_and_canvas(scene, canvas_view, axis_values: Mapping[int, AxisValues], *, parent: QWidget | None = None) -> QtCanvasWidget

Construct from live scene and canvas objects.

Derives axis labels and the initial dims state from scene so that callers only need to supply axis_values (which requires data-store knowledge not available on the dims model itself). The 2D/3D toggle is included automatically when the scene renders both ways and has an axis to add to a 2D view. It starts from the scene's displayed axes; the mode not shown yet gets a default. From 2D, the 3D set adds the last remaining "space" axis in world order (any remaining axis when no space axis is left); from 3D, the 2D set is the last two displayed axes in world order. The default is replaced once the scene has shown that mode.

Call controller.connect_widget on the returned widget's dims_control after construction to wire subscriptions.

Parameters:

Name Type Description Default
scene

The live Scene object whose dims this panel controls.

required
canvas_view

The CanvasView whose .widget is the render surface.

required
axis_values Mapping[int, AxisValues]

Mapping of axis index to that axis's slider values, e.g. {0: ContinuousAxisValues(min=0, max=99)}.

required
parent QWidget | None

Optional Qt parent widget.

None

compose

compose(host) -> object

Hand this widget to host as a center leaf.

Qt composes canvas-over-dims internally, so unlike AnywidgetCanvasView.compose there is nothing to arrange here.

close

close() -> None

Unsubscribe the dims control from the bus.

cellier.gui.qt.QtDimsControl

Bidirectional dims slider panel + 2D/3D toggle wired to the event bus.

Composes a QWidget container (with a QFormLayout) holding one slider per axis, plus (when axes_2d/axes_3d are given) a toggle button that switches the scene between its 2D and 3D axis sets. An axis shows a slider when it is one of the scene's slider_axes and is not displayed.

Follows the bus-widget pattern:

  • One widget id shared by the sliders and the toggle.
  • Subscribed to DimsChangedEvent via controller.connect_widget.
  • Echo-filters its own changes using source_id.
  • Suppresses re-entrant slider signals with blockSignals when applying model-driven updates.
  • The toggle never relabels itself optimistically on click -- it waits for the echoed DimsChangedEvent, same as the sliders, so there is a single source of truth for "what is currently displayed."

Wire to the controller after construction:

control = QtDimsControl(scene_id, axis_values=..., axis_labels=...)
controller.connect_widget(
    control, subscription_specs=control.subscription_specs()
)

Parameters:

Name Type Description Default
scene_id

UUID of the scene whose slice indices this widget controls.

required
axis_values Mapping[int, AxisValues]

Mapping of axis index to that axis's slider values, in world units. A ContinuousAxisValues axis gets a double-valued slider over [min, max] -- a slice position is a world position, not a voxel index. A DiscreteAxisValues axis gets an integer slider over the positions of its values, with a readout showing the value or its label; it emits the world value, never the position.

required
axis_labels dict[int, str]

Mapping of axis index to display label, e.g. {0: "z", 1: "y", 2: "x"}.

required
initial_slice_indices dict[int, float] | None

Starting slider values; typically scene.dims.selection.slice_indices.

None
initial_displayed_axes tuple[int, ...]

Axes to hide initially; typically scene.dims.selection.displayed_axes.

()
slider_axes tuple[int, ...] | None

The world axes that get a slider when not displayed; typically scene.slider_axes. None (the default) gives every axis in axis_values one. Kept current by SliderAxesChangedEvent.

None
thickness_axes Collection[int] | None

The axes whose slider row gets a half-thickness box ("±", world units, minimum 0), bound to the scene's per-axis thickness. None (the default) gives every axis in axis_values one; a scene passes its axes that are not channel axes.

None
initial_thickness Mapping[int, float] | None

Starting half-thicknesses; typically scene.dims.selection.thickness. An axis absent from it is 0.

None
throttle_ms int | None

The slider rate limit in milliseconds. While a slider is dragged, the new position is sent at most once per interval, and the last position is always sent when the drag stops. None (the default) is 50 ms, the same as AnywidgetDimsPanel.throttle_ms.

None
axes_2d tuple[int, ...] | None

Axis indices the toggle displays in 2D until the scene has shown a 2D set; after that it returns to the last 2D set shown. None omits the toggle button entirely (e.g. a scene with fewer than 3 axes).

None
axes_3d tuple[int, ...] | None

Axis indices the toggle displays in 3D until the scene has shown a 3D set; after that it returns to the last 3D set shown. None omits the toggle button entirely.

None
parent QWidget | None

Optional Qt parent widget for the internal container.

None

has_toggle property

has_toggle: bool

Whether this control offers a 2D/3D toggle.

Named to match AnywidgetDimsPanel.has_toggle so a caller can ask either front end the same question.

widget property

widget: QWidget

The Qt widget to insert into a layout.

Qt seam 1: replace with the backend element for other toolkits.

slider_axes property

slider_axes: tuple[int, ...] | None

The world axes that get a slider when not displayed.

None means every axis this control was built with.

current_index

current_index() -> dict[int, float]

Return the current world value of every slider regardless of visibility.

A discrete axis reports the world value at its slider position, not the position itself.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

A scope still open (a control closed mid-drag) is ended first.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return the inbound subscriptions this widget requires.

One for DimsChangedEvent and one for SliderAxesChangedEvent, both routed by the scene id.

Pass the result to CellierController.connect_widget.

Image

cellier.gui.qt.visuals.QtImageControls

Bases: VisualIdGroup

Bidirectional image appearance control on the cellier bus.

One control per image visual (or per group of OrthoViewer panel siblings). From the top:

  • a shared section: visibility, blending and interpolation;
  • a "Composite channels" switch, shown only when the visual has a channel axis;
  • one page per mode: the single appearance's rows, or, when compositing, one group of rows per channel.

Each page shows the rows its values ask for (colormap, contrast, opacity, render mode, ...). A row that only means something for some render modes, or only in 3D, hides itself; n_displayed_dimensions and scene_ids keep the 3D rule current. A MaskedImage adds its surface and 2D band rows to the single page.

Build the starting state with cellier.gui.image_control_values, then wire to the controller after construction:

values = image_control_values(visual, fields=["color_map", "clim"])
control = QtImageControls(visual.id, values, scene_ids=[scene.id])
controller.connect_widget(
    control, subscription_specs=control.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The visual, or an OrthoViewer's panel siblings, driven together.

required
values dict[str, Any]

The control's starting state: a dict of the visual's current appearance values, page by page ("shared", "single" and "channels"), the "fields" to show, and the widgets' ranges and choices. Its layout is internal. The convenience viewers build it when an ImageControl is in a visual's controls= list; code that builds this widget directly gets it from cellier.gui.image_control_values and passes it through unchanged.

required
title str | None

The group frame's title. Defaults to DEFAULT_TITLE.

None
n_displayed_dimensions int

How many dimensions the driven visuals' scenes display now, 2 or 3. Seeds the rows that are shown only in 3D. Default 3, which shows them.

3
scene_ids Sequence[UUID]

The scenes to follow: after construction the control takes n_displayed_dimensions from their DimsChangedEvent. The visuals are assumed to share one display dimensionality; if they do not, the last change wins.

()
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

widget property

widget

The titled group to insert into a layout.

composite property

composite: bool

Whether the control shows the composite page.

n_displayed_dimensions property writable

n_displayed_dimensions: int

How many dimensions the scene displays, as the rows assume (2 or 3).

Follows the scenes the control was given; setting it re-applies the rows until the next change on one of them.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list

One subscription per inbound event type per driven visual.

Plus one DimsChangedEvent subscription per followed scene.

Any visual

cellier.gui.qt.visuals.QtVisibleToggle

Bases: QtToggle

Show or hide the visual.

visible exists on every appearance model, so this control applies to every visual type.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual_model.appearance.visible. Defaults to True, matching the model default.

None
parent

Optional Qt parent widget.

None

cellier.gui.qt.visuals.QtOpacitySlider

Bases: QtBoundedSlider

Master opacity multiplier.

Applies to every visual type -- opacity is on BaseAppearance. It is also the only appearance field carrying ge/le, which is why it is the only bounded slider: the range is read off the model rather than picked.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.opacity.

None

cellier.gui.qt.visuals.QtUniformColorPicker

Bases: QtColorPicker

Uniform RGBA colour.

One class for mesh, points and lines: they spell the field color alike, so the control is shared rather than triplicated. Only used when the visual's color_mode is "uniform"; per-vertex colours come from the data store.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.color.

None

cellier.gui.qt.visuals.QtAABBWidget

Bases: VisualIdGroup

Bidirectional AABB parameter controls wired to the event bus.

Wraps three Qt sub-controls — a QCheckBox for enabled, a QDoubleSpinBox for line_width, and a color swatch + button for color — and keeps them in sync with AABBParams via AABBChangedEvent. Follows the bus-widget pattern: one UUID per widget, source-ID echo filtering, and signal blocking when applying model-driven updates.

Wire to the controller after construction:

aabb = QtAABBWidget(visual_id, initial_enabled=True, ...)
controller.connect_widget(aabb, subscription_specs=aabb.subscription_specs())

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual whose aabb params this widget controls. A sequence drives every listed visual in lock-step -- the OrthoViewer's four panel siblings.

required
initial_enabled bool

Starting value for the enabled checkbox.

False
initial_line_width float

Starting value for the line_width spinbox.

2.0
initial_color str

Starting CSS color string for the color swatch (e.g. "#ff00ff").

'#ffffff'
title str | None

The name shown on the group frame. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = 'Bounding box'

Name shown when no title= is given.

The same title the built-in viewers pass when they build this widget.

widget property

widget

The titled group to insert into a layout.

The rows inside only mean something together, so the group names them; reach for control for the bare rows.

control property

control

The bare row container inside the group.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return the inbound subscription this widget requires.

Pass the result to CellierController.connect_widget.

Planes

The data these are built from comes from the toolkit-neutral helpers.

cellier.gui.qt.visuals.QtClippingPlanesControls

Bases: VisualIdGroup

A visual's clipping planes: one row per plane, and an add button.

Each row has an enabled checkbox, a flip button, a remove button, the normal and a position slider along the normal. The normal has one column per data axis: two buttons named after the axis as the store's coordinate system gives it (+z and -z) that face the plane along the axis, and under them the normal's entry on it. Values are in the visual's data coordinates. Given gizmo_target, a row also has a "Gizmo" toggle that puts a gizmo on its plane in the 3D canvas; one plane of a canvas has it at a time. An edit is sent as ClippingPlanesUpdateEvent with the whole new tuple. A moved plane updates its row in place, so a slider is not destroyed while it is dragged.

Wire to the controller after construction:

data = get_clipping_planes_data_from_visual(visual, store)
controls = QtClippingPlanesControls(visual.id, **data)
controller.connect_widget(
    controls, subscription_specs=controls.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The visual, or a group of them (an OrthoViewer's panel siblings), edited together.

required
coordinate_system UUID | str

The level-0 data coordinate system of the store they read (its id).

required
axis_names Sequence[str]

The data axis names, in order.

required
bounds Sequence[Sequence[float]]

(low, high) of the data on each axis.

required
planes Sequence[Mapping[str, Any]]

One row per plane of visual.clipping_planes, in order: a dict with "id" (the plane's id as a string), "enabled", "normal" (a list of floats), "position" (the plane's offset divided by the normal's length) and "outline" (its outline settings).

()
data_store_id UUID | str | None

The store the visuals read.

None
bounds_source Callable[[], Sequence[Sequence[float]]] | None

Reads the store's current (low, high) per axis. Given with data_store_id, the position ranges follow the store's extent; without it they stay at bounds.

None
gizmo_target ClippingPlaneGizmoTarget | None

Where a plane's gizmo is drawn (a ClippingPlaneGizmoTarget), the plane that has it now, and why a plane cannot have one: get_clipping_plane_gizmo_data(controller, visual_id, canvas_id). The target's visual must be one of visual_id. Without gizmo_target the rows have no gizmo toggle.

None
gizmo_plane ClippingPlaneGizmoTarget | None

Where a plane's gizmo is drawn (a ClippingPlaneGizmoTarget), the plane that has it now, and why a plane cannot have one: get_clipping_plane_gizmo_data(controller, visual_id, canvas_id). The target's visual must be one of visual_id. Without gizmo_target the rows have no gizmo toggle.

None
gizmo_blocked ClippingPlaneGizmoTarget | None

Where a plane's gizmo is drawn (a ClippingPlaneGizmoTarget), the plane that has it now, and why a plane cannot have one: get_clipping_plane_gizmo_data(controller, visual_id, canvas_id). The target's visual must be one of visual_id. Without gizmo_target the rows have no gizmo toggle.

None
title str | None

The group's name. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = CLIPPING_PLANES_TITLE

Name shown when no title= is given.

widget property

widget

The widget to insert into a layout: the titled group.

planes property

planes: list[dict[str, Any]]

The rows as last reported by the model.

editor property

editor: ClippingPlanesEditor

The toolkit-neutral half (for tests and scripting).

error property

error: str

The reason the last edit was refused, or "".

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

One ClippingPlanesChangedEvent per visual, and the store's extent.

cellier.gui.qt.visuals.QtRenderPlanesControls

Bases: VisualIdGroup

A visual's render planes: one row per plane, and an add button.

The planes a visual in the "plane" render mode draws its data on. Each row is a "Clipping planes" row with the extents added: an enabled checkbox, a flip button, a remove button, the normal (two buttons and an entry per axis of the plane), a position slider along the normal, and for each of the plane's two in-plane axes a minimum and a maximum, each with an "inf" toggle that makes it unbounded. Values are in world units. Given gizmo_target, a row also has a "Gizmo" toggle that puts the canvas's gizmo on its plane; one plane of a canvas has it at a time, clipping planes included.

An edit is sent as RenderPlanesUpdateEvent with the whole new tuple. A moved plane updates its row in place, so a slider is not destroyed while it is dragged. A visual draws at most four planes: the add button is disabled at four. While the planes are not drawn (the visual is not in plane mode, or the view is 2D) the control is disabled and says why.

Wire to the controller after construction:

data = get_render_planes_data_from_visual(controller, visual.id)
controls = QtRenderPlanesControls(visual.id, **data)
controller.connect_widget(
    controls, subscription_specs=controls.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The visual, or a group of them, edited together.

required
coordinate_system UUID | str

The scene's world coordinate system (its id).

required
axis_ids Sequence[str]

The world axes, in order: their ids and names.

required
axis_names Sequence[str]

The world axes, in order: their ids and names.

required
planes Sequence[Any]

The visual's current render_planes.

()
displayed_axes Sequence[str] | None

What the scene and the visual's data are now, and a reader of it: get_render_planes_data_from_visual(controller, visual_id).

None
bounds Sequence[str] | None

What the scene and the visual's data are now, and a reader of it: get_render_planes_data_from_visual(controller, visual_id).

None
state_source Sequence[str] | None

What the scene and the visual's data are now, and a reader of it: get_render_planes_data_from_visual(controller, visual_id).

None
scene_id Sequence[str] | None

What the scene and the visual's data are now, and a reader of it: get_render_planes_data_from_visual(controller, visual_id).

None
data_store_id Sequence[str] | None

What the scene and the visual's data are now, and a reader of it: get_render_planes_data_from_visual(controller, visual_id).

None
gizmo_target RenderPlaneGizmoTarget | None

Where a plane's gizmo is drawn (a RenderPlaneGizmoTarget), the plane that has it now, and why a plane cannot have one: get_render_plane_gizmo_data(controller, visual_id, canvas_id). Without gizmo_target the rows have no gizmo toggle.

None
gizmo_plane RenderPlaneGizmoTarget | None

Where a plane's gizmo is drawn (a RenderPlaneGizmoTarget), the plane that has it now, and why a plane cannot have one: get_render_plane_gizmo_data(controller, visual_id, canvas_id). Without gizmo_target the rows have no gizmo toggle.

None
gizmo_blocked RenderPlaneGizmoTarget | None

Where a plane's gizmo is drawn (a RenderPlaneGizmoTarget), the plane that has it now, and why a plane cannot have one: get_render_plane_gizmo_data(controller, visual_id, canvas_id). Without gizmo_target the rows have no gizmo toggle.

None
title str | None

The group's name. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = RENDER_PLANES_TITLE

Name shown when no title= is given.

widget property

widget

The widget to insert into a layout: the titled group.

planes property

planes: list[dict[str, Any]]

The rows as last reported by the model.

editor property

editor: RenderPlanesEditor

The toolkit-neutral half (for tests and scripting).

error property

error: str

The reason the last edit was refused, or "".

blocked property

blocked: str

Why the control is disabled now, or "".

refresh

refresh() -> None

Read the scene's state again (whether the control is disabled).

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

What the control follows on the bus (see the editor).

Level of detail and loading

cellier.gui.qt.visuals.QtLevelOfDetailControls

Bases: VisualIdGroup

Settled bias slider and "coarsest while moving" checkbox.

Drives settled_lod_bias, coarsest_while_moving_3d and coarsest_while_moving_2d on a multiscale image or labels appearance. The checkbox shows and edits the setting of the view the control is in: the 3D one while n_displayed_dimensions is 3, the 2D one otherwise.

Changing settled_lod_bias reslices, so its AppearanceUpdateEvent is emitted when the slider is released, not on every tick.

Wire to the controller after construction:

control = QtLevelOfDetailControls(visual_id, values)
controller.connect_widget(
    control, subscription_specs=control.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The visual the control drives. A sequence drives every listed visual in lock-step (the OrthoViewer's panel siblings).

required
values Mapping[str, Any] | None

The appearance's current values, keyed by field name: settled_lod_bias (float), coarsest_while_moving_3d and coarsest_while_moving_2d (bool), and has_moving_3d: False for an appearance without the 3D setting, which hides that checkbox in 3D. Missing keys take the model's defaults.

None
n_displayed_dimensions int

What the view displays now, 2 or 3.

3
scene_ids Sequence[UUID]

Scenes whose DimsChangedEvent the control follows to keep n_displayed_dimensions current.

()
lod_range tuple[float, float]

(min, max) of the slider.

SETTLED_BIAS_RANGE
decimals int

Decimal places shown beside the slider.

2
title str | None

The group's name. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

widget property

widget

The titled group to insert into a layout.

control property

control

The bare row container inside the group.

n_displayed_dimensions property writable

n_displayed_dimensions: int

What the view displays, 2 or 3; picks the checkbox's field.

moving_field property

moving_field: str

The appearance field the checkbox edits now.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

One appearance subscription per visual, one dims one per scene.

cellier.gui.qt.visuals.QtLoadingIndicator

Bases: VisualIdGroup

How far a multiscale visual's data has loaded.

A bar of target chunks resident over needed, and a status line: the coarse overview (the backstop) first, then the detail, then "Loaded". Both sit in a group titled DEFAULT_TITLE, like the image and bounding-box controls. Read-only: it listens to ResliceProgressEvent and emits nothing.

Wire to the controller after construction:

indicator = QtLoadingIndicator(
    visual_id, initial={visual_id: controller.loading_progress(visual_id)}
)
controller.connect_widget(
    indicator, subscription_specs=indicator.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The visual, or a group of them (an OrthoViewer's panel siblings), shown summed.

required
initial Mapping[UUID, LoadingProgress | None] | None

Their progress now, so an indicator built mid-load starts right.

None
levels bool

The visuals are meshes: the status line names levels ("Loading coarse level"), not chunk counts.

False
title str | None

The group's title. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = LOADING_TITLE

Name shown when no title= is given.

widget property

widget

The titled group to insert into a layout.

state property

state: IndicatorState

What the indicator shows now.

text property

text: str

The status line as drawn.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

One ResliceProgressEvent subscription per visual.

cellier.gui.qt.visuals.QtLoadingConfigControls

Bases: VisualIdGroup

Every ProgressiveLoadingConfig field of a multiscale visual.

One row per field: the backstop's level ("coarsest" for None), its extent and its slot cap. An edit is sent as LoadingConfigUpdateEvent and applied at once. An invalid value is refused by the controller: the rows show the settings again and the reason below them; nothing is corrected.

Wire to the controller after construction:

controls = QtLoadingConfigControls(visual_id, loading=config.model_dump())
controller.connect_widget(
    controls, subscription_specs=controls.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The visual, or a group of them (an OrthoViewer's panel siblings), edited together.

required
loading Mapping[str, Any]

The current config, as ProgressiveLoadingConfig.model_dump().

required
n_levels int | None

The visual's level count, the most "Backstop level" offers.

None
title str | None

The group's name. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = LOADING_CONFIG_TITLE

Name shown when no title= is given.

widget property

widget

The titled group to insert into a layout.

config property

config: dict[str, Any]

The settings as last reported by the model.

error property

error: str

The reason the last edit was refused, or "".

input

input(field: str)

The control for one field (for tests and scripting).

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

One LoadingConfigChangedEvent subscription per visual.

cellier.gui.qt.visuals.QtLodConfigControls

Bases: VisualIdGroup

The level-of-detail settings of a multiscale mesh.

One row per GeometryLodConfig setting: what a dims scrub loads, what it draws for a mesh it does not change, and what a moving camera draws in a 3D view. Each is coarse or full. An edit is sent as LodConfigUpdateEvent and applies in the next frame; nothing is read.

Wire to the controller after construction:

controls = QtLodConfigControls(visual.id, lod=visual.lod.model_dump())
controller.connect_widget(
    controls, subscription_specs=controls.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The visual, or a group of them (an OrthoViewer's panel siblings), edited together.

required
lod Mapping[str, Any]

The current config, as GeometryLodConfig.model_dump().

required
title str | None

The group's name. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = LOD_CONFIG_TITLE

Name shown when no title= is given.

widget property

widget

The titled group to insert into a layout.

config property

config: dict[str, Any]

The settings as last reported by the model.

error property

error: str

The reason the last edit was refused, or "".

input

input(field: str)

The control for one field (for tests and scripting).

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

One LodConfigChangedEvent subscription per visual.

Labels

cellier.gui.qt.visuals.QtLabelsRenderModeCombo

Bases: QtChoice

How label voxels are rendered in 3D.

Offers the five labels render modes: iso_categorical, flat_categorical, smooth_iso, smooth_geometry and plane. The in-memory and multiscale labels models both accept all five. Distinct from the image render-mode control, whose modes differ.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.render_mode.

None

cellier.gui.qt.visuals.QtBackgroundLabelSpin

Bases: QtIntSpin

Label id rendered as transparent.

The range spans the label dtype: stores are int32 and nothing forbids a negative id.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.background_label.

None

cellier.gui.qt.visuals.QtSaltSpin

Bases: QtIntSpin

Hash seed for the random label colormap.

The number itself is meaningless -- only the colouring it produces matters -- so this control carries a shuffle button that writes a random seed in range.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.salt.

None

cellier.gui.qt.visuals.QtSmoothGeometryLevelSlider

Bases: QtBoundedSlider

Where the smooth_geometry surface sits.

The share of the blended weight a label must carry. Lower grows every label, higher shrinks it; 0.5 puts flat sides on the voxel faces. No effect in the other render modes.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.smooth_geometry_level.

None

Points

cellier.gui.qt.visuals.QtSizeSpin

Bases: QtFloatSpin

Uniform point size, in size_space units.

The default range is in screen pixels. With size_space="world" the useful range depends on the data extent, and value_range= is the escape hatch.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.size.

None

cellier.gui.qt.visuals.QtSizeSpaceCombo

Bases: QtChoice

Coordinate space point size is interpreted in.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.size_space.

None

Lines

cellier.gui.qt.visuals.QtThicknessSpin

Bases: QtFloatSpin

Line thickness, in thickness_space units.

Screen pixels by default; see *SizeSpin for the world case.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.thickness.

None

cellier.gui.qt.visuals.QtThicknessSpaceCombo

Bases: QtChoice

Coordinate space line thickness is interpreted in.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.thickness_space.

None

Meshes

cellier.gui.qt.visuals.QtMeshSectionControls

Bases: VisualIdGroup

How a mesh is drawn in a 2D view: every MeshSectionConfig field.

One row per field: the outline on or off, the fill on or off, the outline's width in screen pixels, and whether the cut is the slice plane (cut) or the scene's slab (slab). An edit is sent as MeshSectionUpdateEvent. Turning a part on or off, or changing the mode, reads the mesh again; the width applies at once.

The settings act only in a 2D view, so the group is hidden while none of the scenes in displayed_dimensions displays two dimensions.

Wire to the controller after construction:

controls = QtMeshSectionControls(visual.id, section=visual.section.model_dump())
controller.connect_widget(
    controls, subscription_specs=controls.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The mesh visual, or a group of them (an OrthoViewer's panel siblings), edited together.

required
section Mapping[str, Any]

The current config, as MeshSectionConfig.model_dump().

required
title str | None

The group's name. Defaults to DEFAULT_TITLE.

None
displayed_dimensions Mapping[UUID, int] | None

Scene id to how many dimensions it displays now (2 or 3, from len(scene.dims.selection.displayed_axes) of each scene the visuals are in). The control follows these scenes' DimsChangedEvent. Empty (the default) keeps it always shown.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = MESH_SECTION_TITLE

Name shown when no title= is given.

widget property

widget

The widget to insert into a layout: it holds the titled group.

shown property

shown: bool

Whether the group is shown: a followed scene displays 2D.

config property

config: dict[str, Any]

The settings as last reported by the model.

error property

error: str

The reason the last edit was refused, or "".

input

input(field: str)

The control for one field (for tests and scripting).

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

One MeshSectionChangedEvent per visual, one dims per scene.

cellier.gui.qt.visuals.QtFlatShadingToggle

Bases: QtToggle

Use face normals instead of smooth vertex normals. Phong meshes.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.flat_shading.

None

cellier.gui.qt.visuals.QtShininessSpin

Bases: QtFloatSpin

Phong specular exponent. Phong meshes.

128 is the conventional practical ceiling.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.shininess.

None

cellier.gui.qt.visuals.QtSideCombo

Bases: QtChoice

Which face windings are drawn.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.side.

None

cellier.gui.qt.visuals.QtWireframeToggle

Bases: QtToggle

Draw the mesh as edges only. Flat meshes.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.wireframe.

None

cellier.gui.qt.visuals.QtWireframeThicknessSpin

Bases: QtFloatSpin

Edge thickness of the mesh wireframe, in screen pixels.

Below 0.1 the wireframe is invisible; above roughly 20 it swamps the mesh.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.wireframe_thickness.

None

Graphs

cellier.gui.qt.visuals.QtNodeVisibleToggle

Bases: QtToggle

Show the node sub-visual. Nests under visible.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.node_visible.

None

cellier.gui.qt.visuals.QtNodeColorPicker

Bases: QtColorPicker

Uniform RGBA node colour.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.node_color.

None

cellier.gui.qt.visuals.QtNodeSizeSpin

Bases: QtFloatSpin

Uniform node size, in node_size_space units.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.node_size.

None

cellier.gui.qt.visuals.QtNodeSizeSpaceCombo

Bases: QtChoice

Coordinate space node size is interpreted in.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.node_size_space.

None

cellier.gui.qt.visuals.QtEdgeVisibleToggle

Bases: QtToggle

Show the edge sub-visual. Nests under visible.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.edge_visible.

None

cellier.gui.qt.visuals.QtEdgeColorPicker

Bases: QtColorPicker

Uniform RGBA edge colour.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.edge_color.

None

cellier.gui.qt.visuals.QtEdgeThicknessSpin

Bases: QtFloatSpin

Edge thickness, in edge_thickness_space units.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.edge_thickness.

None

cellier.gui.qt.visuals.QtEdgeThicknessSpaceCombo

Bases: QtChoice

Coordinate space edge thickness is interpreted in.

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically visual.appearance.edge_thickness_space.

None

cellier.gui.qt.visuals.QtTrailControls

Bases: VisualIdGroup

Trail-window controls for one or more data axes of a graph visual.

Each offered axis gets a block of four controls: whether the axis has a window at all, how far it reaches before and after the slice position, and whether it fades. Switching an axis off removes its window from GraphVisual.trail; switching it back on restores the window it had.

Wire to the controller after construction:

trail = QtTrailControls(visual_id, [(0, "t")], visual.trail)
controller.connect_widget(trail, subscription_specs=trail.subscription_specs())

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

The graph visual whose trail this widget controls. A sequence drives every listed visual in lock-step, as on an OrthoViewer.

required
axes Sequence[tuple[int, str]]

(data-axis index, label) for each axis to offer, in display order.

required
trail Mapping[int, TrailConfig]

The visual's current {axis: TrailConfig}. Read, never held.

required
title str | None

The name shown on the group frame. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = TRAIL_TITLE

Name shown when no title= is given.

The same title the built-in viewers pass when they build this widget.

widget property

widget

The titled group to insert into a layout.

control property

control

The bare container inside the group.

offered_axes property

offered_axes: tuple[int, ...]

The data axes this widget offers, in display order.

Named to match AnywidgetTrailControls, whose axes is a synced trait describing the same thing for the browser.

is_enabled

is_enabled(axis: int) -> bool

Whether axis currently has a window.

window

window(axis: int) -> TrailConfig

The window axis has, or last had before it was switched off.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

One TrailChangedEvent subscription per driven visual.

Render settings

One panel per section of the canvas render config: ambient occlusion, outlines and temporal accumulation.

cellier.gui.qt.QtRenderConfigPanel

Base for a Qt panel driving one section of the render config.

Subclasses set section and build their controls in _build, registering each one with _register so the inbound handler can push a change back into it.

Wire to the controller after construction:

panel = QtAmbientOcclusionControls(controller.render_config.ambient_occlusion)
controller.connect_widget(panel, subscription_specs=panel.subscription_specs())

Parameters:

Name Type Description Default
parent

Optional Qt parent widget.

None

widget property

widget

The Qt widget to embed in a layout -- the panel inside its own title.

The bare content is content, for a caller that wants to place the rows itself.

content property

content

The untitled container holding the panel's rows.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Subscribe to every render-config change; filter by section here.

entity_id is deliberately None: there is no UUID a render config change could be keyed by.

refresh_readouts

refresh_readouts() -> None

Re-read any derived values this panel displays.

Derived state -- the effective occlusion radius, the accumulated frame count -- changes without any field changing, so nothing on the bus announces it. A host that wants those labels live calls this on a timer; they are correct at construction either way.

cellier.gui.qt.QtAmbientOcclusionControls

Bases: QtRenderConfigPanel

Ambient occlusion settings on the cellier bus.

Ambient occlusion darkens creases by sampling the depth buffer, and is the cheapest shape cue available for cellier's default unlit isosurfaces. Two states this panel reports but does not control:

  • The pass is off in 2D, whatever enabled says -- a 2D cellier scene is a plane at near-constant depth, where the occlusion comes out uniform.
  • The radius may be auto-derived. A fixed default is meaningless across cellier's coordinate systems, so the default is a fraction of the scene bounding box diagonal. The effective-radius readout is what makes the number comparable to the thing being rendered, which is the whole difficulty with this control.

Parameters:

Name Type Description Default
config AmbientOcclusionConfig

The live AmbientOcclusionConfig to read initial values from -- typically controller.render_config.ambient_occlusion.

required
effective_radius Callable[[], float | None] | None

Called to read the radius actually in use, in scene units, for the readout. Typically lambda: controller.ambient_occlusion_effective_radius. None omits the readout.

None
parent

Optional Qt parent widget.

None

widget property

widget

The Qt widget to embed in a layout -- the panel inside its own title.

The bare content is content, for a caller that wants to place the rows itself.

content property

content

The untitled container holding the panel's rows.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Subscribe to every render-config change; filter by section here.

entity_id is deliberately None: there is no UUID a render config change could be keyed by.

refresh_readouts

refresh_readouts() -> None

Re-read any derived values this panel displays.

Derived state -- the effective occlusion radius, the accumulated frame count -- changes without any field changing, so nothing on the bus announces it. A host that wants those labels live calls this on a timer; they are correct at construction either way.

cellier.gui.qt.QtOutlineControls

Bases: QtRenderConfigPanel

Screen-space outline settings on the cellier bus.

Two layers run in the same fragment invocation and can both be active: boundaries draws every outlined region, selection draws only the regions carrying a palette slot.

Every control here comes from one spec shared with the notebook panel (AnywidgetOutlineControls) -- including the absence of a colour control on the selection layer, whose colour comes from the palette slot rather than from its own field.

Which visuals are outlined, and in which slot, is a per-visual setting rather than a render-config one; see CellierController.set_visual_outline and set_label_selection.

Parameters:

Name Type Description Default
config OutlineConfig

The live OutlineConfig to read initial values from -- typically controller.render_config.outline.

required
parent

Optional Qt parent widget.

None
slot_usage

Zero-argument callable returning {slot: how many visuals use it}, annotating the palette swatches. Derived state -- a visual moving between slots changes it with no config field changing -- so it is a callable rather than a value. None draws no annotation.

None

widget property

widget

The Qt widget to embed in a layout -- the panel inside its own title.

The bare content is content, for a caller that wants to place the rows itself.

content property

content

The untitled container holding the panel's rows.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Subscribe to every render-config change; filter by section here.

entity_id is deliberately None: there is no UUID a render config change could be keyed by.

refresh_readouts

refresh_readouts() -> None

Re-read any derived values this panel displays.

Derived state -- the effective occlusion radius, the accumulated frame count -- changes without any field changing, so nothing on the bus announces it. A host that wants those labels live calls this on a timer; they are correct at construction either way.

cellier.gui.qt.QtTemporalControls

Bases: QtRenderConfigPanel

Temporal accumulation settings on the cellier bus.

The pass blends successive frames with an exponential moving average. Because the volume raymarcher and the occlusion kernel both jitter per frame, that average is what lets them use few samples per frame and still settle to a clean image once the camera stops -- it is why the occlusion sample count can default to 16 rather than 64.

This is the one feature whose entire behaviour is invisible unless you know to hold the camera still and count, so the panel carries a convergence readout as well as its two settings. The pass is off in 2D whatever enabled says.

Parameters:

Name Type Description Default
config TemporalAccumulationConfig

The live TemporalAccumulationConfig to read initial values from -- typically controller.render_config.temporal.

required
frame_count Callable[[], int | None] | None

Called to read how many frames have accumulated on the least-converged canvas, for the readout. Typically lambda: controller.render_manager.temporal_frame_count. None omits the readout.

None
on_reset Callable[[], None] | None

Called when the user asks to discard the accumulated history. Typically controller.reset_temporal_accumulation. None omits the button. This is an action rather than a setting, so it does not travel on the bus.

None
parent

Optional Qt parent widget.

None

widget property

widget

The Qt widget to embed in a layout -- the panel inside its own title.

The bare content is content, for a caller that wants to place the rows itself.

content property

content

The untitled container holding the panel's rows.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Subscribe to every render-config change; filter by section here.

entity_id is deliberately None: there is no UUID a render config change could be keyed by.

refresh_readouts

refresh_readouts() -> None

Re-read any derived values this panel displays.

Derived state -- the effective occlusion radius, the accumulated frame count -- changes without any field changing, so nothing on the bus announces it. A host that wants those labels live calls this on a timer; they are correct at construction either way.

Dataset info

What it shows comes from dataset_info_from_path or a store's dataset_info().

cellier.gui.qt.QtDatasetInfo

Read-only display widget for dataset metadata.

Shows (label, value) rows inside a superqt.QCollapsible, the Qt idiom for the anywidget front end's <details> block. Built from rows for the general case, or from a DatasetInfo via from_info for the sectioned description a data store returns from its dataset_info(), which adds nested blocks and matrix tables.

Uses qtpy for PyQt6/PySide6 compatibility. Follows the widget pattern: a non-QWidget class exposing a .widget property. It is a pure-output control with nothing on the bus, so it carries no changed/closed signals and is never passed to connect_widget.

Parameters:

Name Type Description Default
rows Sequence[tuple[str, str]]

(label, value) pairs to display, in order. Both halves are coerced to str.

()
title str | None

The name shown on the collapsible header. Defaults to DEFAULT_TITLE.

None
parent

Optional Qt parent widget.

None

DEFAULT_TITLE class-attribute instance-attribute

DEFAULT_TITLE = 'Dataset info'

Name shown when no title= is given.

The same title the built-in viewers pass when they build this widget.

widget property

widget

The QCollapsible widget to insert into a layout.

Qt seam 1: replace with the backend element for other toolkits.

section_labels

section_labels() -> list[str]

The sections drawn, in the order they are drawn.

The twin of reading AnywidgetDatasetInfo.sections. Both exist so the two front ends can be asserted to draw one DatasetInfo the same way, which is not otherwise checkable through a widget tree.

An unlabelled section is named by its first row's label, matching what a reader actually sees at the top of the block.

from_info classmethod

from_info(info: DatasetInfo, *, title: str | None = None, parent=None) -> QtDatasetInfo

Build from a sectioned DatasetInfo.

Draws each section in the shape it declares: inline rows, a nested collapsible, or a matrix table. Anything a store can say about itself is one of those three, so a new store type needs no change here.

from_path classmethod

from_path(zarr_path: str, *, multiscale_index: int = 0, series_index: int = 0, title: str | None = None, parent=None) -> QtDatasetInfo

Construct directly from an OME-Zarr URI.

Parameters:

Name Type Description Default
zarr_path str

Root URI, e.g. "file:///data/image.ome.zarr" or "s3://bucket/image.ome.zarr".

required
multiscale_index int

Which multiscales[] entry to display. Defaults to 0.

0
series_index int

For Bf2Raw containers, which series to display. Defaults to 0.

0
title str | None

The name shown on the collapsible header.

None
parent

Optional Qt parent widget.

None

from_store classmethod

from_store(store, *, title: str | None = None, parent=None) -> QtDatasetInfo

Construct from any data store, by asking it to describe itself.

The general entry point: every BaseDataStore implements dataset_info(), so this works for points and graphs as much as for an OME-Zarr pyramid.

Building blocks

The generic controls the widgets above are made from: each drives one appearance field of a type (boolean, choice, number, colour) on one or more visuals. Use them for a field that has no named widget.

cellier.gui.qt.visuals.QtAppearanceField

Bidirectional control for one appearance field on one or more visuals.

Subclasses bind _field and _label and implement the three-method seam. Everything else -- the widget UUID, the changed / closed signals, the subscriptions, the source_id echo filter, the re-entrancy guard, and building the outgoing AppearanceUpdateEvent -- lives here.

visual_id accepts a single UUID or a sequence of them. With a sequence the widget drives the whole group in lock-step: it returns one subscription per id and emits one update event per id, which is the pattern the per-channel list established for the OrthoViewer's four sibling visuals.

Wire to the controller after construction:

toggle = QtVisibleToggle(visual_id, initial_value=True)
controller.connect_widget(
    toggle, subscription_specs=toggle.subscription_specs()
)

Parameters:

Name Type Description Default
visual_id UUID | Sequence[UUID]

UUID of the visual whose field this widget controls, or a sequence of UUIDs to drive as one group.

required
initial_value Any

Starting value -- typically read off the visual's appearance model. None (the default) starts the control at its type's default (_default_value).

None
parent

Optional Qt parent widget.

None

widget property

widget

The labelled row to insert into a layout.

This is the whole control, name included -- what a caller wants in every case except reaching for the input itself, which is control.

control property

control

The bare input inside the row -- the checkbox, slider or combo.

For tests and for callers driving the input directly.

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

field property

field: str

The appearance field name this widget writes.

value property writable

value: Any

The control's current value.

A property, not a method, so it reads the same on both toolkits: the anywidget twin spells this as a synced trait, and code that had to ask which front end it was holding could not be written against either.

Assigning to it behaves like a user edit -- the control moves and the change reaches the bus -- which is also what assigning to the anywidget trait does. Changes arriving from the bus move the control without emitting.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return one inbound subscription per visual id (subscribe-to-all).

Subscribing to every id rather than only the first means the widget stays correct when a sibling is written by something other than this widget.

cellier.gui.qt.visuals.QtToggle

Bases: QtAppearanceField

Layer 2: a QCheckBox for a boolean appearance field.

widget property

widget

The labelled row to insert into a layout.

This is the whole control, name included -- what a caller wants in every case except reaching for the input itself, which is control.

control property

control

The bare input inside the row -- the checkbox, slider or combo.

For tests and for callers driving the input directly.

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

field property

field: str

The appearance field name this widget writes.

value property writable

value: Any

The control's current value.

A property, not a method, so it reads the same on both toolkits: the anywidget twin spells this as a synced trait, and code that had to ask which front end it was holding could not be written against either.

Assigning to it behaves like a user edit -- the control moves and the change reaches the bus -- which is also what assigning to the anywidget trait does. Changes arriving from the bus move the control without emitting.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return one inbound subscription per visual id (subscribe-to-all).

Subscribing to every id rather than only the first means the widget stays correct when a sibling is written by something other than this widget.

cellier.gui.qt.visuals.QtChoice

Bases: QtAppearanceField

Layer 2: a combo box for a Literal field.

Each subclass writes its options out in _default_choices; a test checks every list against its model's Literal so the two cannot drift. choices= replaces the list for one widget.

widget property

widget

The labelled row to insert into a layout.

This is the whole control, name included -- what a caller wants in every case except reaching for the input itself, which is control.

control property

control

The bare input inside the row -- the checkbox, slider or combo.

For tests and for callers driving the input directly.

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

field property

field: str

The appearance field name this widget writes.

value property writable

value: Any

The control's current value.

A property, not a method, so it reads the same on both toolkits: the anywidget twin spells this as a synced trait, and code that had to ask which front end it was holding could not be written against either.

Assigning to it behaves like a user edit -- the control moves and the change reaches the bus -- which is also what assigning to the anywidget trait does. Changes arriving from the bus move the control without emitting.

choices property

choices: tuple[str, ...]

The options offered, in model order.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return one inbound subscription per visual id (subscribe-to-all).

Subscribing to every id rather than only the first means the widget stays correct when a sibling is written by something other than this widget.

cellier.gui.qt.visuals.QtFloatSpin

Bases: QtAppearanceField

Layer 2: a spin box for an unbounded float field.

Only opacity carries ge/le; every other float on the seven non-image appearance models is unconstrained, so the range here is a widget bound someone picked rather than a model constraint. Layer 3 binds a sensible default per field and every one is overridable at construction -- which is the escape hatch for the four *_space fields whose "world" setting makes screen-pixel bounds meaningless.

widget property

widget

The labelled row to insert into a layout.

This is the whole control, name included -- what a caller wants in every case except reaching for the input itself, which is control.

control property

control

The bare input inside the row -- the checkbox, slider or combo.

For tests and for callers driving the input directly.

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

field property

field: str

The appearance field name this widget writes.

value property writable

value: Any

The control's current value.

A property, not a method, so it reads the same on both toolkits: the anywidget twin spells this as a synced trait, and code that had to ask which front end it was holding could not be written against either.

Assigning to it behaves like a user edit -- the control moves and the change reaches the bus -- which is also what assigning to the anywidget trait does. Changes arriving from the bus move the control without emitting.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return one inbound subscription per visual id (subscribe-to-all).

Subscribing to every id rather than only the first means the widget stays correct when a sibling is written by something other than this widget.

cellier.gui.qt.visuals.QtIntSpin

Bases: QtAppearanceField

Layer 2: a spin box for an integer field.

_shuffle adds a button writing a random value in range, for fields where the number is meaningless and only the resulting difference matters -- the labels colormap salt.

widget property

widget

The labelled row to insert into a layout.

This is the whole control, name included -- what a caller wants in every case except reaching for the input itself, which is control.

control property

control

The bare input inside the row -- the checkbox, slider or combo.

For tests and for callers driving the input directly.

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

field property

field: str

The appearance field name this widget writes.

value property writable

value: Any

The control's current value.

A property, not a method, so it reads the same on both toolkits: the anywidget twin spells this as a synced trait, and code that had to ask which front end it was holding could not be written against either.

Assigning to it behaves like a user edit -- the control moves and the change reaches the bus -- which is also what assigning to the anywidget trait does. Changes arriving from the bus move the control without emitting.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return one inbound subscription per visual id (subscribe-to-all).

Subscribing to every id rather than only the first means the widget stays correct when a sibling is written by something other than this widget.

cellier.gui.qt.visuals.QtBoundedSlider

Bases: QtAppearanceField

Layer 2: a labelled slider for a float field the model bounds.

The range comes from the field's ge/le metadata and there is deliberately no keyword to widen it: a wider slider would build a control that emits values pydantic then rejects. Layer 3 binds _default_range by reading those bounds off the model, so the two cannot drift.

One documented exception: QtIsoThresholdSlider. iso_threshold carries no ge/le -- a threshold is bounded relative to the data's intensity range, not absolutely -- so its (0.0, 1.0) is a convention for the normalised images cellier renders, stated rather than derived.

widget property

widget

The labelled row to insert into a layout.

This is the whole control, name included -- what a caller wants in every case except reaching for the input itself, which is control.

control property

control

The bare input inside the row -- the checkbox, slider or combo.

For tests and for callers driving the input directly.

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

field property

field: str

The appearance field name this widget writes.

value property writable

value: Any

The control's current value.

A property, not a method, so it reads the same on both toolkits: the anywidget twin spells this as a synced trait, and code that had to ask which front end it was holding could not be written against either.

Assigning to it behaves like a user edit -- the control moves and the change reaches the bus -- which is also what assigning to the anywidget trait does. Changes arriving from the bus move the control without emitting.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return one inbound subscription per visual id (subscribe-to-all).

Subscribing to every id rather than only the first means the widget stays correct when a sibling is written by something other than this widget.

cellier.gui.qt.visuals.QtColorPicker

Bases: QtAppearanceField

Layer 2: an RGB swatch plus a separate alpha slider.

Every appearance color field is float RGBA, and both toolkits' colour inputs are RGB-only, so alpha needs its own control and the float-RGBA to hex conversion has to happen somewhere. Written once here rather than per field class.

widget property

widget

The labelled row to insert into a layout.

This is the whole control, name included -- what a caller wants in every case except reaching for the input itself, which is control.

control property

control

The bare input inside the row -- the checkbox, slider or combo.

For tests and for callers driving the input directly.

visual_ids property

visual_ids: tuple[UUID, ...]

The visual ids this widget drives, always as a tuple.

field property

field: str

The appearance field name this widget writes.

value property writable

value: Any

The control's current value.

A property, not a method, so it reads the same on both toolkits: the anywidget twin spells this as a synced trait, and code that had to ask which front end it was holding could not be written against either.

Assigning to it behaves like a user edit -- the control moves and the change reaches the bus -- which is also what assigning to the anywidget trait does. Changes arriving from the bus move the control without emitting.

close

close() -> None

Emit closed to trigger bus unsubscription via the controller.

subscription_specs

subscription_specs() -> list[SubscriptionSpec]

Return one inbound subscription per visual id (subscribe-to-all).

Subscribing to every id rather than only the first means the widget stays correct when a sibling is written by something other than this widget.

cellier.gui.qt.visuals.labelled_row

labelled_row(label_text: str, control, parent=None)

Return a <label> <control> row naming control as label_text.

Parameters:

Name Type Description Default
label_text str

The control's name, e.g. "Wireframe thickness".

required
control

The Qt widget to name. It is reparented into the row.

required
parent

Optional Qt parent for the row.

None

Returns:

Type Description
QWidget

The row, with objectName "cellier-app-row" (for styling).

cellier.gui.qt.visuals.titled_group

titled_group(title: str, content, parent=None)

Return a QGroupBox titled title wrapping content.

For a widget whose rows only mean something together -- Show / Width / Color is three anonymous rows until a frame says "Bounding box". A single control should use labelled_row instead.

Parameters:

Name Type Description Default
title str

The group's name, e.g. "Bounding box".

required
content

The Qt widget holding the rows. It is reparented into the group.

required
parent

Optional Qt parent for the group.

None

Returns:

Type Description
QGroupBox