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

# ImageWriteICS

Write ICS image to file (in dipIO)

## SYNOPSIS

`#include "dipio_ics.h"`

dip_Error dipio_ImageWriteICS ( image, filename, photometric, physDims, history, sigbits, version, compression )

## FUNCTION

This function writes the image to an ICS file, overwriting any other file with the same name. `version` can set to 1 to use the ICS v.1.0 file format (the 2-file version), instead of ICS v.2.0. For colour images, set `photometric` and write the colour channels along the last image dimension. Set `sigbits` only if the number of significant bits is different from the full range of the data type of `image` (use 0 otherwise). `physDims` can be set to 0 to fill out default values. `history` can be 0 if you do not want to bother.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `image` | Output image
`dip_String` | `filename` | File name
`dipio_PhotometricInterpretation` | `photometric` | Photometric interpretation
`dip_PhysicalDimensions` | `physDims` | Physical dimensions structure. See `PhysicalDimensionsNew`
`dip_StringArray` | `history` | Tags that are written to the history in the ICS header
`dip_int` | `sigbits` | Number of significant bits.
`dip_int` | `version` | ICS version
`dipio_Compression` | `compression` | Compression method and level. See Compression methods for image files

The enumerator `dipio_PhotometricInterpretation` contains the following constants:

Name | Description
`DIPIO_PHM_GREYVALUE` | No colour information present; it's a grey-value image.
`DIPIO_PHM_RGB` | RGB image (the first three planes are red, green and blue)
`DIPIO_PHM_RGB_NONLINEAR` | Non-linear R'G'B' image (RGB channels to the power of 0.4)
`DIPIO_PHM_CMY` | CMY image (the first three planes are cyan, magenta and yellow)
`DIPIO_PHM_CMYK` | CMYK image (the first four planes are cyan, magenta, yellow and black)
`DIPIO_PHM_CIELUV` | CIE L*u'v' image (the first three planes are luminosity, u* and v*)
`DIPIO_PHM_CIELAB` | CIE L*a*b* image (the first three planes are luminosity, a* and b*)
`DIPIO_PHM_CIEXYZ` | CIE XYZ (the first three planes are X, Y and Z)
`DIPIO_PHM_CIEYXY` | CIE Yxy (the first three planes are Y, x and y)
`DIPIO_PHM_HCV` | HCV image (the first three planes are hue, chroma and value)
`DIPIO_PHM_HSV` | HSV image (the first three planes are hue, saturation and value)
`DIPIO_PHM_DEFAULT` | Same as `DIPIO_PHM_GREYVALUE`
`DIPIO_PHM_GENERIC` | Anything can be coded in the channels; the same as `DIPIO_PHM_CMYK`

Most file formats support only some of these.

## SOFTWARE

This function uses `libics` (version 1.3 or later), which supports the ICS specification revision 2.0. Copyright (c)2000-2002 Cris L. Luengo Hendriks, Dr. Hans T.M. van der Voort and many others.

This function uses `zlib` (version 1.1.4 or later). Copyright (c)1995-2002 Jean-loup Gailly and Mark Adler

## SEE ALSO

`ImageWrite`, `ImageWriteColour`, `ImageReadICS`, `ImageIsICS`