Skip to main content

No project description provided

Project description

CellPatchExtraction

Example Image of Patches

Overview

This repository contains code for extracting single-cell patches from microscopic images. The primary objective is to facilitate the analysis of cellular structures and their properties.

Features

  • Extracts single-cell patches from microscopic images
  • Utilizes advanced image processing techniques
  • Offers an example notebook for quick implementation

Requirements

Installation

Clone the repository:

git clone https://github.com/SimonBon/CellPatchExtraction.git

Install the required packages:

Either install the packages in an existing enironment or create a new one using:

cd CellPatchExtraction

conda create -n CellPatches python=3.9
conda activate Cellpatches

pip install -r requirements.txt

Usage

Basic Usage

Run the example notebook Example.ipynb to get started.

Advanced Usage

For more control, you can directly use the extraction.py script located in the src directory.

from CellPatchExtraction import extraction
from plotutils import gridPlot #used for visualization

image_path = "path_to_TIFF_image" # or already loaded image as np.ndarray
model = "path_to_model" # or CellposeModel or one of "CP_TU" or "CP_BM"
diameter = 50 # set mean size of nuclei
min_size = 400 # set minimum size of nuclei, everything below will be discarded
patch_size = 32 # define size of patches
nuclear_channel = 38 # if image has more than 3 channels, define which channel should be used for segmentation

patches = extract_patches(image, model, cellpose_kwargs={"diameter": diameter, "min_size": min_size}, patch_size=32, nuclear_channel=38)

gridPlot(patches)

Contributing

Feel free to open issues or submit pull requests.

License

This project is licensed under the MIT License.

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

CellPatchExtraction-1.24.tar.gz (73.7 MB view details)

Uploaded Source

Built Distribution

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

CellPatchExtraction-1.24-py3-none-any.whl (73.7 MB view details)

Uploaded Python 3

File details

Details for the file CellPatchExtraction-1.24.tar.gz.

File metadata

  • Download URL: CellPatchExtraction-1.24.tar.gz
  • Upload date:
  • Size: 73.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for CellPatchExtraction-1.24.tar.gz
Algorithm Hash digest
SHA256 26fca2cfbbf728e6281fd0ec3c9ec68ffbb137597c8c206824a6a9ea560afc7f
MD5 fb6b9647260538372e65ecc6317fd6e7
BLAKE2b-256 81ca0e5ed2651077ad929e6515d44bfc982ce94273d45103d2e7e23eb3de5dcd

See more details on using hashes here.

File details

Details for the file CellPatchExtraction-1.24-py3-none-any.whl.

File metadata

File hashes

Hashes for CellPatchExtraction-1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 f7c6adba7cccf736e9d5d294cfbed46ee4f072f03a5c55ce991e88c06e477cd6
MD5 b7d9a24251c1934dede4cc7e92516f0e
BLAKE2b-256 f94e247de690161f0c685cf0c3b9411064ac2c6a1caad142322a3133bae08360

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