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 |
required | |
dims_control
|
QtDimsControl
|
An already-constructed |
required |
parent
|
QWidget | None
|
Optional Qt parent widget. |
None
|
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 |
required | |
canvas_view
|
The |
required | |
axis_values
|
Mapping[int, AxisValues]
|
Mapping of axis index to that axis's slider values, e.g.
|
required |
parent
|
QWidget | None
|
Optional Qt parent widget. |
None
|
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
DimsChangedEventviacontroller.connect_widget. - Echo-filters its own changes using
source_id. - Suppresses re-entrant slider signals with
blockSignalswhen 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 |
required |
axis_labels
|
dict[int, str]
|
Mapping of axis index to display label, e.g. |
required |
initial_slice_indices
|
dict[int, float] | None
|
Starting slider values; typically |
None
|
initial_displayed_axes
|
tuple[int, ...]
|
Axes to hide initially; typically |
()
|
slider_axes
|
tuple[int, ...] | None
|
The world axes that get a slider when not displayed; typically
|
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
|
initial_thickness
|
Mapping[int, float] | None
|
Starting half-thicknesses; typically
|
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
|
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
|
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
|
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
¶
The Qt widget to insert into a layout.
Qt seam 1: replace with the backend element for other toolkits.
slider_axes
property
¶
The world axes that get a slider when not displayed.
None means every axis this control was built with.
current_index ¶
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 ¶
Emit closed to trigger bus unsubscription via the controller.
A scope still open (a control closed mid-drag) is ended first.
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 |
required |
values
|
dict[str, Any]
|
The control's starting state: a dict of the visual's current
appearance values, page by page ( |
required |
title
|
str | None
|
The group frame's title. Defaults to |
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
|
()
|
parent
|
Optional Qt parent widget. |
None
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
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 |
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 |
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 |
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 |
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. |
'#ffffff'
|
title
|
str | None
|
The name shown on the group frame. Defaults to
|
None
|
parent
|
Optional Qt parent widget. |
None
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
The same title the built-in viewers pass when they build this widget.
widget
property
¶
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.
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 |
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]]
|
|
required |
planes
|
Sequence[Mapping[str, Any]]
|
One row per plane of |
()
|
data_store_id
|
UUID | str | None
|
The store the visuals read. |
None
|
bounds_source
|
Callable[[], Sequence[Sequence[float]]] | None
|
Reads the store's current |
None
|
gizmo_target
|
ClippingPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
gizmo_plane
|
ClippingPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
gizmo_blocked
|
ClippingPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
title
|
str | None
|
The group's name. Defaults to |
None
|
parent
|
Optional Qt parent widget. |
None
|
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 |
()
|
displayed_axes
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
bounds
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
state_source
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
scene_id
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
data_store_id
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
gizmo_target
|
RenderPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
gizmo_plane
|
RenderPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
gizmo_blocked
|
RenderPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
title
|
str | None
|
The group's name. Defaults to |
None
|
parent
|
Optional Qt parent widget. |
None
|
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 |
required |
values
|
Mapping[str, Any] | None
|
The appearance's current values, keyed by field name:
|
None
|
n_displayed_dimensions
|
int
|
What the view displays now, 2 or 3. |
3
|
scene_ids
|
Sequence[UUID]
|
Scenes whose |
()
|
lod_range
|
tuple[float, float]
|
|
SETTLED_BIAS_RANGE
|
decimals
|
int
|
Decimal places shown beside the slider. |
2
|
title
|
str | None
|
The group's name. Defaults to |
None
|
parent
|
Optional Qt parent widget. |
None
|
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 |
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 |
None
|
parent
|
Optional Qt parent widget. |
None
|
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 |
required |
loading
|
Mapping[str, Any]
|
The current config, as |
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 |
None
|
parent
|
Optional Qt parent widget. |
None
|
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 |
required |
lod
|
Mapping[str, Any]
|
The current config, as |
required |
title
|
str | None
|
The group's name. Defaults to |
None
|
parent
|
Optional Qt parent widget. |
None
|
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 |
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 |
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 |
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
|
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 |
None
|
cellier.gui.qt.visuals.QtSizeSpaceCombo ¶
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 |
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 |
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 |
required |
section
|
Mapping[str, Any]
|
The current config, as |
required |
title
|
str | None
|
The group's name. Defaults to |
None
|
displayed_dimensions
|
Mapping[UUID, int] | None
|
Scene id to how many dimensions it displays now (2 or 3, from
|
None
|
parent
|
Optional Qt parent widget. |
None
|
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 |
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 |
None
|
cellier.gui.qt.visuals.QtSideCombo ¶
cellier.gui.qt.visuals.QtWireframeToggle ¶
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 |
None
|
Graphs¶
cellier.gui.qt.visuals.QtNodeVisibleToggle ¶
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 |
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 |
None
|
cellier.gui.qt.visuals.QtNodeSizeSpaceCombo ¶
cellier.gui.qt.visuals.QtEdgeVisibleToggle ¶
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 |
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 |
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 |
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 |
required |
axes
|
Sequence[tuple[int, str]]
|
|
required |
trail
|
Mapping[int, TrailConfig]
|
The visual's current |
required |
title
|
str | None
|
The name shown on the group frame. Defaults to |
None
|
parent
|
Optional Qt parent widget. |
None
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
The same title the built-in viewers pass when they build this widget.
offered_axes
property
¶
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.
window ¶
window(axis: int) -> TrailConfig
The window axis has, or last had before it was switched off.
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
¶
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.
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 ¶
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
enabledsays -- 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 |
required |
effective_radius
|
Callable[[], float | None] | None
|
Called to read the radius actually in use, in scene units, for the
readout. Typically |
None
|
parent
|
Optional Qt parent widget. |
None
|
widget
property
¶
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.
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 ¶
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 |
required |
parent
|
Optional Qt parent widget. |
None
|
|
slot_usage
|
Zero-argument callable returning |
None
|
widget
property
¶
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.
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 ¶
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 |
required |
frame_count
|
Callable[[], int | None] | None
|
Called to read how many frames have accumulated on the
least-converged canvas, for the readout. Typically
|
None
|
on_reset
|
Callable[[], None] | None
|
Called when the user asks to discard the accumulated history.
Typically |
None
|
parent
|
Optional Qt parent widget. |
None
|
widget
property
¶
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.
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 ¶
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]]
|
|
()
|
title
|
str | None
|
The name shown on the collapsible header. Defaults to
|
None
|
parent
|
Optional Qt parent widget. |
None
|
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
The same title the built-in viewers pass when they build this widget.
widget
property
¶
The QCollapsible widget to insert into a layout.
Qt seam 1: replace with the backend element for other toolkits.
section_labels ¶
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. |
required |
multiscale_index
|
int
|
Which |
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
|
parent
|
Optional Qt parent widget. |
None
|
widget
property
¶
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
¶
The bare input inside the row -- the checkbox, slider or combo.
For tests and for callers driving the input directly.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
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.
cellier.gui.qt.visuals.QtToggle ¶
Bases: QtAppearanceField
Layer 2: a QCheckBox for a boolean appearance field.
widget
property
¶
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
¶
The bare input inside the row -- the checkbox, slider or combo.
For tests and for callers driving the input directly.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
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.
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
¶
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
¶
The bare input inside the row -- the checkbox, slider or combo.
For tests and for callers driving the input directly.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
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.
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
¶
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
¶
The bare input inside the row -- the checkbox, slider or combo.
For tests and for callers driving the input directly.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
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.
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
¶
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
¶
The bare input inside the row -- the checkbox, slider or combo.
For tests and for callers driving the input directly.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
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.
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
¶
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
¶
The bare input inside the row -- the checkbox, slider or combo.
For tests and for callers driving the input directly.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
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.
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
¶
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
¶
The bare input inside the row -- the checkbox, slider or combo.
For tests and for callers driving the input directly.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
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.
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. |
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 |
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. |
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
|
|