MATITK: EXTENDING MATLAB WITH ITK

To facilitate the analysis of medical image data in research environment, MATITK is developed to allow ITK algorithms to be called in MATLAB. ITK is a powerful open-source image analysis toolkit, but it requires the knowledge of C++ to use it. With the help of MATITK, researchers familiar with MATLAB can harness the power of ITK without learning C++ and worrying about low-level programming issues. A common set of C++ classes have also been produced to allow future ITK methods to be added to MATITK therefore callable in MATLAB without the bothersome translation between MATLAB and ITK.


III. IMPLEMENTATION
For details of MATITK's software design and architecture, the reader is referred to [1,2], which are part of this submission (see section VII Supplementary Material).The reader who is interested in using MATITK and not building it, should skip to section IV Usage.Following is an overview of the implementation of MATITK and the steps required for building it.
A set of C++ reusable template classes have been written to translate between MATLAB's and ITK's representations of images, connect the pipeline, and return the results or error messages appropriately.Based on the ITK example files, a Perl script has been created to automatically generate C++ code that can be added into MATITK with little human intervention.After compilation, the included ITK methods can be called in MATLAB.
The current version2 (MATITK 2.4.01)accepts 3D images of types double, single (float), unsigned char (uint8) and integer (int32), and the included methods are based on the example files from ITK version 2.4.For this submission, the source code is compiled on Windows with Visual Studio 2003 and MATLAB 7.0 to generate matitk.dll.
To build MATITK, the following steps are suggested: 1. Type mex -setup in MATLAB to configure the default options file for your compiler.This assumes that a MATLAB compatible compiler is present on your system such as VS 6 and VS 2003 on Windows), 2. Modify the automatically generated options file (mexopts.baton Windows, with its path shown in the last line of mex -setup execution) to include the header files paths and the linking paths of ITK.Alternatively, set the Windows environment variables %ITKSRC% and %ITKBIN% to ITK source and binary directories respectively, and replace the generated mexopts.batwith the one included in the submission.
3. In MATLAB, change the current working directory to the directory containing all the MATITK source files (.cxx, .hand .inlfiles) included in this submission.Type mex matitk.cxx to build matitk.dll.

IV. USAGE
To use the wrapper, MATLAB must be able to locate the matitk.dll3 .This usually means the current working directory of MATLAB should be set to the location of matitk.dll.Copy matitk.dll(see section VII Supplementary Material) to the desired location, launch MATLAB and set search path of MATLAB or change current directory to the location of the DLL.
In MATLAB, calls to MATITK methods would generally take the following format: Legend: 1.The first argument to matitk, operationName, specifies the opcode of the implemented ITK method to be invoked.
2. The second argument to matitk, parameters, specifies the required parameters of the ITK method to be invoked (specified by operationName).To find out what parameters are required for a particular method, type matitk(operationName); 3. The third and fourth arguments to matitk, inputArray1 and inputArray2, specify the input image volume.They must be three dimensional and contain double, float, unsigned char or signed integer data type elements.In the case where a second image volume is not required for the method being invoked, provide [] as the fourth argument.