add_layers
Add one or more files to a sample that is already registered.
from plexora import add_layersadd_layers(name, *paths, answers=None, wait=False) -> listThe same detection import_sample runs, grouped onto an existing project
instead of a new one -- a mask added this way goes through
attach_segmentation, a table through replace_project_data, exactly as
adding one from the viewer's Layers panel does.
When to use
Use this once a sample already exists and there are more files for
it -- a mask that was not ready at import time, a transcripts table,
an extra channel image. Use import_sample for a sample that does
not exist yet.
Parameters
namestrrequiredThe project to add these files to.
*pathsOne or more files to add.
answersdictkeyword-onlydefault None{question_id: value} for anything
detection could not work out -- see import_sample.
waitboolkeyword-onlydefault FalseBlock until everything just added (a mask's pyramid, a transcripts tile set) has finished building. Defaults to False.
Returns
list[{"id": ..., "status": ...}, ...], one entry per added
channel or transcripts layer. A mask or a cell table given here
is attached directly rather than listed -- adding only a mask
returns an empty list even though it lands.
Raises
ExceptionIf nothing at these paths is something Plexora can register.
Examples
import plexora
plexora.import_sample("slide.ome.tif", name="tonsil", wait=True)
plexora.add_layers("tonsil", "slide_mask.tif", wait=True)Related
import_sample
Detect and register one sample from these paths, and return its name.
project_manifest
What one project has, what it was told, and what is still open.