Plexora

detach

Bring one of a project's resources back to this machine.

Generated from Plexora 0.0.55View source
from plexora import detach
detach(project, kind, path=None)

Removes the node binding recorded by plexora.attach_table, plexora.attach_image or plexora.attach_segmentation, and points the project at path instead. The project's own answers about the data -- roles, the marker split, the coordinate source, whether values are log-transformed -- are untouched: a table that comes home is not a table that has to be re-imported.

When to use

Call this when a node is being retired, or when a file that was being read remotely has been copied onto this machine, and the project should go back to reading it directly.

Parameters

projectstr | Projectrequired

The project to update, by name or object.

kindstrrequired

Which resource to detach: "image", "segmentation" or "table".

pathstrdefault None

Where the file is on THIS machine. Required for "image" and "table" -- a project resource on a node has no local copy by construction. For "segmentation", an empty path is a real answer: the project no longer has a mask.

Returns

Project

The project, saved with the node binding removed and reloaded so this process serves it. Returned unchanged (and not reloaded) if kind had no node binding to remove.

Raises

KeyError

If kind is not one of "image", "segmentation" or "table", or project names an unknown project.

ValueError

If path is required for kind and not given, or (for "image") if the file at path cannot be read as an image, or does not match the image the project was built on.

Examples

import plexora

plexora.detach("tonsil", "table", path="/data/cells.csv")

On this page