view
Open a notebook-displayable viewer on datasource.
from plexora import viewview(datasource=None, **kwargs)In a Jupyter cell, making this the last expression starts a server and displays the viewer in an iframe.
datasource may be left out when data is given: the project is named
after the image file, as the Import dialog would name it, and calling
again with the same data refreshes that project. Only opening an
existing project needs its name.
Called with a name alone, it opens a project that already exists.
Called with data as well -- an image, a table, an AnnData, a
SpatialData object -- it registers that data under datasource first,
exactly as plexora.register_memory_datasource does, and then opens
the viewer on it. Each of image, segmentation and the table may be
a path or an in-memory object; a path is read from disk as it always
was, and an object is served out of this kernel, so nothing is written
and viewer.refresh(adata) shows the next round of annotation.
**kwargs accepts two kinds of keyword, freely mixed:
- Data arguments --
image,segmentation,adata,table,sdata,sdata_table,sdata_image,sdata_labels,channel_names,coordinate_source,obsm_key,x,y,feature_source,layer,feature_obs_columns,obs_id_field,celltype_column,subset_by,subset_value,apply_log_transform,pixel_size,image_type,segmentation_mode,axes,z_step,frame_interval-- are whatplexora.register_memory_datasourceaccepts, and documents.to_disk=Truewrites a live AnnData to an.h5adand registers that file instead of serving the object from memory -- worth asking for when the project should outlive this kernel. - Viewer options --
tool,overlay,channels,height,width,proxy,base_url,plugins,data_dir,start-- are whatplexora.PlexoraVieweraccepts, and documents.
tool, overlay and channels say what the viewer should already be
showing when it appears -- which plugin panel is open, which column is
drawn over the cells, which image channels are on. All three are
EPHEMERAL: they belong to this one viewer and are never written to the
project, so the project's saved channels and overlay are exactly what
a plain plexora.view(name) restores.
Parameters
datasourcestrdefault NoneThe project's name. Registered first when
**kwargs includes a data argument; opened as-is otherwise.
**kwargsData arguments and viewer options, described above.
Returns
PlexoraViewerThe viewer. Its server starts, and it displays, when it is shown or returned as a cell's last expression.
Examples
import plexora
viewer = plexora.view("quicklook", image="slide.ome.tif", start=False)Related
PlexoraViewer
A running Plexora viewer, returned by plexora.view().
register_memory_datasource
Register a project whose image, mask or cell table live in memory.
import_sample
Detect and register one sample from these paths, and return its name.