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_segmentationattach_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 | ProjectrequiredThe project to update, by name or object.
nodestrrequiredThe registered node serving the file.
resource_idstrrequiredThe segmentation resource's id on that node (see
plexora.node_resources).
reloadbooldefault TrueReload the project in this process after
saving. Defaults to True.
Returns
ProjectThe project, saved with the mask pointed at the node and
(unless reload=False) reloaded.
Raises
KeyErrorIf project names an unknown project, or node names an
unregistered node.
Examples
import plexora
plexora.attach_segmentation("tonsil", node="hpc", resource_id="mask")