Contact

Developed by

Fang-Cheng Yeh
frankyeh (at) cmu.edu

Department of Biomedical Engineering, 
Carnegie Mellon University  

Introduction


A pure 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 file to use it. There is no need to build the cpp source codes.

Design paradigm

     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 one 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 and extend the best applicability..

Features

       1. Does not depends 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 "image/image.hpp"

int main()
{
    // Load DICOM image
    image::io::dicom dicom_file;
    dicom_file.load_from_file("dicom_file.dcm");

    // Copy the DICOM data to image data
    image::basic_image<short,2> image_data;
    dicom_file >> image_data;

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

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

int main()
{
    // Load NIFTI image
    image::io::nifti nii_file;
    nii_file.load_from_file("nifti_file.nii");

    image::basic_image<short,3> image_data;
    nii_file >> image_data;

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

    // Save image to Nifti 
    nii_file << image_data;
    nii_file.save_to_file("nifti_file.nii");
        
    return 0;
}