Category Archives: Digital Histology

Converting an existing image into an Openslide compatible format

Many digital pathology tools (e.g., our quality control tool, HistoQC), employ Openslide, a library for reading whole slide images (WSI).  Openslide provides a reliable abstraction away from a number of proprietary WSI file-formats, such that a single programmatic interface can be employed to access WSI meta and image data.

Unfortunately, when smaller regions of interest, or new images, are created in tif/png/jpg formats they no longer remain compatible with OpenSlide. This blog post discusses how to take any image and convert it into an OpenSlide compatible WSI, with embedded metadata.

Continue reading Converting an existing image into an Openslide compatible format

Exporting and re-importing annotations from QuPath for usage in machine learning

Update-Nov 2020: Code has now been placed in github which enables the reading and writing of compressed geojson files at all stages of the process described below. Compression reduces the file size by approximately 93% : )

QuPath is a digital pathology tool that has become especially popular because it is both easy to use to and supports a large number of different whole slide image (WSI) file formats. QuPath is also able to perform a number of relevant analytical functions with a few mouse clicks. Of interest in this blog post is mentioning that the pathologists we tend to work with are either already familiar with QuPath, or find it easier to learn versus other tools. As a result, QuPath has become a goto tool for us for both the creation, and review of, annotations and outputs created by our algorithms.

Here we introduce a robust method using GeoJSON for exporting annotations (or cell objects) from QuPath, importing them into python as shapely objects, operating upon them, and then re-importing a modified version of them back into QuPath for downstream usage or review. As an example use case we will be looking at computationally identifying lymphocytes in WSIs of melanoma metastases using a deep learning classifier.

Continue reading Exporting and re-importing annotations from QuPath for usage in machine learning

Computationally creating a PowerPoint presentation of experimental results using Python

This post is an update of the previous post, which discussed how to create a powerpoint slide desk with results using Matlab. In the last couple of years, we have mostly transitioned to python for our digital pathology image analysis, in particular those tasks which employ deep learning. It thus makes sense to port our tools over as well. In this case, we’ll be looking at building powerpoint slide desks using python.

Let’s look at what we want as our final output:

Continue reading Computationally creating a PowerPoint presentation of experimental results using Python

HistoQC: An open-source quality control tool for digital pathology slides

crack_slidepenmark_slide

airbubble_slide

Our paper is out in: Journal of Clinical Oncology: Clinical Cancer Informatics

Purpose: Digital pathology (DP), referring to the digitization of tissue slides, is beginning to change the landscape of clinical diagnostic workflows and has engendered active research within the area of computational pathology. One of the challenges in DP is the presence of artifacts and batch effects; unintentionally introduced during both routine slide preparation (e.g., staining, tissue folding, etc.) as well as digitization (e.g., blurriness, variations in contrast and hue). Manual review of glass and digital slides is laborious, qualitative, and subject to intra/inter-reader variability. There is thus a critical need for a reproducible automated approach of precisely localizing artifacts in order to identify slides which need to be reproduced or regions which should be avoided during computational analysis.

Continue reading HistoQC: An open-source quality control tool for digital pathology slides

Digital pathology classification using Pytorch + Densenet

In this blog post, we discuss how to train a DenseNet style deep learning classifier, using Pytorch, for differentiating between different types of lymphoma cancer. This post and code are based on the post discussing segmentation using U-Net and is thus broken down into the same 4 components:

  1. Making training/testing databases,
  2. Training a model,
  3. Visualizing results in the validation set,
  4. Generating output.

Continue reading Digital pathology classification using Pytorch + Densenet

Digital Pathology Segmentation using Pytorch + Unet

In this blog post, we discuss how to train a U-net style deep learning classifier, using Pytorch, for segmenting epithelium versus stroma regions. This post is broken down into 4 components following along other pipeline approaches we’ve discussed in the past:

  1. Making training/testing databases,
  2. Training a model,
  3. Visualizing results in the validation set,
  4. Generating output.

This model focuses on using solely Python and freely available tools (i.e., no matlab).

This blog post assumes moderate knowledge of convolutional neural networks, depending on the readers background, our JPI paper may be sufficient, or a more thorough resource such as Andrew NG’s deep learning course.

Continue reading Digital Pathology Segmentation using Pytorch + Unet

Download TCGA Digital Pathology Images (FFPE)

Digital pathology image analysis requires high quality input images. While there are a large number of images available in The Cancer Genome Atlas (TCGA), the ones which are currently available in the data portal are frozen specimens and are *not* suitable for computational analysis. This post discusses how to download the Formalin-Fixed Paraffin-Embedded (FFPE) slides for corresponding patients.

Continue reading Download TCGA Digital Pathology Images (FFPE)

On Stain Normalization in Deep Learning

Just wanted to take a moment and share some quick stain normalization type experimental results. We have a trained in-house nuclei segmentation model which works fairly well when the test images have similar stain presentation properties, but when new datasets arrive which are notably different we tend to see a decreased classifier performance.

Here we look at one of these images and ways of improving classifier robustness.

Continue reading On Stain Normalization in Deep Learning