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

# ChangeDimensions

Changes the order of the dimensions in an image

## SYNOPSIS

dip_Error dip_ChangeDimensions( image, neworder )

## FUNCTION

Re-orders the dimensions in an image, optionally removing singleton dimensions (those dimensions with size 1), without copying the data. `neworder` is a list of the dimension numbers in the new order, for example (2,1,3) will swap the first two dimensions. Setting `neworder` to 0 removes all singleton dimensions without altering the order. This is useful, for example, after calling a function such as `Maximum` to compute a maximum projection over one dimension. The output image keeps the dimensionality of the input image, and thus has a singleton dimension.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `image` | The image to modify
`dip_IntegerArray` | `neworder` | The new order of the dimensions

## SEE ALSO

The image structure

`ImageGetDimensions`, `ImageSetDimensions`, `ImageGetStride`

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