/nimbus-skills:workersfrom nimbus-skills
Runs Docker-based computational workers on NimbusImage datasets using the nimbusimage Python API. Handles segmentation, spot detection, property computation, job submission, and status tracking.
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.
Workers are Docker containers that perform computations on datasets — segmentation, spot detection, measurements, image processing. They run server-side via Girder Worker and are tracked as jobs.
There are two kinds of workers:
Each worker kind has its own accessor, and they submit to different endpoints with different payload formats:
ds.annotations.compute(...) → POST /upenn_annotation/computeProperty, then ds.properties.compute(prop, ...) → POST /annotation_property/{id}/computeNever pass a property-worker image to ds.annotations.compute, and never pass an annotation-worker image to ds.properties.compute. Both accessors now cross-check the image's role labels against /worker_interface/available before submitting and raise ValueError naming the correct accessor on a known mismatch — but the check is best-effort (an image missing from the listing, carrying no role labels, or an inaccessible discovery endpoint passes through unvalidated), so a mismatch can still submit and then crash inside the worker with a confusing error.
The wire formats differ in a way that makes the crash recognizable:
tags field — the tags to put on created annotations — plus assignment, tile, connectTo, type="worker", and id="".tags as a dict: {"tags": [...], "exclusive": bool} — an annotation filter selecting which existing annotations to measure.So if a property worker crashes with AttributeError: 'list' object has no attribute 'get' while reading tags, and its payload contains assignment/tile/connectTo, list-valued tags, type="worker", and id="" — that is an accessor/endpoint mismatch: the job was submitted through ds.annotations.compute. It is not malformed tag serialization to be normalized inside the worker; fix the caller, not the worker.
# WRONG — blob_intensity_worker is a PROPERTY worker; this submits an
# annotation-compute payload (list-valued tags, assignment, tile, connectTo)
# and the worker crashes: AttributeError: 'list' object has no attribute 'get'
job = ds.annotations.compute(
image="properties/blob_intensity_worker:latest",
channel=0,
tags=["blobs"],
worker_interface={"Channel": 0},
)
# RIGHT — go through the property accessor
prop = ds.properties.get_or_create("Blob Intensity", shape="polygon")
ds.properties.register(prop.id)
job = ds.properties.compute(prop, worker_interface={"Channel": 0})
To tell which kind a worker is, check its Docker labels by key presence (see "Discovering workers" below).
import nimbusimage as ni
client = ni.connect()
# List all available worker images on the server
workers = client.list_workers()
for image, labels in workers.items():
# Role labels are MARKER labels: they are commonly set with an
# empty-string value (docker build --label isPropertyWorker), so
# detect the role by KEY PRESENCE, never by comparing the value.
is_annotation = "isAnnotationWorker" in labels
is_property = "isPropertyWorker" in labels
print(f"{image}: {labels.get('interfaceName', '')} "
f"[ann={is_annotation}, prop={is_property}]")
# Get the parameter interface for a specific worker
interface = client.get_worker_interface("annotations/random_squares:latest")
for param_name, spec in interface.items():
print(f" {param_name}: type={spec['type']}, default={spec.get('default', '')}")
Worker labels include:
isAnnotationWorker / isPropertyWorker — role markers; check with "isAnnotationWorker" in labels, not == "true" (the value is usually the empty string). A worker may carry both roles.interfaceName — display namedescription — what it doesannotationShape — shape it produces (point, polygon, etc.)Do not infer the role from the image path prefix (annotations/..., properties/...): registry-qualified images may have arbitrary prefixes (e.g. ghcr.io/lab/blob_intensity_worker:latest). The labels are the only reliable signal.
ds = client.dataset("dataset_id")
# Submit a worker job
job = ds.annotations.compute(
image="annotations/random_squares:latest",
channel=0,
tags=["detected"],
worker_interface={
"Number of squares": 100,
"Square size": 15,
},
)
# Wait for completion (prints progress to stderr)
success = job.wait()
print(f"Job {'succeeded' if success else 'failed'}")
When an annotation worker creates new annotations, you can auto-connect them to existing nearest neighbors:
job = ds.annotations.compute(
image="annotations/laplacian_of_gaussian:latest",
channel=0,
tags=["spots"],
worker_interface={"Sigma": 2.0},
connect_to={"tags": ["nucleus"], "channel": 0},
)
job.wait()
The connect_to dict must always include a tags key (use {"tags": []} for no connections). Omitting it causes a KeyError in the worker.
# Process a specific tile
job = ds.annotations.compute(
image="annotations/my_worker:latest",
channel=0,
tags=["result"],
location=ni.Location(xy=0, z=3, time=0),
worker_interface={"threshold": 0.5},
)
# Process a range of tiles (batch)
job = ds.annotations.compute(
image="annotations/my_worker:latest",
channel=0,
tags=["result"],
assignment={"XY": "0-2", "Z": 0, "Time": "0-4"},
worker_interface={"threshold": 0.5},
)
job = ds.annotations.compute(
image="docker/image:tag", # Docker image name (required)
channel=0, # Channel index (default: 0)
tags=["tag1", "tag2"], # Tags for created annotations
location=ni.Location(...), # Single tile location
assignment={...}, # Batch range (overrides location)
worker_interface={...}, # Worker-specific parameters
scales={...}, # Pixel size metadata
connect_to={ # Auto-connect settings
"tags": ["parent_tag"],
"channel": 0,
},
name="my job", # Job display name
)
Property workers compute measurement values for existing annotations:
# Step 1: Create (or find) a property definition
prop = ds.properties.get_or_create("Blob Intensity", shape="polygon")
# Step 2: Register the property with the dataset's collection
ds.properties.register(prop.id)
# Step 3: Run the property worker
job = ds.properties.compute(
prop,
worker_interface={"Channel": 0},
scales=ds.collections.get_raw().get("meta", {}).get("scales", {}),
)
job.wait()
# Step 4: Fetch the computed values (every value document; for statistics
# use ds.annotations.summary(property_paths=...), which downloads none)
values = ds.properties.get_values()
The Job object tracks worker execution:
# Blocking wait (prints progress)
success = job.wait() # returns True/False
success = job.wait(timeout=300) # with 5-minute timeout
# Non-blocking polling
while not job.finished:
job.refresh()
print(f"Status: {job.status_name}")
time.sleep(5)
# Job properties
job.status # int: 0=inactive, 1=queued, 2=running, 3=success, 4=error, 5=cancelled
job.status_name # str: "inactive", "queued", "running", "success", "error", "cancelled"
job.finished # bool: True if status >= 3
job.log # str: job log output
Status codes: 0=inactive, 1=queued, 2=running, 3=success, 4=error, 5=canceled. Note: status 3 is SUCCESS, not "still running" — easy to confuse.
A PermissionError from refresh() / wait() means the API key lacks "List and read jobs". The job still runs; the key just can't watch it. The user should add that permission to the key if they can edit it, or ask the server's admin (support, for nimbusimage.com) to; a full-access key also works. Meanwhile, confirm the job ran by checking its outputs. See "Can't see a job's status ≠ the job didn't run" in references/gotchas.md.
The production server (app.nimbusimage.com) rate-limits worker submissions from this client, per
session (each ni.connect() is a new session): 1 GPU-queue job and 10
CPU-queue jobs per 60 s. GPU workers start on demand and take minutes to spin
up, so a tight loop of compute() calls would otherwise flood the queue. The
browser front-end is not limited.
Over the limit, ds.annotations.compute() / ds.properties.compute() raise
girder_client.HttpError with status == 429, and the Retry-After header is
the exact number of seconds until the next job is accepted. A request the
server rejects for another reason (e.g. a 400 for bad parameters) does not
count against the limit.
import time
from girder_client import HttpError
def submit(fn, retries=5):
for _ in range(retries):
try:
return fn()
except HttpError as e:
if e.status != 429:
raise
time.sleep(int(e.response.headers.get("Retry-After", 60)))
raise RuntimeError("still rate-limited")
job = submit(lambda: ds.annotations.compute(image=img, assignment=..., worker_interface=params))
Prefer one job over a wide range (assignment={"XY": "0-99", ...}) to many
small jobs: it does the same work and counts as a single job. Do not open new
sessions to get around the limit.
Workers are Docker containers that receive parameters and use the nimbusimage API to read/write data:
# Inside a Docker worker script
import nimbusimage as ni
ctx = ni.worker_context() # reads env vars set by Girder Worker
ds = ctx.dataset
params = ctx.params
# Access worker parameters
threshold = params.get("workerInterface", {}).get("threshold", 0.5)
channel = params.get("channel", 0)
# Read image data
img = ds.images.get(channel=channel, z=0, time=0)
# Create annotations from results
detections = my_detection_algorithm(img, threshold=threshold)
annotations = [
ni.Annotation.from_point(x=x, y=y, channel=channel,
tags=params.get("tags", []),
dataset_id=ds.id)
for x, y in detections
]
ds.annotations.create_many(annotations)
Install with worker extras: pip install nimbusimage[worker]
# Step 1: Run detection worker
job = ds.annotations.compute(
image="annotations/laplacian_of_gaussian:latest",
channel=0,
tags=["spots"],
worker_interface={"Sigma": 2.0},
)
job.wait()
# Step 2: Run property worker on the detected annotations
prop = ds.properties.get_or_create("Spot Intensity", shape="point")
ds.properties.register(prop.id)
job = ds.properties.compute(prop, worker_interface={"Channel": 0})
job.wait()
# Step 3: Get results (every value document; prefer summary() for stats)
values = ds.properties.get_values()
ds.annotations.compute, property workers via ds.properties.compute. See the rule at the top of this skill."Square size" not "square_size"). Check with client.get_worker_interface().connect_to dict must always include "tags" — use {"tags": []} for no connections.job.wait() blocks the Python process. For long-running workers, consider non-blocking polling.PermissionError while polling means the key lacks "List and read jobs", not that the job didn't run.For worker-related accessor signatures, read references/api-overview.md. Before submitting work, read references/gotchas.md, especially exact interface keys and job status codes.
What SKILL.md sets; muted values are Claude Code's defaults
7 skills in this plugin
/analyzeCompute properties, export data, manage connections, and share NimbusImage datasets using the nimbusimage Python API. Use this skill when the user wants to compute annotation measurements, export data as JSON or CSV, create connections between annotations, share datasets with collaborators, or manage access control. Also use when you see ds.properties, ds.export, ds.connections, or ds.sharing in code, or the user mentions measurements, statistics, data export, lineage tracking, or sharing imaging datasets.
/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.
npx claudepluginhub arjunrajlaboratory/nimbusimage --plugin nimbusimageOther plugins' skills for the same job