guided_filter: Filter a volumetric image with an edge-preserving "guided"...

View source: R/spat_filter.R

guided_filterR Documentation

Filter a volumetric image with an edge-preserving "guided" filter

Description

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
## Not run: 
filtered_vol <- guided_filter(brain_vol, radius = 4, epsilon = .7^2)

## End(Not run)


bbuchsbaum/neuroim2 documentation built on April 20, 2024, 4:20 p.m.