segmentImage: Segmentation of an image

Description Usage Arguments Details Value Author(s) References Examples

View source: R/segmentImage.R

Description

The function segments cells or cell nuclei in the image.

Usage

1
segmentImage(filename="",image=NA,maxShape=NA,minShape=NA,failureRegion=NA,threshold="otsu",numWindows=2, colorCorrection=FALSE, classifyStructures=FALSE,pixelClassifier=NULL,greyscaleImage=0,penClassifier=NULL,referenceHist=NULL)

Arguments

filename

A path to an image

image

An 'image' object, if no filename is specified.

maxShape

Maximum size of cell nuclei

minShape

Minimum size of cell nuclei

failureRegion

minimum size of failure regions

threshold

Thresholding method, "otsu" or "phansalkar"

numWindows

Number of windows to use for thresholding.

colorCorrection

deprecated

classifyStructures

Segment structures in the image, if yes a pixel classifier has to be defined

pixelClassifier

A SVM which classifies RGB color values in foreground and background.

greyscaleImage

Channel of the RGB image, to use for thresholding, if 0 use a joined greyscale image.

penClassifier

Classifier to exclude low quality images(will be part of next release)

referenceHist

Color histogram of a reference image, that can be used to estimate the quality of the recent image (will be part of next release)

Details

The image is converted to greyscale and thresholded. Clutter is deleted using morphological operations. Clustered objects are separated using watershed algorithm. Segmented Cell nuclei, which exceed the maximum size are thresholded and segmented again. Cell nuclei which fall below the minimum size are deleted. Dark regions which exceed the parameter failureRegion are considered as artefacts and deleted. If the parameters are not defined, the operations will not be executed. Features are generated for every segmented object.

Value

A list is returned containing

image

The original image

segmented image

The segmented image

Author(s)

Henrik Failmezger, failmezger@cip.ifi.lmu.de

References

EBImage, 'http://www.bioconductor.org/packages/release/bioc/html/EBImage.html'

Examples

1
2
3
4
5
6
#segment image
#f = system.file('extdata' ,'exImg.jpg',package='CRImage')
#segmentationValues=segmentImage(f,maxShape=800,minShape=40,failureRegion=2000,threshold="otsu",numWindows=4)
#image=segmentationValues[[1]]
#segmentedImage=segmentationValues[[2]]
#imageFeatures=segmentationValues[[3]]

Example output

Loading required package: EBImage
Loading required package: DNAcopy
Loading required package: aCGH
Loading required package: cluster
Loading required package: survival
Loading required package: multtest
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package: 'Biobase'

The following object is masked from 'package:EBImage':

    channel


Attaching package: 'aCGH'

The following object is masked from 'package:stats':

    heatmap

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