resample: Resample Volume to New Space

View source: R/schaefer.R

resampleR Documentation

Resample Volume to New Space

Description

Resamples a volume to a new space with optional smoothing of parcel boundaries. This is particularly useful for atlas parcellations where maintaining discrete labels is important.

Usage

resample(
  vol,
  outspace,
  smooth = FALSE,
  interp = 0,
  radius = NULL,
  min_neighbors = 3
)

Arguments

vol

A NeuroVol object to be resampled

outspace

A NeuroSpace object specifying the target space

smooth

Logical. Whether to apply boundary smoothing after resampling. Default: FALSE

interp

Integer. Interpolation method (0=nearest neighbor, 1=linear). Default: 0

radius

Numeric. Radius for smoothing neighborhood in voxels. If NULL, uses max(spacing)+0.5. Default: NULL

min_neighbors

Integer. Minimum number of neighbors required for smoothing. Default: 3

Details

The resampling process:

  • First performs nearest-neighbor interpolation to the new space

  • Optionally smooths boundaries using a local majority voting scheme

  • Preserves zeros in the mask (background)

Value

A resampled NeuroVol object in the new space


bbuchsbaum/neuroatlas documentation built on Dec. 24, 2024, 4:22 a.m.