Plexora

register_image_datasource

Register an image alone as a project -- no cell table, no mask.

Generated from Plexora 0.0.55View source
from plexora import register_image_datasource
register_image_datasource(
    name,
    image,
    channel_names=None,
    copy=False,
    data_dir=None,
    image_type=None,
    pyramidize=None,
    image_index=0,
)

Writes directly to Plexora's project registry. The project opens immediately; a mask or a cell table can be attached to it later, by re-registering the same name with plexora.register_datasource or plexora.register_anndata_datasource.

When to use

A quick first look at a slide before anything else about it is known. plexora.create_project(image) does the same job and is the newer entry point, letting plexora.configure_project fill in a table or mask afterwards; use register_image_datasource for a script that only ever has the image.

Parameters

namestrrequired

The project's name.

imagestr | Pathrequired

The whole-slide image -- OME-TIFF/TIFF, DICOM, or a Zarr store. A web address is read in place.

channel_nameslist[str]default None

A name for each image channel, in channel order. Derived from the image's own metadata (or generic "Channel N" names) when not given.

copybooldefault False

Copy image into the project's own folder instead of reading it where it is. Defaults to False.

data_dirstr | Pathdefault None

The data root to register the project under. By default the project is registered where new projects go (on your own computer, Documents/Plexora/projects, which the Plexora website opens too) and what registering builds is written to Plexora's configured data directory.

image_typestrdefault None

"brightfield" or "fluorescence", to override how the image is read. Defaults to None, which decides from the file.

pyramidizebool or strdefault None

What to do with a large multiplex TIFF that has no reduced-resolution levels. None (the default) and True write a pyramidized copy once, beside the original (or in the project's folder when that one is not writable), and open the copy; the original is never changed. A 16-bit image's copy is <name>.pyramid.approx, about 75% smaller than an exact copy with every pixel within its noise, unless the setting compress_pyramids is off; otherwise <name>.pyramid.ome.tiff. "compressed" or "exact" asks for that kind. False opens the original as it is.

image_indexintdefault 0

Which image of a microscope file that holds several -- a CZI's scenes, an ND2's positions, a LIF's images, an MCD's acquisitions, a VSI's scan areas -- counting from 0 in the order the import dialog lists them. Defaults to 0, the first. Every other format holds one image.

Returns

dict

The project's saved config entry.

Examples

import plexora

plexora.register_image_datasource("quicklook", image="slide.ome.tif")
# The third scene of a slide scan
plexora.register_image_datasource("scene3", image="scan.czi", image_index=2)

Guides

On this page