coord.index: Coordinates from pixel index

View source: R/coordinates.R

coord.indexR Documentation

Coordinates from pixel index

Description

Compute (x,y,z,cc) coordinates from linear pixel index.

Usage

coord.index(im, index)

Arguments

im

an image

index

a vector of indices

Value

a data.frame of coordinate values

Author(s)

Simon Barthelme

See Also

index.coord for the reverse operation

Examples


cind <- coord.index(boats,33)
#Returns (x,y,z,c) coordinates of the 33rd pixel in the array
cind
all.equal(boats[33],with(cind,at(boats,x,y,z,cc)))
all.equal(33,index.coord(boats,cind))

imager documentation built on May 29, 2024, 1:38 a.m.