ValidPath
is a python-based package for developers and scientists who are interested in digital pathology. The main goal of developing this tool is to help stakeholders, graduate students, and pathologists to speed up their projects. For more information please contact: seyed.kahaki@fda.hhs.gov.
We are continuously working on this toolbox, and we welcome any contributions.
There are several modules in this package including
- WSI Handler: Includes functions and classes for general WSI analysis such as reading whole slide images, extract sub region, and visualize thumbnail.
- Annotation Extraction: Includes several functions for extracting annotated ROIs.
- Patch Extraction: Assists pathologists and developers in extracting image patches from a whole slide image's region of interest.
- Annotation File Generator: Maps ROIs back into the image scope visualizer for the pathologist validation process
- Performance Assessment: Includes different modules for assessing the performance of ML models.
Code Documentation: Link Please refer to the code documentation and email seyed.kahaki@fda.hhs.gov if you have any questions.
- WSI Reader: Read Whole slide Image, Extract WSI Regions
- Extract Annotations: Extract annotations and masks from Whole Slide Images
- Patch Extraction: Extract patch images from annotated regions
- Annotation Generator: Generate Aperio ImageScope Annotation file
- Performance Assessmet: including different methods for assessing the performance of ML models
This section will help you to install the packages needed for ValidPath.
If you wish to use our python package, perhaps without developing them further, run the command pip install ValidPath or pip install --ignore-installed --upgrade ValidPath to upgrade from an existing installation (This will be enabled when the first version is ready and submitted to pypi).
Detailed installation instructions can be found in the [documentation](Link to Installation Guide dependencies To understand better how the programs work, study the jupyter notebooks referred to under the heading Examples Taster.
In order to use ValidPath, you need to install some additional python packages. It is recommended to install the same version specified in this section (and in the requirement.txt). ValidPath was tested on the following environment:
- Linux System (Tested on Ubuntu 18.04.3 LTS)
- Python 3.8
To install a python package with specific version of a package using pip, you can use the syntax “pip install package==version” in the command line. For example in ValidPath we are using lxml which is one of the fastest and feature-rich libraries for processing XML and HTML in Python. To install lxml version 4.9.1, run the following command:
pip install lxml==4.9.1
Please follow the same procedure to install these python packages:
• lxml==4.9.1
• opencv-python==4.8.1.78
• openslide-python==1.1.2
• scikit-image==0.18.1
• Shapely==1.7.1
• sharepy==2.0.0
• matplotlib==3.6.2
• Pillow==9.3.0
• tifffile==2022.10.10
• mpmath==1.2.1
• random
• glob
• pandas
• numpy
For the full list of the requirements, please see the requirement.txt file in the project root directory
In order to check the current package version installed on you system, you can use “pip freeze” or “.version” as follows:
pip freeze | findstr lxml
or
import lxml
print(lxml.__version__)
Prepare a computer as a convenient platform for further development of the Python package ValidPath and related programs as follows.
- Install the dependencies based on this guide (Link to Installation Guide dependencies)
- Open a terminal window
$ cd ValidPath ROOT DIRECTORY
- Download a complete copy of the ** ValidPath **.
$ git clone https://github.com/didsr/ValidPath/
- Change directory to ValidPath
$ cd ValidPath
- Create virtual environment for ** ValidPath** using
$ conda env create -f requirements.dev.conda.yml
$ conda activate ValidPath-dev
or
$ conda create -n ValidPath-dev python=3.8
$ conda activate ValidPath-dev
$ pip install -r requirements.txt
- To use the packages installed in the environment, run the command:
$ conda activate ValidPath-dev
If you find that ValidPath is useful or if you use it in your project, please consider citing the code:
Seyed Kahaki, Arian Arab, Weijie Chen. (2024) ValidPath [Source Code] https://github.com/didsr/ValidPath
And this pape:
@article{10.1117/1.JMI.11.1.017502,
author = {Seyed Mostafa M. Kahaki and Ian S. Hagemann and Kenny H. Cha and Christopher J. Trindade and Nicholas A. Petrick and Nicolas Kostelecky and Lindsay E. Borden and Doaa Atwi and Kar-Ming Fung and Weijie Chen},
title = {{End-to-end deep learning method for predicting hormonal treatment response in women with atypical endometrial hyperplasia or endometrial cancer}},
volume = {11},
journal = {Journal of Medical Imaging},
number = {1},
publisher = {SPIE},
pages = {017502},
keywords = {mixed supervised learning, deep learning, hormonal treatment, atypical endometrial hyperplasia, Data modeling, Deep learning, Education and training, Feature extraction, Performance modeling, Machine learning, Radiomics, RGB color model, Tumor growth modeling, Statistical modeling},
year = {2024},
doi = {10.1117/1.JMI.11.1.017502},
URL = {https://doi.org/10.1117/1.JMI.11.1.017502}
}
Example of input data can be found here: Link.
For any questions/suggestions/collaborations, please contact Seyed Kahaki either via this GitHub repo or via email (seyed.kahaki@fda.hhs.gov).
This project was supported in part by an appointment to the ORISE Research Participation Program at the Center for Devices and Radiological Health, U.S. Food and Drug Administration, administered by the Oak Ridge Institute for Science and Education through an interagency agreement between the U.S. Department of Energy and FDA/CDRH.