Description Usage Arguments Details Value Author(s) Examples
View source: R/calculateCellularity.R
The function calculates the tumour cellularity of an image by counting tumour and non tumour cells.
1 |
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. |
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.
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 |
Henrik Failmezger, failmezger@mpipz.mpg.de
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"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.