Collections
A saved configuration with layers, tools, and properties.
In NimbusImage, "collections" and "configurations" are the same thing.
nimbusimage.collections.Collection
A NimbusImage collection (configuration).
Contains layer settings, tool definitions, property registrations, snapshots, and scales for a dataset view.
folder_id
property
The parent folder ID this collection belongs to.
layers
property
Layer settings (channel, color, contrast, visibility).
tools
property
Tool definitions.
property_ids
property
Registered property IDs.
snapshots
property
Saved view snapshots.
scales
property
Scale settings (pixel size, z step, time step).
url()
URL for the collection/configuration page.
open()
Open the collection page in the default browser.
nimbusimage.collections.CollectionAccessor
Access collections for a specific dataset.
This accessor finds collections via dataset_views, which link datasets to collections. The default collection is the one the caller sees in the app: the configuration of their own view of the dataset (falling back to any view they can read, e.g. a dataset shared with them that they have not opened yet). See default_view().
view
property
The default view (see default_view), or {} when there is none.
layers
property
Layer settings from the default collection.
Used by ImageAccessor.get_composite() for contrast and color.
layer_contrasts
property
The caller's per-layer contrast overrides from their view,
keyed by layer id. They take precedence over a layer's own
contrast (as in the app).
scales
property
Pixel size, z step, and time step as the app uses them: the view's scales over the default collection's.
property_ids
property
Property IDs registered in the default collection.
list_views(current_user_only=False)
List dataset views for this dataset.
Each view links this dataset to a collection and stores per-user view state (last location, contrast overrides, etc.).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_user_only
|
bool
|
Only the caller's own views. Otherwise every view they can read, including other users' views of a shared dataset. |
False
|
default_view()
The caller's own view of this dataset, else any view they can read; None when there is none. A caller with several views of the dataset gets one of them (the server's order); pass a collection id to get()/get_raw() to choose.
get(collection_id=None)
Get a collection for this dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection_id
|
str | None
|
Specific collection ID. If None, returns the collection of the default view (see default_view). |
None
|
Returns:
| Type | Description |
|---|---|
Collection | None
|
Collection object, or None if no views/collections exist. |
list()
List all collections linked to this dataset via views.
Note
Makes one HTTP call per unique collection. No batch-by-IDs endpoint exists yet on the server.
get_raw(collection_id=None)
Get a collection as a raw dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection_id
|
str | None
|
Specific collection ID. If None, returns the collection of the default view (see default_view). |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Raw collection dict, or empty dict if none exist. |
refresh()
Clear cached collection. Next access will re-fetch from server.