All Projects → SuperElastix → Simpleelastix

SuperElastix / Simpleelastix

Licence: apache-2.0
Multi-lingual medical image registration library

Labels

Projects that are alternatives of or similar to Simpleelastix

Python Gphoto2
Python interface to libgphoto2
Stars: ✭ 229 (-31.02%)
Mutual labels:  swig
go course
個人多年來學習與實作上的心得筆記
Stars: ✭ 25 (-92.47%)
Mutual labels:  swig
FABGen
C++ binding generator for CPython 3.x (x>=2), Lua 5.3 and Go
Stars: ✭ 26 (-92.17%)
Mutual labels:  swig
swig-srilm
SWIG Wrapper for the SRILM toolkit
Stars: ✭ 33 (-90.06%)
Mutual labels:  swig
java-cpp-example
Example of using C++ classes from Java. Showcases SWIG, JNA and JNI
Stars: ✭ 135 (-59.34%)
Mutual labels:  swig
CuVec
Unifying Python/C++/CUDA memory: Python buffered array ↔️ `std::vector` ↔️ CUDA managed memory
Stars: ✭ 73 (-78.01%)
Mutual labels:  swig
Cppsharp
Tools and libraries to glue C/C++ APIs to high-level languages
Stars: ✭ 2,221 (+568.98%)
Mutual labels:  swig
Shogun
Shōgun
Stars: ✭ 2,859 (+761.14%)
Mutual labels:  swig
canorus
Canorus is a free cross-platform music score editor
Stars: ✭ 25 (-92.47%)
Mutual labels:  swig
PyMFEM
Python wrapper for MFEM
Stars: ✭ 91 (-72.59%)
Mutual labels:  swig
ForTrilinos
ForTrilinos provides portable object-oriented Fortran interfaces to Trilinos C++ packages.
Stars: ✭ 24 (-92.77%)
Mutual labels:  swig
go-snowboy
Go wrapper for Kitt-AI's snowboy audio detection library.
Stars: ✭ 40 (-87.95%)
Mutual labels:  swig
FoxNN
Simple neural network
Stars: ✭ 20 (-93.98%)
Mutual labels:  swig
Gdcm
Grassroots DICOM read-only mirror. Only for Pull Request. Please report bug at http://sf.net/p/gdcm
Stars: ✭ 240 (-27.71%)
Mutual labels:  swig
douMiBlog-Sailsjs
豆米博客-Sailsjs版,个人博客系统,使用SailsJs,MongoDb,Bootstrap,marked,SASS,swig等
Stars: ✭ 22 (-93.37%)
Mutual labels:  swig
Quantlib Swig
QuantLib wrappers to other languages
Stars: ✭ 176 (-46.99%)
Mutual labels:  swig
yadoms
Yadoms is open source, simple, powerfull, flexible and multiplatforms domotic solution.
Stars: ✭ 56 (-83.13%)
Mutual labels:  swig
Cbmc
C Bounded Model Checker
Stars: ✭ 309 (-6.93%)
Mutual labels:  swig
swig-webpack-plugin
Render swig templates with webpack.
Stars: ✭ 12 (-96.39%)
Mutual labels:  swig
idajava
Java integration for Hex-Rays IDA Pro
Stars: ✭ 25 (-92.47%)
Mutual labels:  swig

What is SimpleElastix?

Image registration is the process of transforming images into a common coordinate system so corresponding pixels represent homologous biological points. SimpleElastix is an extension of SimpleITK that offers a user-friendly API to the popular image registration algorithms of the elastix C++ library. This makes state-of-the-art medical image registration really easy to do in languages like Python, Java, C# and R. This package provides

  • elastix and transformix bindings for C++, Python, Java, R, Ruby, Octave, Lua, Tcl and C# (see elastix manual for a list of supported registration algorithms).
  • Pre-configured registration methods that work well in many cases and serve as starting points for tuning elastix to domain-specific applications.
  • Installation guides, examples, and introductory material at simpleelastix.readthedocs.org.
  • A user-friendly API that aligns with the design philosophy of SimpleITK developed specifically for rapid prototyping. If you are interested, The Design of SimpleITK is a great read.
  • The complete set of SimpleITK image processing algorithms.

Enough talk, time for some examples! We will use Python for the following code. Say you need to register two images. This can be accomplished with a single line of code:

resultImage = SimpleITK.Elastix(sitk.ReadImage("fixedImage.dcm"), sitk.ReadImage("movingImage.dcm"))

Under the hood, Elastix will use stochastic optimization for maximum speed, a multi-resolution strategy and several different transforms of increasing complexity for maximum robustness. All aspects of the registration procedure can be customized via parameter maps.

SimpleElastix can also be used for more complex image processing pipelines. Say you want to compare the volume, mean intensity and standard deviation of the intensity of anatomical structures across a population of images using an atlas segmentation. We can accomplish this task with the following lines of Python code:

import SimpleITK as sitk

# The atlas and associated segmentation is loaded once and held in memory
movingImage = sitk.ReadImage('atlasImage.hdr')
movingLabel = sitk.ReadImage('atlasLabel.hdr')

# Images are loaded from disk one at a time. Here we specify an array of 
# paths to images which we will loop over. 
population = ['image1.dcm', 'image2.dcm', ... , 'imageN.dcm']

selx = sitk.ElastixImageFilter()
selx.SetMovingImage(movingImage)
selx.SetParameterMap(selx.GetDefaultParameterMap('nonrigid'))

for filename in population
  # Register images
  fixedImage = sitk.ReadImage(filename)
  selx.SetFixedImage(fixedImage)
  selx.Execute()

  # Transform label map using the deformation field from above
  resultLabel = sitk.Transformix(movingLabel, selx.GetTransformParameterMap())

  # Compute statistics for label 1
  LabelStatistics = sitk.LabelStatisticsImageFilter()
  LabelStatistics.Execute(fixedImage, sitk.Cast(resultLabel, sitk.sitkInt8))
  LabelStatistics.GetCount(1)
  LabelStatistics.GetMean(1)
  LabelStatistics.GetVariance(1)
  # etc etc

This example demonstrates the efficiency of combining SimpleElastix's object oriented interface (the way we used elastix to register images) and procedural interface (the way we used transformix to warp labels) with SimpleITK (the way we computed statistics). Previously, using elastix and transformix on large datasets would incur a significant overhead, from scripting command line invocations and arguments to copying images and transform parameter files across folders. With SimpleElastix this complexity is easier to manage and more memory and disk I/O efficient. For more examples see the documentation.

Building with the SuperBuild

SimpleElastix integrates elastix and transformix with the SimpleITK SuperBuild. Simply clone this repository and invoke the SuperBuild as outlined in the documentation. The SuperBuild will download and install dependencies (elastix, ITK, SimpleITK and SWIG) and compile SimpleElastix. Target language dependencies need to be pre-installed, e.g. sudo apt-get install cmake swig monodevelop r-base r-base-dev ruby ruby-dev python python-dev tcl tcl-dev tk tk-dev. Note that this project takes around an hour to build on a quad-core machine.

The documentation further describes how to build SimpleElastix on Windows and how to build SimpleElastix manually without the SuperBuild.

SimpleElastix has been tried and tested on Ubuntu 14.10 using GCC 4.9.2 and Clang 3.4.0, Mac OSX Yosemite using Apple Clang 600.0.56 and Windows 8.1 using Microsft Visual Studio 2012 C++ compiler.

About

If you are interested in my work you are most welcome to visit my website.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].