Learn R Programming

MRIaggr (version 1.1.5)

initNeighborhood: Initialization of a neighbourhood filter

Description

Return the neighbourhood configuration corresponding to the specified name.

Usage

initNeighborhood(Neighborhood, method)

Arguments

Neighborhood
the name of neighbourhood configuration. Any of "2D_N4", "2D_N8" "3D_N6" "3D_N10" "3D_N18" "3D_N26". REQUIRED.
method
the name of the function that called the initializer. character.

Value

A n*d matrix with in line the coordinates of the neighbors relative to the current observation.

Details

ARGUMENTS : Neighborhood refers to classical neighbourhood configurations : The first two characters refer to the dimension d of the filter : "2D" or "3D". The third character must be "_". The fourth character refers to the type of filter and must be "N". The last one or two characters indicates the number of neighbors (denoted n) in each neighbourhood.

Examples

Run this code
# 2D neighbourhood
initNeighborhood("2D_N4", method = "calcFilter") # rock neighbourhood
initNeighborhood("2D_N8", method = "calcFilter") # queen neighbourhood

# 3D neighbourhood
initNeighborhood("3D_N6", method=  "calcFilter") 
initNeighborhood("3D_N10" ,method = "calcFilter")
initNeighborhood("3D_N18", method = "calcFilter")
initNeighborhood("3D_N26", method = "calcFilter")

Run the code above in your browser using DataLab