ITK or SimpleITK in Python?

Hi all,

I know this question has been asked before. I have started developing commercial solutions for medical image analysis in python. I have used both ITK and SimpleITK but would like to use only one of them. It seemed more professional to use ITK for commercial purposes because of its capabilities and I started using it, but later I realized ITK had some limitations which made me sometimes use SimpleITK as well. For example, I was not able to use ITK for processing 4D data types (dynamic MRI, for example). Also, I was not able to read transformation file (*.tfm) that I generated by ITK registration and ended up using SimpleITK to read it (it seemed to me that something was not implemented in ITK). Should I keep using ITK and post my problems here, or should I completely switch to SimpleITK since these problems have no solution? In other words, is there any problem using SimpleITK in a commercial solution? I would like to make a decision before I write too many scripts and having to rewrite them in future.

Thanks a lot!

1 Like

Hello @mridev,

There is no problem using SimpleITK in a commercial solution. There are several companies that do.

With respect to differences between SimpleITK and ITK in Python, from the SimpleITK FAQ:
" SimpleITK supports most ITK image filters (see list) and the IO and registration frameworks. It exposes fewer settings than ITK, hence the Simple in the name. The main ITK elements ommited from SimpleITK are the pipeline architecture, spatial objects framework, point sets, and the mesh framework."

In the end it is up to you to make the judgement based on the functionality you need.

3 Likes

As @zivy mentioned, both SimpleITK and ITK support commercial development; they are distributed under an Apache 2.0.

ITK Python wrapping supports writing and reading transformation files, but the interface has not been convenient in the past; ITK 5.1 will provide Pythonic itk.transformread and itk.transformwrite functions similar to the itk.imread, itk.imwrite, itk.meshread, itk.meshwrite functions for images and meshes.

ITK has a Video framework for processing timeseries in real time. Wrapping has not been added, but it could be added.

ITK 5.1 supports working with xarray DataArray’s. These are essentially NumPy arrays with associated metadata. xarray includes support for a dimension, which could have a label t, whose coordinates are NumPy datetime64 values. This serves many times series processing needs well.

2 Likes

Thank you for your responses! Regarding itk.transformread and itk.transformwrite, my itk in Python does not recognize these functions. Does that mean it is not properly installed and maybe that is why I do not get some other functionalities of itk either? I updated my itk module by running the following command (I’m using Mac) but it did not make any difference:

pip install -I --pre itk

itk.transformread and itk.transformwrite will hopefully be included in the next release.

These will have to come in the next pre-release of ITK 5.2. Tracking issue.

@matt.mccormick — returning to this conversation, is there a page in the documentation to look up what’s wrapped in Python and what’s not? This changes from release to release, but I can’t find an easy way of searching ITK Python API.

For Example, there’s class itk::VideoFileReader in ITK 5.0 documentation, but I don’t see it in dir(itk) in Python. What is the easiest way of looking up something of this sort?

Also, I’m wondering am I being dumb, or is Google being coy with me — I can’t get to ITK 5.4 Doxygen documentation. I can see 6.0 Doxygen pages, but not 5.4.

The usual way for me to answer a question “is this class wrapped for Python” is to search for existence of itkClassName.wrap file in ITK source tree. Note that there are a few exceptions to this rule, mostly for important classes (e.g. itkImageToImageFilterA.wrap + itkImageToImageFilterB.wrap).

I’ve found, finally, how to get to previous ITK Doxygen pages, and it requires sharp eyesight — right at the very bottom of ITK: Insight Toolkit top level page there’s this:

image

Phew! I thought the world was moving forward too fast and too far and I was falling behind, hopelessly… But instead I’d say we need to celebrate the tiniest font being discovered on Interwebs, afresh! :trophy:

Maybe it would be worth putting those links somewhere closer to the header, for the sake of those who search…

ITK is rather stable now, and the documentation doesn’t change much between versions. So putting links to old versions prominently does not make much sense.

5.4 has not been announced yet, as some things haven’t been finished, such as creation of dedicated 5.4 documentation pages.

OK, ok. But then, should 6.0 Doxygen be the default landing page if 5.4 hasn’t been announced yet?

Ideally, it would not be long between tagging and doing all the release-related work. But we are thin on resources, and this deviation from ideal is one of the consequences. @matt.mccormick is this the right explanation?

Yes, I do have a feeling there’s a bit more work, especially at the moment. Anyway — I’m just getting my head around and really glad to have access to all this amazing work, and even more — looking forward to the upcoming releases! :heart_eyes_cat:

We are continuously improving our release process for faster and continuous releases. We are also gaining an additional release manager (@phcerdan). The ongoing status for finalization of the 5.4 release can be found here: