Skip to main content

HipoMap

Powered by Paper

PyPI - Python Version PyPI PyPI - Downloads PyPI - License

HipoMap_Logic HipoMap_howtomakeHM

HipoMap is slide-based histopathology analysis framework in which a disease-specific graphical representation map is generated from each slide. Further, HipoMap, which is a small and fixed size, is introduced as input for machine-learning models instead of extremely large and variable size WSI. HipoMap is obtained using gradients of patch probability scores to represent disease-specific morphological patterns. Proposed HipoMap based whole slide analysis has outperformed current state-of-art whole slide analysis methods. We assessed the proposed method on Lung Cancer WSI images and interpreted the model based on class probability scores and HipoMap scores. A pathologist clinically verified the results of interpretation.

It provides:

  • a powerful ...
  • ...

Dependencies

OpenSlide

OpenSlide is a C library that provides a simple interface to read whole-slide images (also known as virtual slides). The current version is 3.4.1, released 2015-04-20.

For Linux (Fedora), you can install latest version of OpenSlide by running following commands from terminal:

$ dnf install openslide

For Linux (Debian, Ubuntu), you can install latest version of OpenSlide by running following commands from terminal:

$ apt-get install openslide-tools

For Linux (RHEL, CentOS), you can install latest version of OpenSlide by running following commands from terminal:

$ yum install epel-release
$ yum install openslide

For MacOSX, you can install latest version of OpenSlide by running following commands from terminal:

$ brew install openslide

For Window, you can install latest version of OpenSlide:

https://openslide.org/download/#windows-binaries

Installation

Latest PyPI stable release

PyPI PyPI - Downloads

pip install HipoMap

Dependencies+

PyPI - Python Version PyPI PyPI PyPI PyPI PyPI PyPI PyPI PyPI PyPI

Documentation

Quick Start

Generating Whole-Slide Image based representation map

# Model load

# If you want to loaded keras pre-trained model
from tensorflow.keras.applications.vgg16 import VGG16

model = VGG16()

# If you want to loaded your pre-trained model(.h5 file)
from tensorflow.keras.models import load_model

model = load_model(r'./pre_model.h5')

# Make representation map
from hipomap.core import generate_hipomap

generate_hipomap(inputpath="<path>/Dataset/", outputpath="<path>/Rep/", model=model,
                layer_name="block5_conv3", patch_size=(224, 224))

Drawing heatmap with representation map

# Draw heatmap
from hipomap.core import draw_represent

draw_represent(path="<path>/Dataset/", K=50, max_value=1000, save=False)

Classify to Cancer/Normal with representation map

In this step, you must have a baseline file(.csv) for dividing each representation map generated by train / validation / test set.

# Classify data to cancer/normal with representation map
from hipomap.core import HipoClass

hipo = HipoClass(K=50)

# 1. Split data with base(.csv) 
trainset, validset, testset = hipo.split("split.csv", dir_normal="<path>/Dataset/Normal/",
                                         dir_cancer="<path>/Dataset/Cancer")

# 2. Train the classifier
hipo_model = hipo.fit(trainset, validset, lr=0.1, epoch=20, batch_size=1)

# 3. Get prediction value
prediction = hipo.predict_with_test(test_X=testset[0])

# 4. Get score (tpr, fpr, auc)
tpr, mean_fpr, auc = hipo.evaluate_score(label=testset[1], prediction=prediction)

Generate Probmap with probability score

# Creating probability score array 
from hipomap.scoring import scoring_probmap

scoring_probmap(path_model="./pre_model.h5", path_data="./Dataset/Test/", path_save="./Result/prob_test/")

# Generating Probmap
from hipomap.probmap import generating_probmap

generating_probmap(path_data='./Dataset/Test/', path_prob='./Result/prob_test/', path_save='./Result/probmap')

Metadata

Release files for hipomap 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hipomap 1.0.2
File Size Uploaded Provenance Actions
hipomap-1.0.2.tar.gz 24.6 kB Without provenance Details for hipomap-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hipomap 1.0.2
File Interpreter ABI Platform Actions
hipomap-1.0.2-py3-none-any.whl Python 3 none any Details for hipomap-1.0.2-py3-none-any.whl

Total release size: 80.6 kB

Release files / hipomap-1.0.2.tar.gz

Download URL hipomap-1.0.2.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
258811a0327265b112b19555ab0f5dc05de9ffb36bee6448552d7f0669af9d49
BLAKE2b-256 checksum
How to use checksums
5c4ac72dd26da0edab9ee6d131380ffd25df54dd1886b5741a1cd2e703da4652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.9

Release files / hipomap-1.0.2-py3-none-any.whl

Download URL hipomap-1.0.2-py3-none-any.whl
Size 56.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05bf4e1d42a76850b24b65f88c5fd983ed0c8d9a66c74f22be1b50fc741882cc
BLAKE2b-256 checksum
How to use checksums
510e0d8799199eabf20b993ab3b80b8fe5f0e85294e3fbad68c0a7d95229a76f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.9

Security for hipomap 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page