harpy.io.phenocycler#
- harpy.io.phenocycler(path, image_name='image', to_coordinate_system='global', to_micron_coordinate_system=None, channel_names=None, series=None, level=0, chunks=(1, 1024, 1024), image_models_kwargs=mappingproxy({}), output=None, overwrite=False)#
Read an Akoya/Quanterix PhenoCycler QPTIFF image as a
spatialdata.SpatialDataobject.The pixel data is loaded lazily through
tifffile.imread()withreturn_as="zarr". QPTIFF metadata is read from TIFF tags and vendor XML descriptions; channel coordinates are taken from the XMLBiomarkerfield when available, falling back toName.- Parameters:
path (
str|Path) – Path to the QPTIFF file.image_name (
str(default:'image')) – Name of the image element in the returned SpatialData object.to_coordinate_system (
str(default:'global')) – Pixel coordinate system assigned to the image element.to_micron_coordinate_system (
str|None(default:None)) – Physical coordinate system assigned through a scale transform in micrometers. Defaults tof"{to_coordinate_system}_micron"when physical pixel size metadata is available.channel_names (
Sequence[str] |None(default:None)) – Optional explicit channel names. If provided, the length must match the number of channels.series (
int|None(default:None)) – TIFF series index to read. IfNone, the first non-RGBCYX-like series is selected.level (
int(default:0)) – Pyramid level to read. Defaults to full resolution.chunks (
str|tuple[int,...] |int|None(default:(1, 1024, 1024))) – Optional Dask rechunking applied before creating the SpatialData image element. Defaults to(1, 1024, 1024). PassNoneto keep the source/parser chunking.image_models_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Additional keyword arguments passed tospatialdata.models.Image2DModel.parse(). Ifscale_factorsis omitted, a size-based default is used. Pass{"scale_factors": None}to opt out.output (
str|Path|None(default:None)) – Optional path where the resulting SpatialData object should be written.overwrite (
bool(default:False)) – Whether to overwriteoutputwhen writing a backed SpatialData object.
- Return type:
- Returns:
: A SpatialData object containing one image element.
Notes
The returned unbacked object points lazily at the QPTIFF file. The underlying
ZarrTiffStoreis suitable for local Dask execution but is not pickleable; write tooutputfirst when a durable Zarr-backed SpatialData object or distributed execution is needed.