DIPlib Documentation - ©1995-2015 Quantitative Imaging Group, Delft University of Technology.

# NeighbourListMakeImage

Get list of neighbours based on metric in image

## SYNOPSIS

`#include "dip_neighbourlist.h"`

dip_Error dip_NeighbourListMakeImage ( metric, coords, distance, resources )

## FUNCTION

A list `coords` is created with the relative coordinates to the neighbours of a pixel in an image, with dimensionality as in `metric`. `metric` is an image that specifies the distance to each of the neighbours. This image must be odd in size, the centre pixel is the origin of the neighbourhood. Any pixel with value 0 is not considered part of the neighbourhood. `distance` contains the distance to each of the neighbours in `coords`.

Distances between two pixels are taken to be the Euclidean distance. There are better metrics described in the literature for small neighbourhoods, that yield a more isotropic measure when compounded over longer distances. These are not implemented in this function.

`coords` and `distance` are allocated and tracked in `resources`.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `metric` | Image whose pixel values indicate the neighbour distance
`dip_CoordinateArray *` | `coords` | Output neighbour coordinates
`dip_FloatArray *` | `distance` | Output distances to neighbours
`dip_Resources` | `resources` | Resources tracking structure. See `ResourcesNew`

## SEE ALSO

`NeighbourListMake`, `NeighbourListMakeChamfer`, `NeighbourListMakeImage`, `NeighbourListToIndices`, `NeighbourIndicesListMake`