tiledbsoma.MultiscaleImage

class tiledbsoma.MultiscaleImage(handle: SOMAArray | SOMADataFrame | SOMAPointCloudDataFrame | SOMAGeometryDataFrame | SOMASparseNDArray | SOMADenseNDArray | SOMAGroup | SOMACollection | SOMAMeasurement | SOMAExperiment | SOMAScene | SOMAMultiscaleImage, *, uri: str, context: SOMATileDBContext, **kwargs: Any)

A multiscale image represented as a collection of images at multiple resolution levels.

Each level of the multiscale image must have the following consistent properties:

  • Number of Channels: All levels must have the same number of channels.

  • Axis Order: The order of axes (e.g., channels, height, width) must be consistent across levels.

Lifecycle

Experimental.

__init__(handle: SOMAArray | SOMADataFrame | SOMAPointCloudDataFrame | SOMAGeometryDataFrame | SOMASparseNDArray | SOMADenseNDArray | SOMAGroup | SOMACollection | SOMAMeasurement | SOMAExperiment | SOMAScene | SOMAMultiscaleImage, *, uri: str, context: SOMATileDBContext, **kwargs: Any) None

Internal-only common initializer steps.

This function is internal; users should open TileDB SOMA objects using the create() and open() factory class methods.

Methods

__init__(handle, *, uri, context, **kwargs)

Internal-only common initializer steps.

exists(uri[, context, tiledb_timestamp])

Finds whether an object of this type exists at the given URI.

create(uri, *, type, level_shape[, ...])

Creates a new MultiscaleImage at the given URI.

open(uri[, mode, tiledb_timestamp, context, ...])

Opens this specific type of SOMA object.

reopen(mode[, tiledb_timestamp])

Return a new copy of the SOMAObject with the given mode at the current Unix timestamp.

close()

Release any resources held while the object is open.

verify_open_for_writing()

Raises an error if the object is not open for writing.

items()

keys()

values()

get(k[,d])

set(key, value, *[, use_relative_uri])

Sets a new level in the multi-scale image to be an existing SOMA DenseNDArray.

setdefault(k[,d])

update([E, ]**F)

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

clear()

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()

as a 2-tuple; but raise KeyError if D is empty.

get_transform_from_level(level)

Returns the transformation from user requested level to the image reference level.

get_transform_to_level(level)

Returns the transformation from the image reference level to the user requested level.

level_shape(level)

The shape of the image at the specified resolution level.

level_uri(level)

The URI of the image at the specified resolution level.

levels()

Returns a mapping of {member_name: (uri, shape)}.

set(key, value, *[, use_relative_uri])

Sets a new level in the multi-scale image to be an existing SOMA DenseNDArray.

read_spatial_region(level[, region, ...])

Reads a user-defined spatial region from a specific level of the MultiscaleImage.

register(subclass)

Register a virtual subclass of an ABC.

add_new_level(key, *[, uri, platform_config])

Adds a new resolution level to the MultiscaleImage.

Attributes

uri

Accessor for the object's storage URI.

context

A value storing implementation-specific configuration information.

metadata

The metadata of this SOMA object.

mode

The mode this object was opened in, either r, w, or d.

closed

True if the object has been closed.

soma_type

A string describing the SOMA type of this object.

tiledb_timestamp

The time that this object was opened in UTC.

tiledb_timestamp_ms

The time this object was opened, as millis since the Unix epoch.

coordinate_space

Coordinate space for this multiscale image.

data_axis_order

The order of the axes for the resolution levels.

has_channel_axis

Returns if the images have an explicit channel axis.

level_count

The number of image resolution levels stored in the MultiscaleImage.

nchannels

The number of channels.