Introduction


A template-based image processing library.

Introduction
     Template Image Processing Library is a lightweight C++ template library designed mainly for medical imaging processing. The design paradigm is to provide an "easy-to-use" and also "ready-to-use" library. You need only to include the header files to use it. There is no need to build the source codes.

Design paradigm

    A lot of the image processing libraries are designed for experimental/research purpose and do not meet the industrial standard. Consequently, the performance of the codes is not optimal, and the library can be hard to read and use. The design of TIPL follows the several coding guidelines and principles [1-5] that makes it highly efficient and reusable. The following is the main paradigm behind TIPL.

     1. Decouple image type and image processing method. Most of the image processing libraries are limited to their defined image type. TIPL is not. You may use pointer, or any kind of memory block to as the input. This reduce the unnecessary memory storage and copy.

     2. Not limited to RGB pixel type. In medical imaging, the most common pixel type is "short" or "float", not the RGB value. TIPL makes no assumption on the pixel type to achieve the best applicability..

     3. No class inheritance, no hidden functions or interfaces. Class inheritance is known to cause programs in code maintenance  and it is not friendly for library users to customize the library [4]. TIPL combines template-based interfaces with C-style interface to provide a "flat" library structures that is easy to maintain and modify. The connections between header files are thereby minimized. 

Features

       1. Does not depend on any make tools, specific compilers, or IDE
       2. Headers only, and easy to use. 
       3. BSD license, free for all purposes        

Example 1. Convert DICOM to Nifti format 
       
#include "tipl/tipl.hpp"

int main()
{
    tipl::image<short,2> image_data;
    // load image data from a DICOM file
    image_data.load_from_file<tipl::io::dicom>("dicom_file.dcm");
    // save image data to a NIFTI file
    image_data.save_to_file<tipl::io::nifti>("nifti_file.nii");     
    return 0;
}
 

Example 2. Load a NIFTI file and apply anisotropic diffusion.
       
#include "tipl/tipl.hpp"

int main()
{
    tipl::basic_image<short,3> image_data;
    // Load NIFTI image
        image_data.load_from_file<tipl::io::nifti>("image.nii");

    // apply anisotropic diffusion
    tipl::filter::anisotropic_diffusion(image_data);    

    // Save image back to Nifti 
    image_data.save_to_file<tipl::io::nifti>("image.nii");
        
    return 0;
}
 

[1] "More Effective C++: 35 New Ways to Improve Your Programs and Designs", Scott Meyers, 1996.
[2] "Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions", Herb Sutter, 1999.
[3] "C++ Coding Standards: 101 Rules, Guidelines, and Best Practices", Herb Sutter, 2004.
[4] "Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition)", Scott Meyers, 2005.
[5] "A Tour of C++ (C++ In-Depth Series)", Bjarne Stroustrup, 2013
[6] http://www.agner.org/optimize/instruction_tables.pdf