No project description provided
Project description
FISHPainter
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
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
File details
Details for the file FISHPainter-0.1.tar.gz
.
File metadata
- Download URL: FISHPainter-0.1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84558a8624025c11ee5ea6da39d3ffa3b2928a88bcfee27721c0e5d90635e457 |
|
MD5 | 9d9271ee768942e14f6167736d9f5a46 |
|
BLAKE2b-256 | f5b884ab59015931d8064fe963f49395732f9d552b7068fff12a196ba7efa3ae |
File details
Details for the file FISHPainter-0.1-py3-none-any.whl
.
File metadata
- Download URL: FISHPainter-0.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb68105663894a590686dbcea142f618baa8dcc0950a89f615657f314849dfff |
|
MD5 | f75c16f513c8e62a923b410b585d942d |
|
BLAKE2b-256 | cb33d5a3837ead00a265de2755299f4de974cee552666b191e9e10554320c1a8 |