PyHistology is a package for color space segmentation of a user-uploaded 2D RGB image using the PyHistology package. It uses colorspace-based segmentation to analyze histopathology images. With the help of this package, you can easily calculate the amount of staining present in histopathology images. The application is also available as a Streamlit app and provides an interactive user interface.
- Python 3.7 or higher
- Streamlit library
- numpy
- cv2
- PIL
- scikit-image
- matplotlib
- Install Python 3.7 or higher
- Install the required packages:
pip install streamlit numpy opencv-python-headless pillow scikit-image matplotlib
A web application developed using Streamlit is available at https://pyhistology.streamlit.app/
- Clone the repository or download the source code
- Navigate to the project directory and run the following command:
streamlit run PyHistology_StreamlitApp.py
- The application will open in your default web browser. Upload a 2D RGB image to be analyzed and refer to the Hue and Saturation plot to estimate the Hue and Saturation co-ordinates of the desired color to be extracted. Use the sliders to adjust the threshold value, Hue, Saturation, and Value parameters for the lower and upper bound of the desired color. Click on the "Analyze" button to initiate the segmentation process.
- The application will display the uploaded image, the HSV image, and the isolated pixels from the uploaded image. The isolated pixels are highlighted with a white color, and the percentage of the image area covered by the isolated pixels is displayed in the title of the output image.
This application is licensed under the GNU Affero General Public License, Version 3. See the LICENSE file for more information.