# Elastix AND Python Scripting

**URL:** <https://discourse.slicer.org/t/elastix-and-python-scripting/15923>\
**Category:** Support\
**Tags:** registration, python, elastix\
**Created:** [February 9, 2021, 9:06pm UTC](https://discourse.slicer.org/t/elastix-and-python-scripting/15923 "2021-02-09T21:06:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HodaGH](https://avatars.discourse-cdn.com/v4/letter/h/858c86/32.png) [@HodaGH](https://discourse.slicer.org/u/HodaGH)\
**Post date:** [February 9, 2021, 9:06pm UTC](https://discourse.slicer.org/t/elastix-and-python-scripting/15923/1 "2021-02-09T21:06:39Z")

</div>

Hi all,

I want to perform groupwise registration as described here [Groupwise Registration — SimpleElastix 0.1 documentation](https://simpleelastix.readthedocs.io/GroupwiseRegistration.html) with python scripting. Should I build Elastix from scratch or is there a way to do it with 3D slicer ?

Thanks.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 9, 2021, 9:17pm UTC](https://discourse.slicer.org/t/elastix-and-python-scripting/15923/2 "2021-02-09T21:17:43Z")

</div>

You can get Elastix by installing SlicerElastix extension or downloading Elastix binaries from their website or pip install SimpleElastix (`pip_install('SimpleElastix')`). You can use all these from Python in Slicer.

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [April 5, 2021, 4:32pm UTC](https://discourse.slicer.org/t/elastix-and-python-scripting/15923/3 "2021-04-05T16:32:15Z")

</div>

On the current stable (4.11.20210226), `pip_install('SimpleElastix')` gives the following error for me:

```
ERROR: Could not find a version that satisfies the requirement SimpleElastix
ERROR: No matching distribution found for SimpleElastix

```

Should this work?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 26, 2021, 10:23pm UTC](https://discourse.slicer.org/t/elastix-and-python-scripting/15923/4 "2021-04-26T22:23:36Z")

</div>

It looks like the SimpleElastix package is only for Python2. It relies on SimpleITK for current Python versions: [SimpleITK-SimpleElastix · PyPI](https://pypi.org/project/SimpleITK-SimpleElastix/)
