intensityCtrl: Simple image manipulations

Description Usage Arguments Details Value Examples

View source: R/imageProcessing.R

Description

The following function manipulates the brightness and the degree of contrast of an image.

Usage

1
intensityCtrl(img, brightness = 0, contrast = 1)

Arguments

img

An object of Image class specific to EBImage, stored as multi- dimensional arrays containing the pixel intensities.

brightness

A numeric value containing the level of brightness to be applied to the image. Default is 0. (no increased/decreased brightness)

contrast

A numeric value (>0) containing the degree of contrast to be applied to the image. Default is 1.(no increased/decreased contrast)

Details

As EBImage objects are stored as matrices, they can be manipulated with all R mathematical operators. This includes + to control the brightness,

Value

A Image with adjusted brightness and/or contrast.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Example 1: decrease brightness and increase contrast
# (good for object identification)
mouse = loadImage(system.file('extdata/Mouse_01.tiff', package='MyoManager'))
mNuc = selectFrame(mouse, 3)
viewImage(mNuc)

mouse_enhanced = intensityCtrl(mNuc, -0.2, 3)
viewImage(mouse_enhanced)

# Example 2: increase brightness and decrease contrast
human =loadImage(system.file('extdata/Human_01.tiff', package='MyoManager'))
hNuc = selectFrame(human, 3)
viewImage(hNuc)

human_enhanced = intensityCtrl(hNuc, -0.2, 3)
viewImage(human_enhanced)

karenkuang37/MyoManager documentation built on Dec. 21, 2021, 5:18 a.m.