burger
burger

Reputation: 5883

extract channel names from a multi-channel image

I am using skimage.io.imread (which uses tifffile) to read a QPTIFF file. Multiple channels are successfully read as multiple dimensions. Is it possible to extract the channel names and other metadata?

Upvotes: 2

Views: 1900

Answers (1)

cgohlke
cgohlke

Reputation: 9417

PerkinElmer QPI metadata are stored as XML in the ImageDescription TIFF tags. To read the XML metadata, use the tifffile.TiffFile class, e.g.:

from xml.etree import ElementTree
from tifffile import TiffFile

with TiffFile('LuCa-7color_Scan1.tiff') as tif:
    for page in tif.series[0].pages:
        print(ElementTree.fromstring(page.description).find('Name').text)

Upvotes: 4

Related Questions