neighbourhood: Get neighbourhood information for an array

neighbourhoodR Documentation

Get neighbourhood information for an array

Description

This function provides information about the structure of a neighbourhood of a given width within a specified array.

Usage

neighbourhood(x, width)

Arguments

x

An object that can be coerced to an array.

width

A vector giving the width of the neighbourhood in each dimension, which will be recycled if necessary. Must not be greater than the size of the array. Even values are rounded up to the next odd integer.

Value

A list with the following elements.

widths

The width of the neighbourhood along each dimension. Currently all elements of this vector will be the same.

size

The number of pixels within the neighbourhood.

locs

A matrix giving the coordinates of each neighbourhood pixel relative to the centre pixel, one per row.

offsets

Vector offsets of the neighbourhood values within x.

Author(s)

Jon Clayden <code@clayden.org>


mmand documentation built on Feb. 16, 2023, 9:22 p.m.