Skip to content

Histopathological image processing and segmentation

License

Notifications You must be signed in to change notification settings

eDIMESLab/dermas

Repository files navigation

Author Project Documentation Build Status
N. Curti
E. Giampieri
dermas docs Linux/MacOS : travis
Windows : appveyor

GitHub pull-requests GitHub issues

GitHub stars GitHub watchers

Dermatological Melanoma Analysis and Segmentation - DERMAS

Histopathological image analyses for melanoma classification and segmentation.

The project has been developed in collaboration with the Sant'Orsola Hospital of Bologna and in particular with the Dermatological research group of this hospital.

  1. Installation
  2. Authors
  3. License
  4. Contributions
  5. Acknowledgments
  6. Citation

Installation

First of all ensure that a right Python version is installed (Python >= 3.5 is required). The Anaconda/Miniconda python version is recommended.

Download the project or the latest release:

git clone https://github.com/eDIMESLab/dermas
cd dermas

To install the prerequisites type:

pip install -r ./requirements.txt

In the dermas directory execute:

python setup.py install

or for installing in development mode:

python setup.py develop --user

Usage

The project aims to analyze SVS images for the detection and classification of melanoma areas. This package includes a pipeline of processing developed using Snakemake for a granular parallelization of the different tasks.

The dermas package includes multiple step of analysis:

  • splitter.py: starting from a set of manually annotated SVS images, the first step is the generation of the dataset into a series of patches (original patch + annotated patch). This step was developed starting from the SlideSeg Python package with some reviews and optimizations. Using the splitter.py file we unpack each level of a given SVS image (original image) into a series of patches. Associated to the SVS image an annotation file must be provided in format .xml (or .roi if you use old version of Seeden Viewer for the annotations). The .xml file (annotated image) creates the corresponding annotated patches. For sake of storage minimization we save only patches which include a signal (at least on pixel of the annotated part).

  • refine_mask.py: each saved patch is re-processed to refine the annotated mask and exclude artifacts or incorrect labels. NOTE: pay attention to the COLORS variable at the beginning of this script! It defines the series of valid colors. Each color not included in this list is associated to the nearest one of them.

  • counting_mask.py: count the labels found in each patch and generate a useful database. To each patch filename we save a boolean list of the included colors (1 if there is a color and 0 otherwise). In this way we can use this generated database to perform the next analyses only on the subset of interest.

All these steps can be run into a sequential pipeline using the derma_pipeline.sh (for MacOS/Linux users) and derma_pipeline.ps1 (for Windows users).

./derma_pipeline.sh ./slices/ ./labels/

We encourage to perform all the analyses using the provided Snakefile. In this way all the described above steps are performed in the most efficient way. Moreover we can parallelize our pipeline to the full series of available images/annotations. Before use it take care to modify the config.yaml according to your needs and your folders tree.

Example:

snakemake -j32

an example of the Snakefile workflow can be seen here

Authors

See also the list of contributors GitHub contributors who participated in this project.

License

The dermas package is licensed under the MIT "Expat" License. License

Contributions

Any contribution is more than welcome. Just fill an issue or a pull request and I will check ASAP!

If you want update the list of layer objects please pay attention to the syntax of the layer class and to the names of member functions/variables used to prevent the compatibility with other layers and utility functions.

Acknowledgments

Thanks goes to all contributors of this project.

Citation

Please cite dermas if you use it in your research.

@misc{dermas,
  author = {Enrico Giampieri and Nico Curti},
  title = {Dermatological Melanoma Analysis and Segmentation},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/eDIMESLab/dermas}},
}