porestore.image
¶
Local NumPy arrays and their persistent remote image records.
Image
¶
A local array, a remote image, or both. Properties never fetch data implicitly.
array = array
instance-attribute
¶
client
property
¶
id
property
¶
status
property
¶
metadata
property
¶
metrics: Solution
property
¶
Already-returned image metrics as a table; refresh metadata explicitly.
Reading this property never starts a job, downloads an array, or fetches metadata. Values and units are exactly those returned by the API.
from_numpy(array, **kwargs)
classmethod
¶
from_id(image_id, *, client=None)
classmethod
¶
Recover metadata for an existing image, without downloading its array.
upload(*, client=None) -> Image
¶
Serialize a local array as NPY, upload directly, and start ingestion.
Returns this Image immediately after registration; call wait_until_ready explicitly before submitting calculations. Repeated uploads of the same Image reuse its existing remote record. Construct a new Image to upload edits.
refresh() -> Image
¶
wait_until_ready(*, timeout: float = 300.0, poll_interval: float = 2.0) -> Image
¶
download(*, refresh: bool = False) -> np.ndarray
¶
Download the stored sample as NumPy; retain an in-memory copy until refresh=True.
This retrieves the current ingested image, which may differ from the original upload. Zarr decompression runs in the notebook process.
upload(data: np.ndarray | str | PathLike, *, name: str | None = None, description: str = '', voxel_size: float | None = None, client=None, wait: bool = False, timeout: float = 300.0, poll_interval: float = 2.0, raw_metadata: dict | None = None) -> Image
¶
Upload a NumPy array or local file and return its remote Image.
Uses the configured connection unless client is supplied. Arrays are sent as NPY; the API selects a file decoder from the filename's extension. RAW files also need raw_metadata containing their dimensions and dtype. voxel_size is in micrometres. With wait=True, wait for ingestion to finish before returning; by default, return immediately after registration.