IndexedImage-class {EBImage} | R Documentation

## Defintion of class 'IndexedImage'

### Description

The class `IndexedImage` is used to store the results of functions that index image into separate objects using integer 1-based indexing. Such an image is essentially the same as `Image` in the gray scale mode. The class was defined to ensure correct types in calls to other object detection and processing routines.

### Class Definition

        ## S4 class definition
        setClass( "IndexedImage", contains="Image" )

### Creating objects

Objects of this class are not supposed to be created directly, rather as the result of calls to `watershed` or `propagate`, or other functions that index objects in images.

### Details

No accessor methods are defined for this class, however all of the parents' ones are available, i.e. those of `Image` and `array`.

One coersion routine is defined in addition, which simply sets the class attribute to `Image`:

        ## S4 method for signature 'x=IndexedImage'
        as.Image(x, ...)

When used with `IndexedImage`'s `display` by default normalizes the image.

### Author(s)

Oleg Sklyar, osklyar@ebi.ac.uk, 2007

### See Also

`Image, watershed, getFeatures`

### Examples

      ## load images
      f <- paste( system.file(package="EBImage"), "images/Gene1_G.tif", sep="/" )
      ii = readImage(f)
      ## normalize images
      ii = normalize(ii, separate=TRUE)
      ## segment
      mask = thresh(ii, 25, 25, 0.02)
      ## refine segmentation with morphology filters
      mk3 = morphKern(3)
      mk5 = morphKern(5)
      mask = dilate(erode(closing(mask, mk5), mk3), mk5)
      ## index objects with 'watershed'
      io = watershed( distmap(mask), 1.5, 1)

      class(io)

[Package EBImage version 2.2.0 Index]