# Does simple ITK (python) offers all the functionalities as the C++ ITK?

**URL:** <https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890>\
**Category:** Uncategorized\
**Created:** [April 1, 2020, 3:29pm UTC](https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890 "2020-04-01T15:29:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![machadoL](https://discourse.itk.org/user_avatar/discourse.itk.org/machadol/32/662_2.png) [@machadoL](https://discourse.itk.org/u/machadoL)\
**Post date:** [April 1, 2020, 3:29pm UTC](https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890/1 "2020-04-01T15:29:49Z")

</div>

A question:  
Does simple ITK (python) offers all the functionalities as the C++ ITK?

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [April 1, 2020, 3:46pm UTC](https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890/2 "2020-04-01T15:46:42Z")

</div>

SimpleITK provides a higher level interface to ITK image filters, IO, and registration framework with broad support for pixel types, and images of 2,3, and limited 4D support.

More information can be found on [read the docs](https://simpleitk.readthedocs.io/en/master/), and the [example notebooks](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks).

---

<div class="post-metadata">

**Author:** ![machadoL](https://discourse.itk.org/user_avatar/discourse.itk.org/machadol/32/662_2.png) [@machadoL](https://discourse.itk.org/u/machadoL)\
**Post date:** [April 1, 2020, 7:30pm UTC](https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890/3 "2020-04-01T19:30:56Z")

</div>

Thanks for answering my questions.  
What I really wanted to ask is if SIMPLE ITK can do/perform all the functionalities of the standard ITK. Can it? Or simple ITK is somewhat limited?

Thanks.

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [April 1, 2020, 7:41pm UTC](https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890/4 "2020-04-01T19:41:59Z")

</div>

Hello @machadoL,  
SimpleITK supports most (not all) ITK filters and the registration framework. It exposes fewer settings than ITK, hence the Simple.  
Generally speaking, if you are not dependent upon an existing code base, I would start my path into the ITK world using SimpleITK, and when you encounter something that is not doable in SimpleITK move to ITK. This type of transition does not mean that you need to rewrite your SimpleITK code base as mixing SimpleITK and ITK code is straightforward.

---

<div class="post-metadata">

**Author:** ![dchen](https://discourse.itk.org/user_avatar/discourse.itk.org/dchen/32/34_2.png) [@dchen](https://discourse.itk.org/u/dchen)\
**Post date:** [April 1, 2020, 7:49pm UTC](https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890/5 "2020-04-01T19:49:15Z")

</div>

Here are the filters available in SimpleITK:

[https://simpleitk.readthedocs.io/en/master/filters.html](https://simpleitk.readthedocs.io/en/master/filters.html)

To augment what @zivy said, SimpleITK does not expose ITK’s pipeline architecture. I, personally, prefer to keep that hidden, but there are situations where performance could suffer.

ITK-python wraps almost all of ITK (I think) and does expose the pipeline, if you need that. On the other hand, dealing with the templated pixel-type stuff in python is not fun (IMHO).

---

<div class="post-metadata">

**Author:** ![Stephen\_Aylward](https://discourse.itk.org/user_avatar/discourse.itk.org/stephen_aylward/32/654_2.png) [@Stephen\_Aylward](https://discourse.itk.org/u/Stephen_Aylward)\
**Post date:** [April 1, 2020, 7:58pm UTC](https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890/6 "2020-04-01T19:58:21Z")

</div>

Note that with ITK Python you no longer need to deal with “templated pixel-type stuff” 🙂

In fact, you can apply ITK Python filters directly to Numpy arrays and such. It is quite amazing what can now be done in a very python-esq manner using ITK-Python:

Here is a snippet of ITK Python code working on ITK images

```python
import itk
import sys

input_filename = sys.argv[1]
output_filename = sys.argv[2]

image = itk.imread(input_filename)
median = itk.median_image_filter(image, radius=2)
itk.imwrite(median, output_filename)

```

Here is a snippet of ITK Python code working on Numpy.ndarrays

```python
import numpy as np
import itk

image = itk.imread('/path/to/image.tif')
array = np.asarray(image)
smoothed = itk.median_image_filter(array, radius=2)

```

The variable smoothed will be an numpy.ndarray, since array (passed to the itk filter) was a numpy.ndarray.

Enjoy itk!

Stephen

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [April 1, 2020, 9:10pm UTC](https://discourse.itk.org/t/does-simple-itk-python-offers-all-the-functionalities-as-the-c-itk/2890/7 "2020-04-01T21:10:12Z")

</div>

A few of the additional fun and useful data structures and filters available in the ITK Python wrapping are SpatialObject’s, PointSet’s, and Mesh’s.
