histopatch: image patch extraction from Whole Slide Images
Project description
Overview
histo_patch is a python library to extract patches from annotated region in WSI files (Hamamatsu .ndpi or Aperio .svs). Hamamatsu .ndpa and QuPath .geojson annotation files are supported.
Installation
The package can be installed with pip:
$ pip install histo-patch
To run histo_patch, simply run below from console:
$ histopatch [something]
Usage:
Usage: histopatch [OPTIONS] PATH_TO_WSI PATH_TO_SAVE_DIRECTORY
Options:
-a, --annotation_type [ndpa|qupath]
file type of annotation (ndpa or qupath
(GeoJSON(Pretty JSON)))
-s, --annotation_shape [all|line|area]
annotation shape (all, line, area)
-c, --color TEXT used colors (white,black,red,green,blue,cyan
,magenta,yellow) in annotation for ndpa or (
None,Tumor,Stroma,Immune_cells,Necrosis,Othe
r,Region,Ignore,Positive,Negative) for
QuPath
--line_as_area line annotation in ndpa file is treated as
closed area
--src_size FLOAT patch size in the original WSI
-m, --micrometer specify src_size in micrometer
(default:pixels)
--patch_size INTEGER output patch size
--num_patch INTEGER number of patches for each annotation shape
--nparent INTEGER number of parent directories kept in the
output
--help Show this message and exit.
Prerequisites
Python version 3.6 or newer.
tifffile >=2022.5.4
numpy >=1.20.3
tripy >=1.0.0
pyclipper >=1.3.0
opencv-python >= 4.6.0
zarr >=2.11.3
magecodecs >=2022.2.22
click >=8.1.3
Recommended Environment
- OS
Linux
Mac
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
histo-patch-0.95.tar.gz
(15.6 kB
view details)
Built Distribution
File details
Details for the file histo-patch-0.95.tar.gz
.
File metadata
- Download URL: histo-patch-0.95.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b4a963da0c01d97cc87e23b6df2458320b0cdc3aebc31b9b068151f3a7e597a |
|
MD5 | c11d60c8b3d0648f3ab7ab949e0f393d |
|
BLAKE2b-256 | 358c3e5fc4199c0d36ceb24bed7a7c55259bdf0831af614fe8a146efe5d6fa94 |
File details
Details for the file histo_patch-0.95-py3-none-any.whl
.
File metadata
- Download URL: histo_patch-0.95-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9104ab562dba6cd2777679d0c196e7bef5c4e5aa35f7fa473a6edbf7aed6cf02 |
|
MD5 | c4d94dfe66d0651e2113b4a645c10518 |
|
BLAKE2b-256 | acdd2a34e03cbc1561ebc0e5cebf17c79fa45202244cd480851f7d2c9c4960de |