ITK  5.3.0 Insight Toolkit
Collaboration diagram for Image Adaptors:

## Detailed Description

Image adaptors are an implementation of the Adaptor Design Pattern. They are designed to present an image of a particular type as being an image of a different type. Adaptors perform simple operations on pixel values for which is not easy to justify the use of an image filter.

One of the principal tasks of Image adaptors is to perform casting.

For example: you have an image whose pixels are of type unsigned char and you need to feed this image in a process that expects pixels of type double. You have the option of using an image filter (see Image Filters) that converts the unsigned char input image into another of double pixel type. However this filter will allocate memory for this second image and will need to be executed. Image adaptors allow to simulate that you have made the conversion but will avoid the overhead in memory. There is however a penalty in performance.

The mechanism used by image adaptors is to provide a simple function that will be used by image iterators (see Image Iterators) to convert the value of a pixel, in a pixel-by-pixel basis.