Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

analyze

БесплатноБез исполняемых скриптовНе проверен

Compute properties, export data, manage connections, and share NimbusImage datasets using the nimbusimage Python API. Use this skill when the user wants to…

arjunrajlaboratoryот arjunrajlaboratory★ 22 звезды на GitHub

Об этом скилле

NimbusImage — Analyze

This skill covers the analysis and data management accessors: properties, export, connections, sharing, and history.

Properties

Properties are computed measurements on annotations (e.g., area, intensity, circularity).

Property definitions

# 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)

Property values

# 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)

Gene expression from a spatial table

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

Running property workers

For server-side computation using Docker workers, use the workers skill.

Connections

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"])

Export

# 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=&quot;property_id&quot;, &quot;Area&quot;,
)

# 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=&quot;property_id&quot;, &quot;Area&quot;,
    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().

Sharing

# 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 tha

Полный SKILL.md на GitHub

Установить analyze в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yamlreferences/api-overview.mdreferences/gotchas.md

FAQ

Что делает скилл analyze?

Compute 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.

Как установить скилл analyze?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл analyze запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить analyze с