/nimbus-skills:imagesfrom nimbus-skills
Fetches image data from NimbusImage datasets as numpy arrays using the nimbusimage Python API. Retrieves frames, composites, z-stacks, crops, and channel data from an imaging server.
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.
The ds.images accessor retrieves image data as numpy arrays from a NimbusImage dataset. Images are fetched from the Girder large_image backend via a pickle-encoded region API.
import numpy as np
# Get one frame as a 2D numpy array (H, W)
img = ds.images.get(channel=0, z=0, time=0)
print(f"Shape: {img.shape}, dtype: {img.dtype}")
# Specify XY position (for multi-position datasets)
img = ds.images.get(channel=0, z=0, time=0, xy=1)
# Crop to a region: (left, top, right, bottom) in pixel coordinates
crop = ds.images.get(channel=0, z=0, time=0, crop=(100, 200, 500, 600))
# Get all channels at one location as a list of 2D arrays
channels = ds.images.get_all_channels(z=0, time=0)
for i, ch in enumerate(channels):
print(f"Channel {i}: shape={ch.shape}")
# Z-stack as a 3D array (N_z, H, W)
z_stack = ds.images.get_stack(channel=0, axis="z")
# Time series as a 3D array (N_t, H, W)
time_series = ds.images.get_stack(channel=0, axis="time")
# At specific location
z_stack = ds.images.get_stack(channel=0, axis="z", xy=0, time=0)
Creates an RGB composite merging visible channels using layer settings (contrast, pseudocolor) from the dataset's collection configuration:
# Composite as (H, W, 3) numpy array
rgb = ds.images.get_composite(dtype="uint8") # [0, 255]
rgb_f = ds.images.get_composite(dtype="float64") # [0.0, 1.0]
# At specific location
rgb = ds.images.get_composite(z=3, time=0, dtype="uint8")
The composite is drawn the way the app draws it for you: layer settings from ds.collections.layers (your own view's configuration) — channel visibility, pseudocolor, contrast with your per-view overrides (percentile blackPoint/whitePoint are percents of the frame histogram's min..max, not quantiles), and each layer's z/time/xy slice setting, including max projections. It blends with "lighten" mode by default. Pass max_size=1024 for large slides (downsampled on the server) and crop=(left, top, right, bottom) to zoom in.
# Iterate over every frame in the dataset
for frame_info, img in ds.images.iter_frames():
print(f"Frame {frame_info.index}: ch={frame_info.channel}, "
f"z={frame_info.z}, t={frame_info.time}, shape={img.shape}")
For Docker workers that need to write processed images back:
# Requires pip install nimbusimage[worker]
with ds.images.new_writer() as writer:
for frame_info, img in ds.images.iter_frames():
processed = some_processing(img)
writer.add_frame(processed, **frame_info.to_large_image_params())
# Automatically writes TIFF and uploads to dataset folder on context exit
from PIL import Image
img = ds.images.get(channel=0, z=0, time=0)
# Normalize to 0-255 if needed
if img.dtype != np.uint8:
img = ((img - img.min()) / (img.max() - img.min()) * 255).astype(np.uint8)
Image.fromarray(img).save("frame.png")
from PIL import Image
rgb = ds.images.get_composite(dtype="uint8")
Image.fromarray(rgb).save("composite.png")
z_stack = ds.images.get_stack(channel=0, axis="z")
mip = z_stack.max(axis=0) # (H, W)
dtype property tells you the source data type (e.g., uint8, uint16).ds.shape returns (height, width) — numpy convention, not (width, height).channel, z, time, xy are all 0-indexed integers.For complete ImageAccessor signatures, read references/api-overview.md. For coordinate and composite caveats, read references/gotchas.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
nimbusimage, image-processing, numpy-arrays, bioimaging, girder
npx claudepluginhub arjunrajlaboratory/nimbusimage --plugin nimbusimage7 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.
/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