imctoolkit.MultichannelImage¶
-
class
MultichannelImage
(data, channel_names=None)¶ Functionality for processing multi-channel images
- Variables
data – raw image data, as
xarray.DataArray
with dimensions(c, y, x)
and, optionally, channel names as coordinate for thec
dimension
-
__init__
(data, channel_names=None)¶
-
property
width
¶ Image width in pixels
- Return type
int
-
property
height
¶ Image height in pixels
- Return type
int
-
property
num_channels
¶ Number of channels
- Return type
int
-
property
channel_names
¶ Channel names
- Return type
List
[str
]
-
copy
()¶ Creates a copy of the current instance
- Return type
MultichannelImage
- Returns
a deep copy of the current instance
-
write_ome_tiff
(path, **kwargs)¶ Writes an OME-TIFF file using
xtiff.to_tiff()
Note that the written OME-TIFF file will not be identical to any OME-TIFF file from which the current instance was potentially created initially.
-
classmethod
read
(path, **kwargs)¶ Creates a new
MultichannelImage
from the specified fileThe file type is determined based on the file extension.
- Parameters
- Return type
MultichannelImage
- Returns
a new
MultichannelImage
instance
-
static
read_imc_txt
(path, channel_names_attr='channel_names')¶ Creates a new
MultichannelImage
from the specified Fluidigm(TM) TXT fileUses
imctools.io.txt.txtparser.TxtParser
for reading .txt files.- Parameters
- Return type
MultichannelImage
- Returns
a new
MultichannelImage
instance
-
static
read_imc_mcd
(path, acquisition_id, channel_names_attr='channel_names')¶ Creates a new
MultichannelImage
from the specified Fluidigm(TM) MCD fileUses
imctools.io.txt.mcdparser.McdParser
for reading .mcd files.- Parameters
- Return type
MultichannelImage
- Returns
a new
MultichannelImage
instance
-
static
read_tiff
(path, panel=None, panel_channel_index_col=None, panel_channel_name_col='channel_name', channel_names=None, ome_channel_name_attr='Name')¶ Creates a new
MultichannelImage
from the specified TIFF/OME-TIFF fileUses
tifffile.TiffFile
for reading .tiff files. When reading an OME-TIFF file andpanel
is not specified, the channel names are taken from the embedded OME-XML.- Parameters
path¶ (tifffile.TiffFile path-argument) – path to the .tiff file
panel¶ (None, pandas.DataFrame or pandas.read_csv path-argument) – panel that maps channel indices to channel names. If specified, overrides channel names extracted from OME-XML and acts as a channel selector.
panel_channel_index_col¶ (
Optional
[str
]) – channel index column in panel, or None for defaulting to range(n_channels)panel_channel_name_col¶ (
str
) – channel name column in panelchannel_names¶ (
Optional
[Sequence
[str
]]) – channel names, matching the number of image channels. If specified for OME-TIFFs or together withpanel
, acts as a channel selector.ome_channel_name_attr¶ (
str
) – name of the OME-XML Channel element attribute from which the channel names will be taken, see https://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2016-06/ome.html.
- Return type
MultichannelImage
- Returns
a new
MultichannelImage
instance