# Using Python for image registration

**URL:** https://discourse.slicer.org/t/using-python-for-image-registration/5207
**Category:** Development
**Tags:** python
**Created:** [December 27, 2018, 9:32pm UTC](https://discourse.slicer.org/t/using-python-for-image-registration/5207 "2018-12-27T21:32:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dinank](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@dinank](https://discourse.slicer.org/u/dinank)
#### Post date: [December 27, 2018, 9:32pm UTC](https://discourse.slicer.org/t/using-python-for-image-registration/5207/1 "2018-12-27T21:32:09Z")

</div>

Operating system: Linux  
Slicer version: 4.8.1

I am new to Slicer and I have a task to register MRI and CT volumes using Rigid registration. I have a large data and do not want to repeat the process many times for different patients, as I currently do. I was wondering if it is possible to streamline this process, where I just use the file locations of MRI and CT volumes and Slicer does registration and saves a new file. I use Python for analyzing the images so was hoping if there was a way that I can use Python for this.  
Thanks!

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [December 29, 2018, 5:53pm UTC](https://discourse.slicer.org/t/using-python-for-image-registration/5207/2 "2018-12-29T17:53:50Z")

</div>

Yes, writing a script to run registration on your data should be straightforward.

This would be a good place to start learning about how:

[https://www.slicer.org/wiki/Documentation/Nightly/Developers/Modules#Scripted\_Modules](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Modules#Scripted_Modules)

Also you should look at the [CaseIterator](https://github.com/JoostJM/SlicerCaseIterator) as a start point for looping through collections of data.
