Image Data
This section introduces the ImageView object, an image data model used by ImageDev.
In ImageDev, an image object is defined by an
ImageView class of the IOLink library.
IOLink is an abstract data model that manages agnostic data. As it is very generic, views are proposed to represent data with a simpler model. Views are specialized to a type of data, like the ImageView class, which describes images. An interface mechanism allows the connection of data to IOLink in a unified way.
The IOLink data model can theoritically manage any type of data. ImageDev only supports the ImageView object from IOLink.
The IOFormat library can be used to:
IOFormat supports most of common file formats and several other formats dedicated to electron microscopy. The list of available file formats is available here.
The IOLink library is essential for ImageDev operation, and is embedded in its distribution. However, IOFormat must be installed separately, as described in the Getting Started sections.
The IOLink library is binary compatible between its minor versions. \begin{array}{|c|c|c|c|} \hline \textbf{ImageDev version} & \textbf{Embedded IOLink version}& \textbf{Supported IOLink versions} & \textbf{Recommended IOFormat versions} \\ \hline \hline \text{ 2022.2 } & \text{1.2} & \text{>=1.2 and <2.0} & \text{>=0.33 and <2.0} \\ \hline \text{ 2022.1 } & \text{1.1} & \text{>=1.1 and <2.0} & \text{>=0.33 and <2.0} \\ \hline \end{array}
The vip extension refers to the proprietary file format managing all data generated by ImageDev. The ReadVipImage and WriteVipImage functions can be used to load and save data with the vip extension.
To simplify the access to the image interpretation, ImageDev adds helper functions.
The following functions can be used to know and change the dimensional organization of ImageView data:
If the following instruction is added:
To simplify the access to the dimensional interpretation, ImageDev adds helper functions.
The calibration information affects the result of most Image Analysis algorithms.
In ImageDev, the calibration information is given by the IOLink object returned by the GetProperties().Calibration function. It contains two vectors describing the image calibration:
To simplify the access to the image calibration information, ImageDev adds helper functions.
IOLink is an abstract data model that manages agnostic data. As it is very generic, views are proposed to represent data with a simpler model. Views are specialized to a type of data, like the ImageView class, which describes images. An interface mechanism allows the connection of data to IOLink in a unified way.
The IOLink data model can theoritically manage any type of data. ImageDev only supports the ImageView object from IOLink.
Loading and saving image files
Managing standard image files with IOFormat
IOFormat is a library developed by Thermo Fisher Scientific that is independent from ImageDev.The IOFormat library can be used to:
- Load an image file as an ImageView class
- Save an ImageView class into an image file
IOFormat supports most of common file formats and several other formats dedicated to electron microscopy. The list of available file formats is available here.
The IOLink library is essential for ImageDev operation, and is embedded in its distribution. However, IOFormat must be installed separately, as described in the Getting Started sections.
The IOLink library is binary compatible between its minor versions. \begin{array}{|c|c|c|c|} \hline \textbf{ImageDev version} & \textbf{Embedded IOLink version}& \textbf{Supported IOLink versions} & \textbf{Recommended IOFormat versions} \\ \hline \hline \text{ 2022.2 } & \text{1.2} & \text{>=1.2 and <2.0} & \text{>=0.33 and <2.0} \\ \hline \text{ 2022.1 } & \text{1.1} & \text{>=1.1 and <2.0} & \text{>=0.33 and <2.0} \\ \hline \end{array}
Managing specific image files with the vip format
ImageDev may generate some specific data that cannot be properly saved and reopened with a standard file format. For instance, the output of the GaussianHessianMatrix3d is a 6-channel 3D image. IOFormat is not able to save such data correctly, at least not in a consistent way for ImageDev.The vip extension refers to the proprietary file format managing all data generated by ImageDev. The ReadVipImage and WriteVipImage functions can be used to load and save data with the vip extension.
Image types
IOLink image types are defined by three parameters, returned by the functions:- Type().BitDepth(): the number of bits used to encode a pixel intensity
- Type().PrimitiveType(): the data type (signed or unsigned integer, float)
- GetProperties().ImageInfo.Interpretation: the interpretation of data for an algorithm (color space identification, grayscale meaning)
To simplify the access to the image interpretation, ImageDev adds helper functions.
Dimensional management
ImageView objects supported by ImageDev can have 5 dimensions: the X, Y and Z axis of a volume, the channels of a spectral image, and the time steps of an image sequence.The following functions can be used to know and change the dimensional organization of ImageView data:
- DimensionCount returns the number of dimensions.
- Shape returns the size for each dimension; that is, the corresponding number of elements.
- GetProperties().ImageInfo.AxesInterpretation returns the description of the image dimensions.
- SetProperties() changes the properties as the description of the image dimensions.
if (myImage.GetProperties().ImageInfo.AxesInterpretation == ImageTypeId.VOLUME) Console.WriteLine("myImage is a volume"); Console.WriteLine("Number of Dimensions = " + myImage.DimensionCount ); for (Byte i = 0; i < myImage.DimensionCount; i++) { Console.WriteLine($"Dimension {i}: size = {myImage.Shape.At(i)}"); }it returns:
-
myImage is a volume
Number of Dimensions = 3
Dimension 0: size = 100 - interpretation = COLUMNS
Dimension 1: size = 125 - interpretation = ROWS
Dimension 2: size = 15 - interpretation = SLICES
If the following instruction is added:
myImage.SetProperties(PropertyMap.FromPropertyMap(myImage.GetProperties(), new DimensionInfoProperty(ImageTypeId.IMAGE_SEQUENCE)));the same ImageView is now considered to be a time series (or sequence) of 15 two-dimensional images.
To simplify the access to the dimensional interpretation, ImageDev adds helper functions.
Data Access
Data values of an image view can be read or modified, mostly by two methods:- Point-wise access: Image intensities can be edited using the Read() and Write() functions.
- Region access: All intensities of a box area can be edited using the ReadRegion() and WriteRegion() functions.
Calibration
The image calibration information gives the real distance corresponding to a pixel. Depending on the file format from which an image is extracted and the way it has been loaded, a calibration may be directly imported or not, and this calibration may be relevant or not.The calibration information affects the result of most Image Analysis algorithms.
In ImageDev, the calibration information is given by the IOLink object returned by the GetProperties().Calibration function. It contains two vectors describing the image calibration:
- Origin: The origin of each dimension, in world coordinates. For spatial dimensions, it represents the position of the image's upper left corner in a global coordinate system.
- Spacing: The elementary size of each dimension, in world coordinates. For spatial dimensions, it represents the pixel or voxel size in each image axis direction.
To simplify the access to the image calibration information, ImageDev adds helper functions.
Color management
There are two usual ways to represent color images:- As interlaced data: $[R_1, G_1, B_1, R_2, G_2, B_2, ..., R_N, G_N, B_N]$
- As planar data: $[R_1, R_2, ..., R_N, G_1, G_2, ..., G_N, B_1, B_2, ..., B_N]$
- DimensionCount = 2
- Shape.Size() = 2
- Type.ElementCount = 3
- GetProperties().ImageInfo.AxesInterpretation = IMAGE
- DimensionCount = 3
- Shape.Size() = 3
- Type.ElementCount = 1
- GetProperties().ImageInfo.AxesInterpretation = MULTISPECTRAL_IMAGE