Plexora

attach_segmentation

Point a project's segmentation mask at a file a node is serving.

Generated from Plexora 0.0.55View source
from plexora import attach_segmentation
attach_segmentation(project, node, resource_id, reload=True)

Whether the node's mask is a filled pyramid or an outline pyramid is read off the node's own description rather than assumed: both serve tiles happily, and drawing one as the other paints a wrong picture without raising any error.

Parameters

projectstr | Projectrequired

The project to update, by name or object.

nodestrrequired

The registered node serving the file.

resource_idstrrequired

The segmentation resource's id on that node (see plexora.node_resources).

reloadbooldefault True

Reload the project in this process after saving. Defaults to True.

Returns

Project

The project, saved with the mask pointed at the node and (unless reload=False) reloaded.

Raises

KeyError

If project names an unknown project, or node names an unregistered node.

Examples

import plexora

plexora.attach_segmentation("tonsil", node="hpc", resource_id="mask")

On this page