Image
pado image abstraction to hide image loading implementation
- class pado.images.image.Image(urlpath, *, load_metadata=False, load_file_info=False, checksum=False)[source]
pado.img.Image is a wrapper around whole slide image data
- classmethod from_obj(obj)[source]
instantiate an image from an object, i.e. a pd.Series
- Return type:
- to_record(image_id=None, *, urlpath_ignore_options=(), **kwargs)[source]
return a record for serializing
- Return type:
dict[str, Any]
- open(*, via=None, storage_options=None)[source]
open an image instance
This will instantiate the filesystem. Dependent on the filesystem this will establish connections to servers, etc. If open has been called, following calls will be no-ops.
- Parameters:
via (AbstractFileSystem | None) – allows to provide a filesystem that will be used instead of the Image.urlpath’s filesystem to access the path.
storage_options (dict[str, Any] | None) – allows providing storage options for the filesystem used to access the image.
- Returns:
returns the opened image instance
- Return type:
self
- via(ds, *, storage_options=None)[source]
open an image instance via a pado dataset
Similar behavior to .open() with the difference that only if the dataset is accessed remotely and the images are referenced locally (so on the same remote) will the image be accessed via the dataset filesystem.
A common example is a pado dataset stored on a server with the images stored next to it on the server filesystem. If this dataset is now accessed via ssh, the images will be accessible via ssh too.
- Parameters:
ds – this pado dataset’s filesystem will be used for access
storage_options – allows providing storage options for the filesystem used to access the image.
- Returns:
returns the opened image instance
- Return type:
self
- property metadata: ImageMetadata
the image metadata
- get_array(location, region, level, *, runtime_type_checks=True)[source]
return array from a defined level
- Return type:
ndarray
- get_array_at_mpp(location, region, target_mpp)[source]
return array from a defined mpp and a position (in the target mpp)
- Return type:
ndarray