fslsmooth_in_mask: Smooth Image Within a Mask Only

Description Usage Arguments Value Examples

View source: R/fslsmooth_in_mask.R

Description

This function smooth an image within a mask and replaces the values of the original image with the smoothed values.

Usage

1
2
3

Arguments

file

(character) image to be smoothed

sigma

(numeric) sigma (in mm) of Gaussian kernel for smoothing

mask

(character) optional mask given for image

...

additional arguments passed to fslsmooth.

Value

Object of class nifti

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if (have.fsl()){
system.time({
dims = c(50, 50, 20)
x = array(rnorm(prod(dims)), dim = dims)
img = nifti(x, dim= dims, 
datatype = convert.datatype()$FLOAT32, cal.min = min(x), 
cal.max = max(x), pixdim = rep(1, 4))
mask = abs(img ) > 1
s.img = fslsmooth_in_mask(img, mask = mask)
})
}

neuroconductor-devel/fslr documentation built on May 6, 2021, 1:44 p.m.