Learn R Programming

MRIaggr (version 1.1.5)

initFilter: Initialization of a filter

Description

Return a filter corresponding to the specified name.

Usage

initFilter(filter, method)

Arguments

filter
the filter to be initialized. character. REQUIRED.
method
the name of the function that called the initializer. character.

Value

A list were :
  • [[filter]] : contains the filter. matrix of dimension p*p or array of dimension p*p*p.
  • [[filter_split]] : contains the decomposition of the filter name. character vector.

Details

ARGUMENTS : filter refers to classical filters that will be constructed by the function: The first two characters refer to the dimension of the filter : "2D" or "3D". The third character must be "_". The fourth character refers to the type of filter among : "M", "G", "S" or "I" :
  • "M" : median filter (by default a weight of 1 is attributed to each site)
  • "G" : gaussian filter (sites are weight with a gaussian kernel)
  • "S" : sobel filter (gradient in the i, j or k direction)
  • "I" : influence filter (sites with distance to the central site inferior or equal to sqrt(p) have weight 1, otherwise 0)

The last one or two characters indicates the size p of the filter except for the sobel filter where it indicates the direction of the gradient ("x", "y" or "z")

Examples

Run this code
initFilter("2D_G3", method = "calcFilter")$filter
initFilter("2D_G5", method = "calcFilter")$filter
initFilter("3D_G3", method = "calcFilter")$filter

initFilter("2D_M9", method = "calcFilter")$filter
initFilter("3D_M3", method = "calcFilter")$filter

initFilter("2D_Sx", method = "calcFilter")$filter
initFilter("2D_Sy", method = "calcFilter")$filter
initFilter("3D_Sx", method = "calcFilter")$filter
initFilter("3D_Sz", method = "calcFilter")$filter

initFilter("2D_I3", method = "calcFilter")$filter
initFilter("2D_I5", method = "calcFilter")$filter
initFilter("2D_I7", method = "calcFilter")$filter
initFilter("2D_I9", method = "calcFilter")$filter
initFilter("3D_I5", method = "calcFilter")$filter

Run the code above in your browser using DataLab