reparametrize() method for streamline objects
Source: R/parametrize.R
reparametrize-fiber-streamline-method.RdResamples a single streamline onto a uniform arc-length grid. See
reparametrize() for the full parameter documentation.
Arguments
- x
A streamline object.
- n_points
Number of equally-spaced arc-length points to use.
For a single streamline, defaults to
nrow(x@points).For a bundle, defaults to the rounded mean number of points across all streamlines.
Pass
NULLto use these defaults explicitly.
Value
A streamline reparametrized onto the new grid. The returned
object has the same class as the input but with @points resampled to
exactly n_points rows and all @point_data vectors resampled
correspondingly via linear interpolation.
Examples
pts <- matrix(runif(30), ncol = 3)
colnames(pts) <- c("X", "Y", "Z")
sl <- streamline(points = pts, point_data = list(FA = runif(10)))
sl_reparam <- reparametrize(sl, n_points = 20)
sl_reparam@n_points # 20
#> [1] 20