/nimbus-skills:analyzefrom nimbus-skills
Compute annotation measurements, export data as JSON/CSV, manage connections between annotations, share datasets, and control access using the nimbusimage Python API.
Ships in nimbus-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill covers the analysis and data management accessors: properties, export, connections, sharing, and history.
Properties are computed measurements on annotations (e.g., area, intensity, circularity).
# List all property definitions
props = ds.properties.list()
# Get or create a property (finds existing by name+shape, or creates new)
prop = ds.properties.get_or_create("Area", shape="polygon")
# Create explicitly
prop = ds.properties.create(
name="Spot Intensity",
shape="point",
image="properties/blob_metrics:latest", # Docker worker image
worker_interface={"Channel": 0},
)
# Register with the dataset's collection (required before values are visible in UI)
ds.properties.register(prop.id)
# Delete
ds.properties.delete(prop.id)
# Get all property values for the dataset (downloads every value document;
# for statistics use ds.annotations.summary(property_paths=...) instead)
values = ds.properties.get_values()
# Get values for a specific annotation
values = ds.properties.get_values(annotation_id="ann_id")
# Submit computed values
# Format: {annotation_id: {property_name: value}}
computed = {}
for ann in ds.annotations.list(shape="polygon"):
mask = ann.get_mask(ds.shape)
img = ds.images.get(channel=0, z=ann.location.z)
computed[ann.id] = {"Mean Intensity": float(img[mask].mean())}
ds.properties.submit_values(prop.id, computed)
# Delete all values for a property
ds.properties.delete_values(prop.id)
# Get histogram
hist = ds.properties.histogram("propertyId.Area", buckets=50)
On datasets with a registered spatial table (Xenium or Spatial Genomics ingest), gene
counts are not stored property values. Each gene is a virtual property path
["spatial", "<gene>"] read live from the table. In the app a gene appears in pickers
only after it's added (Measure objects → Gene expression → Add genes…). From
Python no adding is needed:
path = ds.spatial.virtual_path("KRT7") # ["spatial", "KRT7"]
f = {"propertyFilters": [{"path": path, "mode": "range", "min": 100}]}
ds.annotations.summary(filters=f) # server-side count
ds.spatial.aggregate(["KRT7"], {"tags": {"values": ["Leiden 0"], "exclusive": False}})
ds.spatial.materialize(["KRT7"]) # copy into a real property
For server-side computation using Docker workers, use the workers skill.
Connections link annotations in parent-child relationships (e.g., cell lineage, spatial proximity).
# Create a connection
conn = ds.connections.create(
parent_id=parent_ann.id,
child_id=child_ann.id,
tags=["lineage"],
)
# List connections
all_conns = ds.connections.list()
parent_conns = ds.connections.list(parent_id="ann_id")
child_conns = ds.connections.list(child_id="ann_id")
either = ds.connections.list(node_id="ann_id") # as parent or child
# Count
n = ds.connections.count()
# Bulk create
connections = [
ni.Connection(parent_id=p.id, child_id=c.id, dataset_id=ds.id, tags=["link"])
for p, c in pairs
]
ds.connections.create_many(connections)
# Auto-connect to nearest neighbors (server-side)
ds.connections.connect_to_nearest(
annotation_ids=[a.id for a in new_annotations],
tags=["nucleus"], # find nearest among annotations with these tags
channel=0,
)
# Delete
ds.connections.delete("connection_id")
ds.connections.delete_many(["id1", "id2", "id3"])
# JSON export (returns dict)
data = ds.export.to_json()
data = ds.export.to_json(
include_annotations=True,
include_connections=True,
include_properties=True,
include_property_values=True,
)
# CSV export
csv_bytes = ds.export.to_csv(
property_paths=[["property_id", "Area"]],
)
# CSV export to file
ds.export.to_csv(
property_paths=[["property_id", "Area"], ["property_id", "Intensity"]],
path="results.csv",
)
# With custom delimiter
ds.export.to_csv(
property_paths=[["property_id", "Area"]],
delimiter="\t",
path="results.tsv",
)
The property_paths format is a list of [property_id, value_key] pairs. You can find property IDs from ds.properties.list().
# Share with a user (by email or username)
ds.sharing.share("[email protected]", access="read")
ds.sharing.share("labmate", access="write")
ds.sharing.share("pi", access="admin")
# Remove access
ds.sharing.share("[email protected]", access="remove")
# Toggle public access
ds.sharing.set_public(True)
ds.sharing.set_public(False)
# View current access list
access = ds.sharing.get_access()
Access levels: read, write, admin, remove. admin makes the user a co-owner (they can share, publish and delete).
A share applies to the dataset folder and to each of its dataset views that you can write, together with that view's collection (what the web app's Share dialog does by default), so the user can open the dataset with its configuration. Views and collections you can't write are left unchanged; if there are none you can write, share() raises ValueError. write access is enough to share, but never above your own level: a collaborator with write can share read or write, and the server refuses (403, nothing changed) any request that would grant more than your level on the dataset, any of its views or configurations, or that would change a user above your level (such as the owner). project.share() follows the same rules for everything in the project you can edit -- datasets with their views, and collections -- and is refused as a whole if any of them would exceed your level.
set_public needs owner (ADMIN) access.
A dataset or project always keeps at least one user at admin: removing or demoting the last one is refused (400, nothing changed), whether it's you or someone else. To hand a dataset over, share it with the new owner at admin first, then remove yourself.
⚠️ Never call the raw Girder access endpoint.
ds.sharingis the only safe way to change access. Specifically: do not callclient._gc.put(f"folder/{id}/access", ...). The raw endpoint replaces the entire ACL, so everyone the new list omits silently loses access.ds.sharing.share()is incremental — it can't make that mistake. If you find yourself wanting to bulk-replace an ACL, stop and ask the user; the accessor methods cover every legitimate sharing operation. See alsoreferences/gotchas.md.
Undo/redo support for annotation operations:
# Undo the last annotation operation
ds.history.undo()
# Redo
ds.history.redo()
Collections hold display settings — layers, tools, scales:
# List collections for this dataset
collections = ds.collections.list()
# Get a specific collection
coll = ds.collections.get("collection_id")
# Get the raw collection data (includes meta with scales, propertyIds, etc.)
raw = ds.collections.get_raw()
# Get layer settings (used by get_composite)
layers = ds.collections.layers # list of layer dicts
# List dataset views
views = ds.collections.list_views()
import numpy as np
# Compute measurements
prop = ds.properties.get_or_create("Area", shape="polygon")
ds.properties.register(prop.id)
values = {}
for ann in ds.annotations.list(shape="polygon"):
mask = ann.get_mask(ds.shape)
values[ann.id] = {"Area": float(mask.sum())}
ds.properties.submit_values(prop.id, values)
# Export to CSV
ds.export.to_csv(
property_paths=[[prop.id, "Area"]],
path="areas.csv",
)
# Get all connections
conns = ds.connections.list()
# Build adjacency
children = {}
for c in conns:
children.setdefault(c.parent_id, []).append(c.child_id)
# Traverse
def print_tree(ann_id, depth=0):
print(" " * depth + ann_id)
for child in children.get(ann_id, []):
print_tree(child, depth + 1)
For complete accessor signatures, read references/api-overview.md. Before changing sharing or using lower-level APIs, read references/gotchas.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub arjunrajlaboratory/nimbusimage --plugin nimbusimage7 skills in this plugin
/annotationsCreate, list, filter, update, and delete annotations on NimbusImage datasets using the nimbusimage Python API. Use this skill when the user wants to work with annotations — creating points or polygons, filtering by shape or tags, bulk operations, geometry conversion (shapely, numpy masks), or programmatic annotation manipulation. Also use when you see ds.annotations in code, or the user mentions spots, cells, nuclei, ROIs, polygons, or segmentation masks in an imaging context.
/imagesFetch image data from NimbusImage datasets as numpy arrays using the nimbusimage Python API. Use this skill when the user wants to retrieve image frames, composites, z-stacks, crops, or channel data from a NimbusImage dataset. Also use when you see ds.images in code, or the user mentions getting pixel data, viewing channels, making composites, or processing image arrays from their imaging server.
/nimbusimageConnect to a NimbusImage server and work with scientific imaging datasets using the nimbusimage Python API. Use this skill whenever the user mentions NimbusImage, wants to connect to a Girder-based imaging server, list or open datasets, or asks about the nimbusimage package. Also use when you see `import nimbusimage` in code or the user references dataset IDs, channels, z-slices, or time points in an imaging context. This is the entry point — it routes to more specific skills (annotations, images, workers, analyze) for deeper operations. If NimbusImage MCP tools (ni_*) are also connected, prefer this API for anything beyond a quick lookup.
/sg-ingestLoad a Spatial Genomics (GenePS / sganalysis) data export into NimbusImage, one dataset per ROI: DAPI + GFP images, cell polygons, Leiden clusters as tags and a numeric property, UMAP, cell area, the full cell x gene matrix as a spatial table, and the transcript list as a Transcripts overlay. Use when the user mentions Spatial Genomics, GenePS, sganalysis, a DataExport_* zip, basic_results/roi_N, CellxGene.csv, TranscriptList.csv, Boundaries.geojson, or sganalysis.session. Complements xenium-ingest (same server machinery, different inputs).
/workersRun Docker-based computational workers on NimbusImage datasets using the nimbusimage Python API. Use this skill when the user wants to run segmentation, spot detection, property computation, or any Docker worker on their imaging data. Also use when you see ds.annotations.compute or ds.properties.compute in code, or the user mentions running workers, submitting jobs, tracking job status, or automating image analysis pipelines on a NimbusImage server.
/xenium-ingestLoad a 10x Xenium spatial-transcriptomics bundle into NimbusImage: the morphology and H&E images, cell segmentation polygons, a gene-expression marker panel, clustering, a computed UMAP, and cell types as tags. Use this skill when the user mentions Xenium, 10x spatial data, cells.zarr, cell_feature_matrix, transcripts, he_imagealignment, or wants Xenium / spatial-omics cells and per-cell data in NimbusImage. Covers bundle anatomy, micron-to-pixel transforms, H&E alignment, orientation validation, bulk upload, nested property values, and every trap hit on a 709k-cell dataset.
Other plugins' skills for the same job