Skip to contents

Resamples every streamline inside a bundle onto a common uniform arc-length grid. See reparametrize() for the full parameter documentation.

Arguments

x

A bundle 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 NULL to use these defaults explicitly.

Value

A bundle reparametrized onto the new grid. Every streamline in the returned bundle has exactly n_points rows in @points (defaulting to the rounded mean number of points across all streamlines when n_points is NULL).

See also

Examples

pts1 <- matrix(runif(30), ncol = 3)
colnames(pts1) <- c("X", "Y", "Z")
pts2 <- matrix(runif(60), ncol = 3)
colnames(pts2) <- c("X", "Y", "Z")
b <- bundle(streamlines = list(streamline(points = pts1),
                                streamline(points = pts2)))
b_reparam <- reparametrize(b, n_points = 15)
b_reparam[[1]]@n_points  # 15
#> [1] 15
b_reparam[[2]]@n_points  # 15
#> [1] 15