saveImageSlices: Export a dataCube as image slice sequence

Description Usage Arguments Value Examples

View source: R/pointCloudAnalysis3D.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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())

munterfi/eRTG3D documentation built on Feb. 25, 2022, noon