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

# SortIndices

Sort indices to a block of data

## SYNOPSIS

`#include "dip_sort.h"`

dip_Error dip_SortIndices ( data, indices, size, algorithm, dataType, indexType )

## FUNCTION

Sorts a list of indices rather than the data itself using the algorithm specified by `algorithm`.

## ARGUMENTS

Data type | Name | Description
`void *` | `data` | Data
`void *` | `indices` | Indices
`dip_int` | `size` | Size
`dip_Sort` | `algorithm` | Sort algorithm
`dip_DataType` | `dataType` | Data type. See DIPlib's data types
`dip_DataType` | `indexType` | Data type of the index array. Must be either DIP_DT_SINT32 or DIP_DT_SINT16.

The `sortType` parameter is one of:

Name | Description
`DIP_SORT_DEFAULT` | Default sort algorithm
`DIP_SORT_QUICK_SORT` | Quick sort
`DIP_SORT_DISTRIBUTION_SORT` | Distribution sort
`DIP_SORT_INSERTION_SORT` | Insertion sort

## SEE ALSO

General information about sorting

`DistributionSort`, `InsertionSort`, `QuickSort`, `Sort`, `ImageSort`, `SortIndices16`, `ImageSortIndices`