powered by
Compute (x,y,z,cc) coordinates from linear pixel index.
coord.index(im, index)
a data.frame of coordinate values
an image
a vector of indices
Simon Barthelme
index.coord for the reverse operation
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))
Run the code above in your browser using DataLab