img_pad_to_center: Pad image so that specified coordinates are in the center of...

Description Usage Arguments Examples

View source: R/utils.R

Description

Pad image so that specified coordinates are in the center of the image

Usage

1
img_pad_to_center(img, center = round(dim(img)/2), value = 0)

Arguments

img

image

center

coordinates describing the desired "center" of the image (row, col)

value

fill value to use for padding the image. If value has the same length as the number of frames in the image, it will be applied frame-wise.

Examples

1
2
3
4
5
6
7
8
9
par(mfrow = c(1, 2))
im <- EBImage::readImage(system.file('images', 'nuclei.tif', package='EBImage'))[,,1:3]
EBImage::colorMode(im) <- "Color"
dim(im)
plot(im)

im_pad <- img_pad_to_center(im, center = c(200, 200), value = c(0, 1, 0))
dim(im_pad)
plot(im_pad, all = TRUE)

srvanderplas/ShoeScrubR documentation built on Nov. 27, 2019, 2:09 p.m.