Package: hipomap
HipoMapHipoMap 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.Website:http://dataxlab.org/hipo-mapDocumentation:https://readthedocs.org/projects/hipo-map/Source code:https://github.com/datax-lab/HipoMapIt provides:a powerful ......DependenciesOpenSlideOpenSlide 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 openslideFor Linux (Debian, Ubuntu), you can install latest version of OpenSlide by running following commands from terminal:$ apt-get install openslide-toolsFor Linux (RHEL, CentOS), you can install latest version of OpenSlide by running following commands from terminal:$ yum install epel-release
$ yum install openslideFor MacOSX, you can install latest version of OpenSlide by running following commands from terminal:$ brew install openslideFor Window, you can install latest version of OpenSlide:https://openslide.org/download/#windows-binariesInstallationLatest PyPI stable releasepip install HipoMapDependencies+DocumentationQuick StartGenerating Whole-Slide Image based representation map# Model load# If you want to loaded keras pre-trained modelfromtensorflow.keras.applications.vgg16importVGG16model=VGG16()# If you want to loaded your pre-trained model(.h5 file)fromtensorflow.keras.modelsimportload_modelmodel=load_model(r'./pre_model.h5')# Make representation mapfromhipomap.coreimportgenerate_hipomapgenerate_hipomap(inputpath="<path>/Dataset/",outputpath="<path>/Rep/",model=model,layer_name="block5_conv3",patch_size=(224,224))Drawing heatmap with representation map# Draw heatmapfromhipomap.coreimportdraw_representdraw_represent(path="<path>/Dataset/",K=50,max_value=1000,save=False)Classify to Cancer/Normal with representation mapIn 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 mapfromhipomap.coreimportHipoClasshipo=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 classifierhipo_model=hipo.fit(trainset,validset,lr=0.1,epoch=20,batch_size=1)# 3. Get prediction valueprediction=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 arrayfromhipomap.scoringimportscoring_probmapscoring_probmap(path_model="./pre_model.h5",path_data="./Dataset/Test/",path_save="./Result/prob_test/")# Generating Probmapfromhipomap.probmapimportgenerating_probmapgenerating_probmap(path_data='./Dataset/Test/',path_prob='./Result/prob_test/',path_save='./Result/probmap')