harpy.io.macsima#
- harpy.io.macsima(path, image_name=None, to_coordinate_system=None, c_subset=None, remove_bleached=True, remove_dapi=True, include_roi_id_in_channel_name=True, imread_kwargs=mappingproxy({}), image_models_kwargs=mappingproxy({}), output=None, overwrite=False)#
Read MACSima formatted dataset.
This function reads images from a MACSima cyclic imaging experiment.
The channel names will follow the following format: cycle_scantype_channelname_roiid_reagent (or cycle_scantype_channelname_reagent if
include_roi_id_in_channel_name=False).The pixel coordinate system is added as either the provided
to_coordinate_systemor, by default, global_roiid (if ROI metadata is available) or global (if ROI metadata is not available). The micron coordinate system is always added as the pixel coordinate system with suffix _micron.See also
- Parameters:
path (
str|Path|list[str] |list[Path]) – Path, or list of paths, to the directory/directories containing the data. The function searches recursively for preprocessed.tiffiles under each path (subdirectories allowed) as generated by MACS IQ VIEW. All files discovered for a single path are expected to belong to the same ROI.c_subset (
list[str] (default:None)) – Channel names to consider. Elements ofc_subsetthat are in one ofcycle_scantype_channelname_roiid_reagent, will be considered (orcycle_scantype_channelname_reagentifinclude_roi_id_in_channel_name=False). E.g ifc_subset=['DAPI']andcycle_scantype_channelname_roiid_reagent = 01_B_DAPI_001_DAPI, then channel01_B_DAPI_001_DAPIwill be retained.image_name (
str|Iterable[str] |None(default:None)) – Name of the resulting image element. IfNone, the name is inferred from OME metadata. Ifpathcontains multiple entries,image_namemust be a list with the same length.to_coordinate_system (
str|Iterable[str] |None(default:None)) – Target coordinate system name(s) for the resulting image element(s). IfNone, defaults toglobal_<roi_id>when ROI metadata is available, otherwiseglobal. Ifpathcontains multiple entries,to_coordinate_systemmust be a list with the same length.remove_bleached (
bool(default:True)) – If set toTruewill remove all channels of scantype'B'(=bleached).remove_dapi (
bool(default:True)) – If set toTruewill remove all dapi channels for which cycle number>0.include_roi_id_in_channel_name (
bool(default:True)) – If set toFalsewill omit the ROI ID from channel names.imread_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Keyword arguments passed tobioio.BioImage.image_models_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Keyword arguments to pass to the image models. E.g. “chunks” or “scale_factors”.output (
str|Path|None(default:None)) – The path where the resultingSpatialDataobject will be backed. IfNone, it will not be backed to a zarr store.overwrite (
bool(default:False)) – If set toTruewill overwrite the zarr store atoutput. Ignored if output isNone.
- Return type:
- Returns:
Examples
>>> sdata = macsima( ... path="path/to/roi_folder", # recursively loads all .tif in this ROI, one image element ... c_subset=["DAPI", "CD43"], ... image_models_kwargs={"chunks": (1, 3000, 3000)}, ... ) >>> sdata = macsima( ... path=["path/to/roi_folder", "path/to/another_roi_folder"], # two ROI folders -> two image elements ... c_subset=["DAPI", "CD43"], ... image_models_kwargs={"chunks": (1, 3000, 3000)}, ... )