Skip to main content

No project description provided

Project description

FISHPainter

logo

Overview

FISHPainter is a Python library designed for image processing and generation, specifically tailored for FISH (Fluorescence In Situ Hybridization) images. The library offers a wide range of functionalities, from preprocessing TIFF images, merging bounding boxes based on overlap criteria, to providing an end-to-end workflow for generating a synthetic dataset based on user-defined criteria. It includes a library of DAPI-stained images of fluorescence microscopy nuclei [1].

FISHPainter as of now only supports the creation of FISH probes used for the assessment of copy number, but future functionality is planned for ALT and Break-Apart probes.

Features

  • Create Synthetic Dataset: This feature enables the creation of a synthetic dataset using either a user-defined library for cell backgrounds or the provided library. See create.py for details. An overview of its usage is provided in the Notebook.
  • Preprocessing: Functions for reading TIFF images and normalizing them are available at preprocess.py.
  • Bounding Boxes: Functions to decide if two bounding boxes should be merged and to merge bounding boxes for a given label can be found at process_boxes.py.
  • Signal Generation: Functions for creating FISH images and their signal creation procedure can be found in signals.py.

Installation

To install the library, you can use pip or clone the repository and install the required packages.

pip install FISHPainter

or

git clone https://github.com/SimonBon/FISHPainter.git
cd FISHPainter
pip install -r requirements.txt

Creation of Synthetic Dataset

The first and most important step is to define a configuration file that specifies the different appearance types of FISH images you wish to create. The configuration file can omit any parameters (num_red, num_red_cluster, red_cluster_size, num_green, num_green_cluster, green_cluster_size) which will default to 0. These parameters can be specified as either a list of two entries (defining the low and high value from which FISHPainter will randomly choose for the creation of individual instances) or as an integer. The number parameter is essential to define how many instances of this condition you want to create. The target_class parameter is used when creating a h5 file to assign each patch a class, which might be used to train classification models.

#definition of each condition and its parameters individually
CONDITION_0:                # Name is variable
  number: 100               # integer

  target_class: 0           # integer
#red definition
  num_red: [2, 3]           # [low, high] or number
  num_red_cluster: [1, 2]   # [low, high] or number
  red_cluster_size: [5, 10] # [low, high] or number

#green definition
  num_green: 2              # [low, high] or number
  num_green_cluster: 1      # [low, high] or number
  green_cluster_size: 6     # [low, high] or number
  
  signal_size: [1, 2]       # [low, high] or number


#definition of second condition
CONDITION_1:                # Name is variable
  number: 100               # integer

  target_class: 1           # integer
#red definition
  num_red: 2                # [low, high] or number
  num_red_cluster: 0        # [low, high] or number
  red_cluster_size: 0       # [low, high] or number

#green definition
  num_green: [6, 10]        # [low, high] or number
  num_green_cluster: 0      # [low, high] or number
  green_cluster_size: 0     # [low, high] or number
  
#size definition
  signal_size: 1            # [low, high] or number

Using this config file, you can create the synthetic dataset using the following lines of code:

from FISHPainter.src.datasets.create import create_dataset
from FISHPainter.src.utils.utils import save2h5

config_file = PATH_TO_YOUR_CONFIG
output_h5_file = PATH_TO_H5_OUTPUT

dataset = create_dataset(config_file, FISH_type="COPY_NUMBER", verbose=True)

save2h5(dataset, output_h5_file)

An example of this can be viewed in the provided Notebook.

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

FISHPainter-0.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FISHPainter-0.2-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file FISHPainter-0.2.tar.gz.

File metadata

  • Download URL: FISHPainter-0.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for FISHPainter-0.2.tar.gz
Algorithm Hash digest
SHA256 f6c11589d307b6ea15f8cf8961e0a1c7e73463f2b5f58e36c3fdf032ad91f5aa
MD5 4fa0bc17100b0f8159ae9db63e9e5151
BLAKE2b-256 9e2872e9f0faa77bbbaf0fc4eff7bde3c2f6aae2b381cf8678b16e42732ee83a

See more details on using hashes here.

File details

Details for the file FISHPainter-0.2-py3-none-any.whl.

File metadata

  • Download URL: FISHPainter-0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for FISHPainter-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b15ce69aa595a762d650032f2ffd19f222c4b4a4dabc684568576cc53e1fe6c
MD5 d7a649354ab1c93f947fbf99d8b7f716
BLAKE2b-256 04401c38e54fa6d1ec681dc0b164d6b1971ded4a36f1af38c498164ce540828c

See more details on using hashes here.

Supported by

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