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

# ChainCodeGetChains

Chain code access function

## SYNOPSIS

`#include "dip_chaincode.h"`

dip_Error dip_ChainCodeGetChains ( chaincode, chain )

## FUNCTION

Returns a pointer to the first element of the chain. Each chain element contains a pointer to the next element. The last element has a `NULL` pointer. `ChainCodeGetSize` returns the number of elements in the chain. The `border` value in each element indicates whether the pixel is on the edge of the image or not. This usually indicates that the object is cut by the imaging window and needs to be treated differently.

## ARGUMENTS

Data type | Name | Description
`dip_ChainCode` | `chaincode` | Chain code
`dip_Chain **` | `chain` | Receives the pointer to the first element in the chain

The `dip_Chain` structure has the following elements:

Data type | Name | Description
`dip_int` | `code` | Direction of step taken from previous to this pixel (Freeman code)
`dip_int` | `border` | Pixel is on the border
`dip_Chain *` | `next` | Pointer to the next element in the chain

## SEE ALSO

`ImageChainCode`, `ChainCodeNew`, `ChainCodeFree`, `ChainCodeGetSize`, `ChainCodeGetStart`, `ChainCodeGetLabel`, `ChainCodeGetConnectivity`

DIPlib on-line documentation | Function reference | Global function index