Skip to main content

A package to convert a multiplex image to a virtual blightfield image such as H&E or IHC. Both the input and output are in OME-TIFF file format.

Project description

multiplex2brightfield

multiplex2brightfield is a Python package that converts multiplex imaging data (such as imaging mass cytometry) into virtual brightfield images, such as Hematoxylin & Eosin (H&E) or Immunohistochemistry (IHC) images. The input and output are both handled in OME-TIFF file format, allowing seamless integration into bioimaging workflows.

Features

  • Convert Multiplex Images to Virtual Brightfield: Convert complex multiplex images to virtual brightfield formats such as H&E.
  • OME-TIFF Input/Output: The package supports OME-TIFF file format for both input and output, preserving metadata and structure.
  • Marker-based Channel Identification: Identify relevant channels for nuclear, cytoplasmic, and other staining components (e.g., haematoxylin, eosin, etc.) based on channel names.
  • Customizable Filters: Apply customizable median and Gaussian filters to different color channels.
  • Histogram Normalization: Optionally apply histogram normalization to the haematoxylin and eosin channels to adjust contrast.
  • Optional Pyramid Creation: Generate a multi-resolution pyramid in OME-TIFF format for efficient visualization of large datasets.

Installation

Clone the repository and install the required dependencies by running the following command:

pip install multiplex2brightfield

Usage

Here is an example of how to use the multiplex2brightfield package to convert a multiplex image to a virtual H&E-stained image:

from multiplex2brightfield import convert

# Input and output file paths
input_filename = "input_image.ome.tiff"
output_filename = "output_virtual_HE.ome.tiff"

# Call the conversion function
convert(
    input_filename=input_filename,
    output_filename=output_filename,
    show_haematoxylin=True,
    show_eosin1=True,
    show_eosin2=True,
    show_blood=True,
    show_marker=False
)

Parameters

  • input_filename (str): Path to the OME-TIFF file containing the multiplex image.
  • output_filename (str): Path where the converted virtual brightfield image will be saved in OME-TIFF format.
  • show_haematoxylin, show_eosin1, show_eosin2, show_blood, show_marker (bool): Flags to control which stains appear in the output.
  • histogram_matching (bool): Enable or disable histogram matching based on a reference image (optional).
  • apply_filter (bool): Apply filtering to specific channels (optional).

Customization

The package allows for extensive customization, including adjusting which channels are visualized, applying filters, and performing histogram normalization.

Example with Histogram Matching

convert(
    input_filename=input_filename,
    output_filename=output_filename,
    reference_filename="reference_image.jpg",
    histogram_matching=True,
)

Contributing

Contributions to multiplex2brightfield are welcome! Feel free to fork the repository, make your changes, and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

multiplex2brightfield-0.1.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file multiplex2brightfield-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for multiplex2brightfield-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0499bf26769aaf5b1bdbe1ffa036154d2de72aad1adaea6708e3a6efbafba145
MD5 5d4ea6d021c706fb39e95eeb0a156bed
BLAKE2b-256 a786d6f697fcd715c82f523a9465c7d7d75951d77b50c5b16e070a5c6243ac2b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page