gradient: 3D Image Gradient

View source: R/gradient.R

gradientR Documentation

3D Image Gradient

Description

This function returns the gradient images for a 3D array or NIfTI volume.

Usage

gradient(image, mask = NULL, which = "all", radius = 1)

Arguments

image

a 3D array or image of class nifti

mask

an array or nifti mask of voxels for which the gradient will be calculated, if NULL the gradient will be run for the full array. Note that mask should be in the same space as the image volume

which

a string specifying the gradient direction that should be returned; either "all" for a list of x, y, and z gradient volumes, or "x", "y", or "z" for a single volume with the given gradient

radius

an integer specifying radius of the neighborhood (in voxels) for which the gradient should be calculated

Value

Either a list of three gradient volumes or a single gradient volume, in either array or NIfTI format based on what was input.

Examples

## Not run: 
library(neurobase)
epi <- readnii('path/to/epi')
gradients <- gradient(image = epi, which = "all") 
## End(Not run)

jdwor/lesiontools documentation built on May 24, 2022, 8:35 p.m.