Skip to contents

This function applies a guided filter to a volumetric image (3D brain MRI data) to perform edge-preserving smoothing. The guided filter is an edge-preserving filter that smooths the image while preserving the edges, providing a balance between noise reduction and edge preservation.

Usage

guided_filter(vol, radius = 4, epsilon = 0.7^2)

Arguments

vol

A NeuroVol object representing the image volume to be filtered.

radius

An integer specifying the spatial radius of the filter (default is 4).

epsilon

A numeric value specifying the variance constant, which controls the degree of smoothing (default is .7^2).

Value

A filtered image of class NeuroVol.

References

Guided Image Filtering: Kaiming He, Jian Sun, and Xiaoou Tang, "Guided Image Filtering," IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 35, No. 6, pp. 1397-1409, June, 2013. https://en.wikipedia.org/wiki/Guided_filter

Examples

# Load an example brain volume
brain_vol <- read_vol(system.file("extdata", "global_mask.nii", package="neuroim2"))

# Apply guided filtering to the brain volume
if (FALSE) {
filtered_vol <- guided_filter(brain_vol, radius = 4, epsilon = .7^2)
}