Should I switch from SimpleITK to Python ITK?

Hi all,

I’ve been using SimpleITK for some years. I have only used ITK (C++) once. I feel like a lot effort is being put on the new itk Python package. I like SimpleITK because it’s… simple. But sometimes I’ve missed some of ITK’s filters. The itk interface looks a bit more obscure to me, but maybe I’m just not used to it since I mostly use SimpleITK.

My questions:

  1. Should I switch to the new package?
  2. What are the pros and cons of both?

I hope these haven’t been asked yet, I haven’t found anything here.


First, if there is a filter missing in SimpleITK please create a issue on GitHub. There we can discuss why it hasn’t been wrapped and what needs to be done to include it. It could be just an omission, it may not match or it may not match the require SimpleITK style, or it may not pass SimpleITK’s rigorous testing.

Matt recently posted about the different styles of the interfaces:

If you want to use the full ITK interface with advanced pipelining or if you want to use other data structures like meshes or be able to explicit specify the template parameters of a filter, these are not available in SimpleITK, so ITK Python will be your clear choice. Additionally, ITK Python works great for those developing C++ code and using remote modules. I’m sure there are other reasons to switch too.

SimpleITK also has wrapping for R, Java, C#, Tcl, Ruby, Lua etc… all with the same simplified interface.

Currently, I believe SimpleITK excels in Image IO, basic image manipulation, image filtering and ITKv4 registration framework. Some distinguishing features of SimpleITK is that we instantiate a very large number of pixel types, including complex, and we uniformly use VectorImages for multi-component images. This means that can use the exact pixel type in the file without implicit conversion, save it as you want, and be able to convert and use just about images types. Also SimpleITK has overloaded operators and slice based indexing.

I believe this code snippet highlight the SimpleITK style, from a recent Insight Journal paper I authored:

def mask_label_contour(image, seg):
   """Combine an image and segmentation by masking the segmentation contour.
   For an input image (scalar or vector), and a multi-label
   segmentation image, creates an output image where the countour of
   each label masks the input image to black."""
   return sitk.Mask(image, sitk.LabelContour(seg+1)==0)

Now this is not to say SimpleITK is only for light weight operations. Currently, I am using it to register 2GB microscopy images on a System with 88 cores and 512GB of memory.

- SimpleITK Developer


Investigating the itk Python interface is worthwhile. The latest and greatest will be available in Python packages for the upcoming ITK 5 Beta 1 release. This will include the Pythonic interface to ITK filters and NumPy @blowekamp mentioned


1 Like

Thank you both for your answers.

I was also expecting a bit of information about the limitations of the interfaces with respect to each other, but things are a bit clearer now.

1 Like