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 Distribution

multiplex2brightfield-0.1.3.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file multiplex2brightfield-0.1.3.tar.gz.

File metadata

  • Download URL: multiplex2brightfield-0.1.3.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for multiplex2brightfield-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0b2262c411e95bc0534fde1cecd287de0a0bd7154aa337d0f138406552ba0faa
MD5 8e900b28599ab34bd550b5321a492d9a
BLAKE2b-256 a9d887575658fce255c21d5d6c09f1a3ed239984e954fc1ac71e05821a933924

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multiplex2brightfield-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2f0f7bc800ccd34762b2c4de1cc7bf7f2e353cb92b1412e4b3686f4755fc41a0
MD5 3771959879a15617279e1e8679118934
BLAKE2b-256 e74393e833685a4f45f07156e9541a61d805a3ca89d642d5031022aa60818d21

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