A package for working with Perkin Elmer/Akoya Biosciences QPTIFF files
Project description
QPTiffFile
A Python package for working with .qptiff files which are used in multiplexed fluorescence imaging.
Overview
QPTiffFile provides tools for reading, processing, and analyzing QPTIFF image files. The package offers:
- Automatic extraction of biomarker/fluorophore information
- Memory-efficient tools for extracting regions of interest from large images
- Support for multi-channel and multi-resolution imagery
Basic Usage
from qptifffile import QPTiffFile
# Open a QPTIFF file
qptiff = QPTiffFile('example_image.qptiff')
# Display available biomarkers
print(qptiff.get_biomarkers())
# Print summary of all channels
qptiff.print_channel_summary()
# Read specific biomarker channels
dapi_image = qptiff.read_region('DAPI')
cd8_image = qptiff.read_region('CD8')
# Read multiple biomarkers
markers = qptiff.read_region(['DAPI', 'CD8', 'PD-L1'])
Installation
From PyPI
pip install qptifffile
From Source
git clone https://github.com/grenkoca/qptifffile.git
cd qptifffile
pip install -e .
System Requirements
For full functionality including compressed TIFF support, you'll need:
macOS
# For Apple Silicon
brew install libaec
# For Intel Macs
brew install libaec
note: on Apple Silicon chips, you may need to install libaec via conda: https://anaconda.org/conda-forge/libaec/
Linux
# Ubuntu/Debian
sudo apt-get install libaec-dev
# CentOS/RHEL
sudo yum install libaec-devel
Dependencies
Core dependencies:
- tifffile
- numpy
Optional dependencies:
- imagecodecs (recommended for compressed TIFF support)
Usage Examples
See this link for publicly available PhenoCycler data:
# Or, pull an image directly:
wget https://downloads.openmicroscopy.org/images/Vectra-QPTIFF/perkinelmer/PKI_scans/LuCa-7color_Scan1.qptiff
Working with Regions of Interest
In [1]: from qptifffile import QPTiffFile
In [2]: f = QPTiffFile('../Phenocycler/Data/slides/Scan1.qptiff')
In [3]: f.read_region('DAPI')
Out[3]:
memmap([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
...,
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=uint8)
You can also do more complex calls by specifying:
a set of multiple channels by name (layers)
various x/y locations (pos) or subregions (shape)
different downsampled levels in the image pyramid (level)
# Note, if your stains are named, you can refer to tehm as
In [4]: f.read_region(
...: layers=['DAPI', 'FITC', 'Texas Red'],
...: pos=(500, 1000),
...: shape=(500, 500),
...: level=2
...: )
# Will be a (x, y, # stains) array
Out[4]:
array([[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[5, 0, 0],
[2, 0, 0],
[1, 0, 0]],
[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[1, 0, 0],
[1, 0, 0],
[1, 0, 0]]], dtype=uint8)
[output truncated by user]
and the memmap objects can be easily plugged into other methods that accept array-like objects, such as displaying in matplotlib:
In [5]: import matplotlib.pyplot as plt
In [5]: img = f.read_region(
...: layers=['DAPI'],
...: shape=(500, 500),
...: level=4)
In [6]: plt.imshow(img, cmap='gray')
Out[6]: <matplotlib.image.AxesImage at 0x12bcc8cb0>
In [7]: plt.show()
Citation
If you use this software in your research, please cite:
@software{qptifffile,
author = {Grenko, Caleb},
title = {QPTiffFile: A Python package for working with Vectra/Akoya QPTIFF files},
url = {https://github.com/grenkoca/qptifffile},
year = {2025},
}
Contact
The best way to get in touch is via email: grenko.caleb (at) mayo.edu
Acknowledgments
- Based on the excellent tifffile library by Christoph Gohlke
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qptifffile-0.0.2.tar.gz.
File metadata
- Download URL: qptifffile-0.0.2.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2ff3c6d3cce61c47d33e4784254874becccf097b6b011dedc30b712ba5e31e9
|
|
| MD5 |
862bcff2f93ffba99f4f1a1ed42407ca
|
|
| BLAKE2b-256 |
3b475ba1076a5fc9140c23a30d0c1c947c45ab7c798b9ff01bc41709c56ea1f8
|
Provenance
The following attestation bundles were made for qptifffile-0.0.2.tar.gz:
Publisher:
python-publish.yml on grenkoca/qptifffile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qptifffile-0.0.2.tar.gz -
Subject digest:
c2ff3c6d3cce61c47d33e4784254874becccf097b6b011dedc30b712ba5e31e9 - Sigstore transparency entry: 738092170
- Sigstore integration time:
-
Permalink:
grenkoca/qptifffile@0b2edcf6de1012e3ed8762ad8cbf0e43a19e03b8 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/grenkoca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0b2edcf6de1012e3ed8762ad8cbf0e43a19e03b8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file qptifffile-0.0.2-py3-none-any.whl.
File metadata
- Download URL: qptifffile-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9626ab145361a96afbb301b0425f3d1b145f198eca49487565eae4fb900d5dd
|
|
| MD5 |
a800662bfc602aed99526b940e48e3a8
|
|
| BLAKE2b-256 |
4a8981348d003d263241e6f079e9f262da5e9116adc6bd7d54aaec4fbfc396f4
|
Provenance
The following attestation bundles were made for qptifffile-0.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on grenkoca/qptifffile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qptifffile-0.0.2-py3-none-any.whl -
Subject digest:
a9626ab145361a96afbb301b0425f3d1b145f198eca49487565eae4fb900d5dd - Sigstore transparency entry: 738092173
- Sigstore integration time:
-
Permalink:
grenkoca/qptifffile@0b2edcf6de1012e3ed8762ad8cbf0e43a19e03b8 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/grenkoca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0b2edcf6de1012e3ed8762ad8cbf0e43a19e03b8 -
Trigger Event:
release
-
Statement type: