processAperio {CRImage} | R Documentation

## Cellularity Calculation of Aperio TX Scanner

### Description

Procession of Aperio TX Slides.

### Usage

    processAperio(classifier=classifier,inputFolder=inputFolder,outputFolder=outputFolder,identifier=identifier,numSlides=numSlides,cancerIdentifier=cancerIdentifier,classOther = NA,maxShape=800,minShape=40,failureRegion=2000,slideToProcess=NA,KS=TRUE,colors=c(),classesToExclude=c(),threshold="otsu",numWindows=2,colorCorrection=FALSE,classifyStructures=FALSE,ksToExclude=c(),pixelClassifier=NA,densityToExclude=c(),numDensityWindows=32,resizeFactor=4,plotCellTypeDensity=TRUE,greyscaleImage=0,penClassifier=NULL,referenceHist=NULL,fontSize = 10)

### Arguments

`classifier` | The classifier.
`inputFolder` | The path to the image folder.
`outputFolder` | The path to the output folder.
`identifier` | The identifier of the files ("Ss" or "Da")
`numSlides` | The number of sections in the image.
`cancerIdentifier` | The identifier of the cancer class
`classOther` | deprecated
`maxShape` | Maximum size of cell nuclei
`minShape` | Minimum size of cell nuclei
`failureRegion` | minimum size of failure regions
`slideToProcess` | Set this parameter if only a certain slide should be processed
`KS` | Apply Kernel Smoother?
`colors` | Colors to paint the classes
`classesToExclude` | Which class should be excluded?
`threshold` | Which thresholding method should be used, "otsu" or "phansalkar" possible
`numWindows` | Number of windows to use for thresholding.
`colorCorrection` | deprecated
`classifyStructures` | Use hierarchical classification. If yes a pixel classifier has to be defined.
`ksToExclude` | These classes are excluded from kernel smoothing.
`pixelClassifier` | A SVM to classify pixel based on their color values. Needed if hierarchical classification should be applied.
`densityToExclude` | This class is excluded from cellularity calculation.
`numDensityWindows` | Number of windows for the density plot.
`resizeFactor` | Specifies the size of the cell density image. If this variable is not defined, the size of the thumbnail is used for the cell density image, else the size is calculated by size(thumbnail)*resizeFactor. The thumbnail is the small overview image, created by the Aperio software.
`plotCellTypeDensity` | Plot the density of different cell types?
`greyscaleImage` | Color channel of the RGB image that should be used for thresholding
`penClassifier` | Classifier to exclude low quality images (will be part of next release)
`referenceHist` | Colour Histogram of a reference image that can be used to calculate the quality of the recent image. (will be part of next release)
`fontSize` | will be part of next release

### Details

The function processes images of Aperio TX scanners. The images have to be saved in the CWS format.

### Value

Four folders are created in the output folder.

`Files` | Cellularity values and cell numbers are saved in the file
`classifiedImage` | Subimages with labeled tumour and non tumour cells
`tumourDensity` | Cancer heatmaps for every subimage
`cellCoordinates` | Coordinates and cell class for every cell in the subimage
`resizeFactor` | Size of the cellularity density image, calculated by size(thumbnail) * resizeFactor. Whereas the thumbnail is the small overview image produced by Aperio.

### Author(s)

Henrik Failmezger, failmezger@mpipz.mpg.de

### Examples

    #t = system.file("extdata", "trainingData.txt", package="CRImage")
    #read training data
    #trainingData=read.table(t,header=TRUE)
    #create classifier
    #classifier=createClassifier(trainingData,topo=FALSE)[[1]]
    #classify aperio
    #f = system.file("extdata",  package="CRImage")
    #f=file.path(f,"8905")
    #dir.create("AperiOutput")
    #takes long time!

    f = system.file("extdata",  package="CRImage")
    fc=file.path(f,"testClassifier")
    load(fc)
    fp=file.path(f,"pixelClassifier")
    load(fp)
    pixelClassifier=model
    pathToImage=file.path(f,"8905")

    pathToOutput="" #specify an output folder here

    #processAperio(classifier=classifier,inputFolder=pathToImage,outputFolder=pathToOutput,identifier="Da",numSlides=1,cancerIdentifier="c",maxShape=800,minShape=40,failureRegion=2000,slideToProcess=1,KS=FALSE,colors=c("white","green","blue","brown"),classesToExclude=c('a','l','nl'),threshold="otsu",ksToExclude=c('l','nl'),pixelClassifier=pixelClassifier,classifyStructures=TRUE,densityToExclude=c('a'),numDensityWindows=8,resizeFactor=1.5,plotCellTypeDensity=FALSE,greyscaleImage=1)

[Package CRImage version 1.32.0 Index]