H&E Histology Color Normalization Instructions

Color classification using color_classify.m

Process

colorassign_manual.m   train_classifier.m   color_classify.m   color_normalize.m

Overview

Given a classifier matrix and an RGB image, classify each pixel in a histological image as the appropriate tissue structure.

Inputs

rgb - A multidimensional array of size [MxNx3] where M and N represent the height and width of the image respectively. The third dimension of the data represents each color value (RGB). Generally this image will be the full size image from which a selection was used to train the classifier in the previous steps.

classifier - Either a single 3x4 array representing 3 hyperplanes in 3D space where each row represents the coefficients of a single plane in the form.

ax + by + cz = d

An example of such a classifier might be:

classifier = [
     -0.0001      0.0002     0.0001     0.0001
     -0.0027     -0.0013    -0.0014     0.0001
      0.0029      0.0069     0.0025     0.0006
]

This classifier is the result of running train_classifer.m.

Multiple classifiers can be passed to the program in the form of an array. If this is the case, the program will produce a probability matrix using the probable classification by each of the classifiers. This may be useful if, for instance, classifiers were created for several representative images in a series and you would like to classify other images using the previous trained classifiers without having to perform the steps of manual structure-to-color identification.

Outputs

A multidimensional array of size 4xMxN where M and N are the height and width of the image respectively. Each cell of data represents the distance from one of the hyperplanes produced in the train_classifier program. A result for a 4x2x2 image might appear as follows:

[
    [0.0010, 0, 0, 0], [0, 0.0011, 0, 0]
    [0, 0, 0.0009, 0], [0, 0, 0, 0.0008]
]  

Explanation

This function will break each image down to its respective structural elements by iteratively identifying each pixel in the image as lumen/white, nuclei, stroma, or cytoplasm.

The resulting classified data is a matrix of size 4xMxN where M and N are the height and width of the image respectively. Any non-zero data indicates a positive association to a cellular structure and the likelihood of accuracy.

Free Parameters

None

Example Usage

>> loadedImage = imread('/path/to/histology/image.tif')
>> [structureMap, lumen, nuclei, stroma, cytoplasm] = colorassign_manual(loadedImage)
>> classifier = train_classifier(loadedImage, structureMap, lumen, nuclei, stroma, cytoplasm)
>> classified_image = color_classify(loadedImage, classifier)

Timing

When processing a 1mm2 sample image of 2000x2000 pixels on a 2Ghz Intel i7 processor running with 8GB RAM, this function took less than 2 seconds to complete.

« Previous Step | Next Step »

 
 Back to Top