Image 3D library
Quick start with i3dlib
Input/Output
The basic image class is i3d::Image3d and is responsible for all the operation applied to the given image. The simple instantiation is done by calling its constructor with the name of the image to be openned:
i3d::Image3d<i3d::GRAY8> my_image("lena.tif");
// open 8b grasyscale image
Consequently, the object "my_image" can be called with various methods or functions:
i3d::Gauss(my_image);
// gaussian smooth
i3d::Negative(my_image);
// color inversion
i3d::Threshold(my_image, (i3d::GRAY8) 128);
// global thresholding
... etc.
Saving the results is straightforward:
my_image.SaveImage("new_name.jpg");
// save the image
Several simple examples are stored in the examples directory.
Data storage
The library supports various image formats:- I3D (internal)
- TIFF (requires libtiff)
- JPEG (requires libjpeg)
- TARGA (internal)
- MetaIO (internal)
- ICS (requires libics)
When using any of them, default compression algorithm is used:
- TIFF ... LZW (Lempel-Ziv-Welch)
- JPEG ... discrete cosine transform
- TARGA ... RLE (Run-length encoding)
- MetaIO ... None
- ICS ... Gzip (LZ77, Huffman or LZW)
Data representation
The I3D is capable of manipulation with 1b, 8b, 16b, 24b, 48b raster image data (TIFF and TARGA support 48b TrueColor images). For this purpose special data type have been defined:- binary data: i3d::BINARY
- 8bit and 16bit grayscale: i3d::GRAY8 and i3d::GRAY16
- 24bit and 48bit three-channel: i3d::RGB and i3d::RGB16
- 32bit float
Which common functions are available?
- position independed operations
- global thresholding: i3d::Threshold
- adaptive thresholding: i3d::LocalThreshold
- color inversion: i3d::Negative
- filtering
- gaussian smoothing: i3d::Gauss
- changing the image layout
- resampling: i3d::Resample
- image flipping: i3d::SwapHoriz, i3d::SwapVert
- edge detecion operators:
- Sobel: i3d::Sobel2D, i3d::Sobel3D
- Canny: i3d::Canny2D, i3d::Canny3D
- ISEF: i3d::ShenCastan2D, i3d::ShenCastan3D
- histogram manipulation:
- i3d::IntensityHist
- rasterization
- seed line based fool fill: i3d::FloodFill
- drawing the line using DDA algorithm: i3d::DrawLine
- drawing the line using Bresenham algorithm: i3d::DrawLineBres
- drawing polygon: i3d::DrawLines
- labeling algorithms
- region labeling (Rosenfeld-Pfaltz alg.): i3d::LabeledImage3d::CreateRegions
- region labeling (flood fill based): i3d::LabeledImage3d::CreateRegionsFF
- mathematical morphology
- dilation: i3d::Dilation
- erosion: i3d::Erosion
- waterhsed: i3d::Watershed
- opening: i3d::Opening
- closing: i3d::Closing
- etc. (see module documentation for more)
Disclaimer
There are some header and source code files which are part of this library but weren't created by the CBIA. We redistribute these files as a part of our library but do not provide any warranty if using these codes.This files are:
- affine.h & affine.c
author: Philippe Thévenaz
reference: P. Thévenaz, T. Blu, M. Unser, "Interpolation Revisited," IEEE Transactions on Medical Imaging, vol. 19, no. 7, pp. 739-758, July 2000. - msdir.h & msdir.c
author: Toni Ronkko