saveImageSlices: Export a dataCube as image slice sequence

View source: R/pointCloudAnalysis3D.R

saveImageSlicesR Documentation

Export a dataCube as image slice sequence

Description

Exports a dataCube of type rasterStack as Tiff image sequence. Image sequences are a common structure to represent voxel data and most of the specific software to visualize voxel data is able to read it (e.g. blender)

Usage

saveImageSlices(rStack, filename, dir, NaVal = 0)

Arguments

rStack

rasterStack to be saved to Tiff image slices

filename

name of the image slices

dir

directory, where the slices should be stored

NaVal

numeric value that should represent NA values in the Tiff image, default is NaVal = 0

Value

Saves the Tiff image files.

Examples

crws <- lapply(X = seq(1:100), FUN = function(X) {
  sim.crw.3d(nStep = 100, rTurn = 0.99, rLift = 0.99, meanStep = 0.1)
})
points <- do.call("rbind", crws)
extent <- raster::extent(c(-10, 10, -10, 10))
ud <- voxelCount(points, extent,
  xyRes = 5,
  zMin = -10, zMax = 10, standartize = TRUE
)
saveImageSlices(ud, filename = "saveImageSlices_test", dir = tempdir())

munterfinger/eRTG3D documentation built on March 25, 2022, 1:22 a.m.