[R-sig-Geo] RasterStack on file disk

marcel Austenfeld marcel.au at web.de
Fri Oct 17 10:54:45 CEST 2014


Hello,

i would like to develop an action to store a RasterStack on file disk instead of memory.
The images are transferred from a stack or virtual stack from ImageJ in different types.

For a stack of RGB images the images are split into three integer matrices and added to a RasterStack:

rasterStackFromIJ<-stack()

..........
imageMatrix<-.....from ImageJ.....

r<-matrix(imageMatrix[,1],nrow=xxx, ncol=yyy)
rasterStackFromIJ <- stack(rasterStackFromIJ,raster(r))

g<-matrix(imageMatrix[,2],nrow=xxx, ncol=yyy)
rasterStackFromIJ <- stack(rasterStackFromIJ,raster(g))

b<-matrix(imageMatrix[,3],nrow=xxx, ncol=yyy)
rasterStackFromIJ <- stack(rasterStackFromIJ,raster(b))
......

This works quite well for a bunch of images if enough RAM is available (Created e.g. stack size: 4096:3072:21 from 7 RGB images)

However it would be nice to have an option to store and access the RasterLayer to and from the file disk for huge stacks.

Is this possible for a RasterLayer?

Any information is appreciated!



More information about the R-sig-Geo mailing list