calculateCellularity: Calculation of tumour cellularity

Description Usage Arguments Details Value Author(s) Examples

View source: R/calculateCellularity.R

Description

The function calculates the tumour cellularity of an image by counting tumour and non tumour cells.

Usage

1
calculateCellularity(filename="",image=NA,classifier=NULL,cancerIdentifier=NA,KS=FALSE,maxShape=NA,minShape=NA,failureRegion=NA,colors=c(),threshold="otsu",classesToExclude=c(),numWindows=2,classifyStructures=FALSE,pixelClassifier=NA,ksToExclude=c(),densityToExclude=c(),numDensityWindows=4)

Arguments

filename

A path to an image file.

image

If filename is undefined, an Image object

classifier

A SVM object, created with createClassifier or directly with the package e1071

cancerIdentifier

A string which describes, how the cancer class is named.

KS

Apply kernel smoother?

maxShape

Maximum size of cell nuclei

minShape

Minimum size of cell nuclei

failureRegion

minimum size of failure regions

colors

Colors to paint the classes

threshold

Which threshold should be uses, "otsu" or "phansalkar"

classesToExclude

Should a class be excluded from cellularity calculation?

numWindows

Number of windows for the threshold.

classifyStructures

Use hierarchical classification. If yes a pixel classifier has to be defined.

pixelClassifier

A SVM to classify pixel based on their color values. Needed if hierarchical classification should be applied.

ksToExclude

These classes are excluded from kernel smoothing.

densityToExclude

This class is excluded from cellularity calculation.

numDensityWindows

Number of windows for the density plot.

Details

The method calculates tumour cellularity of an image. The cells of the image are classified and the cellularity is: numTumourCells/numPixel. Furthermore the number of cells of the different classes are counted. A heatmap of cellularity is created. The image is divided in 16 subwindows and cellularity is calculated for every subwindow. Green in the heatmaps indicates strong cellularity, white low cellularity.

Value

A list containing

cellularity values

a vector, the n first values indicate the n numbers of cells in the n classes, the n + 1th value indicates the tumour cellularity, The n + 2th value is the ratio of tumour cells by all cells

cancerHeatmap

Heatmap of cancer density

Author(s)

Henrik Failmezger, failmezger@mpipz.mpg.de

Examples

1
2
3
4
5
6
7
8
9
t = system.file("extdata", "trainingData.txt", package="CRImage")
#read training data
trainingData=read.table(t,header=TRUE)
#create classifier
classifier=createClassifier(trainingData)[[1]]
#calculation of cellularity
f = system.file("extdata", "exImg.jpg", package="CRImage")
exImg=readImage(f)
cellularity=calculateCellularity(classifier=classifier,filename=f,KS=TRUE,maxShape=800,minShape=40,failureRegion=2000,classifyStructures=FALSE,cancerIdentifier="c",numDensityWindows=2,colors=c("green","red"))

CRImage documentation built on Nov. 8, 2020, 8:01 p.m.