ImageDev

Image Data

This group contains functions to load and save images that can be processed or returned by any ImageDev algorithm.

VIP file format

The VIP format is an image file format, especially designed for managing any ImageDev data. It is a raw file format organized as follows: \begin{array}{|l|l|l|l|} \hline \textbf{Field} & \textbf{Size (bytes)} & \textbf{Type} & \textbf{Description} \\ \hline \text{Magic Number} & 4 & \text{4 character string} & \text{The VIP format identifier: "VIPI"} \\ \hline \text{Version} & 4 & \text{Unsigned long} & \text{The VIP format version (generally 2)} \\ \hline \text{Header Size} & 4 & \text{Unsigned long} & \text{The header size HS, in bytes} \\ \hline \text{Header} & \text{HS} & \text{Header structure} & \text{The header structure (more information below)} \\ \hline \text{Data} & \text{} & \text{} & \text{The image data (more information below)} \\ \hline \end{array}

VIP header organization

The VIP header contains the following information: \begin{array}{|l|l|l|l|} \hline \textbf{Field} & \textbf{Size (bytes)} & \textbf{Type} & \textbf{Description} \\ \hline \text{Data Type} & 4 & \text{Unsigned long} & \text{Flag indicating the pixel data type} \\ \hline \text{Element Type} & 4 & \text{Unsigned long} & \text{Flag indicating the element type; from version 2} \\ \hline \text{Is Binary} & 1 & \text{Unsigned char} & \text{The image is binary if not equal to 0} \\ \hline \text{Is Label} & 1 & \text{Unsigned char} & \text{The image is label if not equal to 0} \\ \hline \text{Size X} & 4 & \text{Unsigned long} & \text{Number of elements of the X dimension} \\ \hline \text{Size Y} & 4 & \text{Unsigned long} & \text{Number of elements of the Y dimension} \\ \hline \text{Size C} & 4 & \text{Unsigned long} & \text{Number of spectral channels} \\ \hline \text{Size Z} & 4 & \text{Unsigned long} & \text{Number of elements of the Z dimension} \\ \hline \text{Size T} & 4 & \text{Unsigned long} & \text{Number of elements for image sequence}\\ \hline \text{Calibration X} & 60 & \text{Calibration structure} & \text{The calibration information of the X dimension (spacing, unit) } \\ \hline \text{Calibration Y} & 60 & \text{Calibration structure} & \text{The calibration information of the Y dimension (spacing, unit) } \\ \hline \text{Calibration C} & 60 & \text{Calibration structure} & \text{The calibration information of the spectral dimension (spacing, unit) } \\ \hline \text{Calibration Z} & 60 & \text{Calibration structure} & \text{The calibration information of the X dimension (spacing, unit) } \\ \hline \text{Calibration T} & 60 & \text{Calibration structure} & \text{The calibration information of the sequence dimension (spacing, unit) } \\ \hline \text{Color interpretation} & 4 & \text{Unsigned long} & \text{Flag indicating the color interpretation; from version 3} \\ \hline \text{Origin X} & 8 & \text{Double} & \text{Origin of the X dimension; from version 4} \\ \hline \text{Origin Y} & 8 & \text{Double} & \text{Origin of the Y dimension; from version 4} \\ \hline \text{Origin C} & 8 & \text{Double} & \text{Origin of spectral channels; from version 4} \\ \hline \text{Origin Z} & 8 & \text{Double} & \text{Origin of the Z dimension; from version 4} \\ \hline \text{Origin T} & 8 & \text{Double} & \text{Origin for image sequence; from version 4}\\ \hline \end{array}

Data type

This flag indicates the data type of all image element (pixels or voxels). \begin{array}{|l|l|l|} \hline \textbf{Name} & \textbf{Value} & \textbf{Description} \\ \hline \text{UINT8} & 0 & \text{8-bit unsigned integer} \\ \hline \text{UINT16} & 1 & \text{16-bit unsigned integer} \\ \hline \text{UINT32} & 2 & \text{32-bit unsigned integer} \\ \hline \text{INT8} & 4 & \text{8-bit signed integer} \\ \hline \text{INT16} & 5 & \text{16-bit signed integer} \\ \hline \text{INT32} & 6 & \text{32-bit signed integer} \\ \hline \text{FLOAT32} & 8 & \text{32-bit real floating-point} \\ \hline \text{FLOAT64} & 9 & \text{64-bit real floating-point} \\ \hline \text{COMPLEX_FLOAT32} & 10 & \text{32-bit complex floating-point} \\ \hline \text{COMPLEX_FLOAT64} & 11 & \text{64-bit complex floating-point} \\ \hline \end{array}

Element type

The element type flag indicates the type of mathematical dimension associated with each image element. \begin{array}{|l|l|l|} \hline \textbf{Name} & \textbf{Value} & \textbf{Description} \\ \hline \text{SINGLE} & 0 & \text{Single scalar value} \\ \hline \text{VECTOR_2} & 16 & \text{2D vector, generally representing X and Y coordinates of a vector field} \\ \hline \text{VECTOR_3} & 32 & \text{3D vector, generally representing X, Y, and Z coordinates of a vector field} \\ \hline \text{MATRIX_2X2_SYM} & 256 & \text{2x2 symmetric matrix, i.e., 3 elements, generally representing a 2D tensor field} \\ \hline \text{MATRIX_3X3_SYM} & 512 & \text{3x3 symmetric matrix, i.e., 6 elements, generally representing a 3D tensor field} \\ \hline \end{array}

Dimensional calibration

Each dimension of a VIP image has a calibration representing the data in world coordinates along this dimension. This information is set in a calibration structure organized as follows: \begin{array}{|l|l|l|l|} \hline \textbf{Field} & \textbf{Size (bytes)} & \textbf{Type} & \textbf{Description} \\ \hline \text{Image Size} & 4 & \text{Unsigned long} & \text{A known length along the related dimension in image units; for example, pixels} \\ \hline \text{WCS Size} & 8 & \text{Double} & \text{The size corresponding to the image size in the world coordinate system} \\ \hline \text{Unit} & 48 & \text{48 character string} & \text{The unit of the world coordinate system, until 48 characters} \\ \hline \end{array} For instance, if the calibration attached to the X axis of a 2D image gives: it means that along the horizontal axis, 120 pixels correspond to 240 nanometers (that is, 1 pixel = 2 nm).

Color interpretation

The color interpretation flag indicates how to interpret the color images. \begin{array}{|l|l|l|} \hline \textbf{Name} & \textbf{Value} & \textbf{Description} \\ \hline \text{UNKNOWN} & 0 & \text{Unknown} \\ \hline \text{RGB} & 1 & \text{Red, Green, Blue} \\ \hline \text{HSL} & 2 & \text{Hue, Saturation, Lightness} \\ \hline \text{YIQ} & 3 & \text{Brightness, In-phase, Quadrature (NTSC)} \\ \hline \text{NRGB} & 4 & \text{RGB color with chromaticity coordinates} \\ \hline \end{array}

VIP data organization

The VIP format theoritically supports up to 6 dimensions: the X, Y, and Z axis of a volume, channels of a spectral image, time steps of an image sequence, and the vectoriel information given by the element type. The last dimension, managing vector or matrix fields, is interlaced in the data format. Other information is non-interlaced and hierarchized as follows: