# Simple image registration

**URL:** https://discourse.itk.org/t/simple-image-registration/615
**Category:** Beginner Questions
**Created:** [January 23, 2018, 1:44pm UTC](https://discourse.itk.org/t/simple-image-registration/615 "2018-01-23T13:44:18Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [January 23, 2018, 1:44pm UTC](https://discourse.itk.org/t/simple-image-registration/615/1 "2018-01-23T13:44:19Z")

</div>

Sir,  
I have 2 images of crop field taken in one year gap interval. I want to detect how much change has occurred in the crop height wise and width wise automatically through ITK. Firstly, I want to do registration of these two images and then program it in such a way that I get to know the changes. So, please help me through it.  
Thankyou.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [January 24, 2018, 3:52pm UTC](https://discourse.itk.org/t/simple-image-registration/615/2 "2018-01-24T15:52:18Z")

</div>

You should look at [ItkSoftwareGuide](https://itk.org/ItkSoftwareGuide). More specifically, book 1, section 4.1 (data representation - image) and book 2, section 3 (registration) - especially the first few introductory subsections (3.1 to 3.5), and 3.15 (visualizing deformation fields).

A good example to start from is [this one](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/RegistrationITKv4/DeformableRegistration15.cxx).

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [January 24, 2018, 6:33pm UTC](https://discourse.itk.org/t/simple-image-registration/615/3 "2018-01-24T18:33:59Z")

</div>

Thankyou😊

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [January 30, 2018, 2:30pm UTC](https://discourse.itk.org/t/simple-image-registration/615/4 "2018-01-30T14:30:31Z")

</div>

Sir,  
Where should I see my output image whether it has been registered or  
not? I’m also finding difficulties in opening ZRAW files, how should I open  
it?  
Please help me through it.  
Thank you.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [January 30, 2018, 2:34pm UTC](https://discourse.itk.org/t/simple-image-registration/615/5 "2018-01-30T14:34:22Z")

</div>

You can see images using [ITK-SNAP](http://www.itksnap.org/) or [Slicer](https://www.slicer.org/). But they have to be written to a file on disk, e.g. using [image file writer](https://itk.org/Doxygen/html/classitk_1_1ImageFileWriter.html). `.zraw` files are usually accompanied by a small header file, you should “open” the header file, not `.zraw` directly.

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [January 31, 2018, 8:37am UTC](https://discourse.itk.org/t/simple-image-registration/615/6 "2018-01-31T08:37:10Z")

</div>

Sir,  
Can we take general images(scenery, human face, etc) rather than  
medical images in itk snap?  
I also want to know that I took my own two similar images of bottle and  
named it as bottle1.png and bottle2.png and run the program of  
imageregistration2.cxx in visual studio 2017. Where ever there was name of  
brainprotondensity as input1 and input2, I rewrote it as bottle1 and  
bottle2 and after running the program no errors were shown to me. But I  
could not be abled to find my output images to see whether it has been  
registered or not.  
So, please kindly help me and tell me where I’m doing it wrong.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [January 31, 2018, 1:32pm UTC](https://discourse.itk.org/t/simple-image-registration/615/7 "2018-01-31T13:32:08Z")

</div>

Are `bottle1.png` and `bottle2.png` grayscale or RGB? Converting to grayscale might help.

Which command line parameters are you using? Putting full path to output file will make it clear where it is located.

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [February 1, 2018, 5:46am UTC](https://discourse.itk.org/t/simple-image-registration/615/8 "2018-02-01T05:46:21Z")

</div>

Sir,  
I am not finding the output path of imageregistration2.cxx.

 ![](https://discourse.itk.org/uploads/default/original/1X/677f06bdf711468707faf594c72c7993f90d2513.png)

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [February 3, 2018, 1:40pm UTC](https://discourse.itk.org/t/simple-image-registration/615/9 "2018-02-03T13:40:08Z")

</div>

Sir,  
I configured ImageregistrationITKv3 through cmake and it configured  
successfully. But when I tried running All\_Build.vcxproj, I came up with 51  
errors of itkmacro.h and itkImageFileReaderException.h. How can I solve it?

 ![](https://discourse.itk.org/uploads/default/original/1X/677f06bdf711468707faf594c72c7993f90d2513.png)

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [February 3, 2018, 7:13pm UTC](https://discourse.itk.org/t/simple-image-registration/615/10 "2018-02-03T19:13:59Z")

</div>

Can you post the error messages? Did you just turn on BUILD\_EXAMPLES, or did you create a new CMakeLists.txt for it?

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [February 4, 2018, 5:05am UTC](https://discourse.itk.org/t/simple-image-registration/615/11 "2018-02-04T05:05:57Z")

</div>

Can you post the error messages? Did you just turn on BUILD\_EXAMPLES, or did you create a new CMakeLists.txt for it?

Visit Topic or reply to this email to respond.  
To unsubscribe from these emails, click here.

 ![](https://discourse.itk.org/uploads/default/original/1X/cd93b5e6b0022939e39499f89ab2c83eb4c93c1e.png)

 ![](https://discourse.itk.org/uploads/default/original/1X/677f06bdf711468707faf594c72c7993f90d2513.png)

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [February 4, 2018, 5:07am UTC](https://discourse.itk.org/t/simple-image-registration/615/12 "2018-02-04T05:07:47Z")

</div>

I did not create a new CMakelists.txt. I just run the program ITKTmageRegistrationv3.sln and errors are coming.

 ![](https://discourse.itk.org/uploads/default/original/1X/677f06bdf711468707faf594c72c7993f90d2513.png)

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [February 6, 2018, 5:52am UTC](https://discourse.itk.org/t/simple-image-registration/615/13 "2018-02-06T05:52:08Z")

</div>

Sir,  
While I built my ITKv3ImageRegistration.sln project, I came up with  
cmd.exe exited with code1.  
I am using CMake 3.10.0 to generate my project. I tried to re-build all the  
projects, I saw the message: CMake is re running because CMake  
files/generate.stamp is out of date.  
Sir, please help it through it.

 ![](https://discourse.itk.org/uploads/default/original/1X/677f06bdf711468707faf594c72c7993f90d2513.png)

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [February 6, 2018, 1:32pm UTC](https://discourse.itk.org/t/simple-image-registration/615/14 "2018-02-06T13:32:29Z")

</div>

When configuring ITK, in CMake enable BUILD\_EXAMPLES:

 ![36](https://discourse.itk.org/uploads/default/original/1X/67c5440bead7f045a6ad3a680556c24e04e8d24a.png)  
Then configure, generate and build ITK normally. Now, you should be able to use examples either directly from `ITK.sln`, or from `ITKv3ImageRegistration.sln`. If you run into issues, building in a new build directory (e.g. `C:\Dev\ITK-build2\` on my computer) should help.

---

<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: [March 5, 2018, 9:18pm UTC](https://discourse.itk.org/t/simple-image-registration/615/15 "2018-03-05T21:18:48Z")

</div>

3 posts were split to a new topic: [ITK\_COMPILER\_INFO\_MSVC\_CXX.h No such file or directory](https://discourse.itk.org/t/itk-compiler-info-msvc-cxx-h-no-such-file-or-directory/736)

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [March 5, 2018, 6:55pm UTC](https://discourse.itk.org/t/simple-image-registration/615/18 "2018-03-05T18:55:37Z")

</div>

Sir,  
I did the same what you told but still 2 errors is coming after building up the project -

 ![](https://discourse.itk.org/uploads/default/original/1X/ef663cc9607d7257de190d221e0ef23b2ede627a.png)

 ![](https://discourse.itk.org/uploads/default/original/1X/677f06bdf711468707faf594c72c7993f90d2513.png)

---

<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: [March 5, 2018, 7:49pm UTC](https://discourse.itk.org/t/simple-image-registration/615/19 "2018-03-05T19:49:13Z")

</div>

It sounds like your ITK build may be corrupt. Please try removing the entire ITK build.

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [March 15, 2018, 8:28am UTC](https://discourse.itk.org/t/simple-image-registration/615/20 "2018-03-15T08:28:00Z")

</div>

I generate the Visual Studio C++ solution and project files using the cmake-gui. I am able to build the project, but when I try to run the project I get a prompt stating that the ITKDATA-Debug Win32 and KWStyle project is out of date and asks if I would like to rebuild it. When I select ‘Yes’ I get an error stating: ‘Unable to start program …Path…/Debug/ALL\_BUILD The system cannot find the file specified’. I did a lot of searching but was unable to find. Has anyone encountered something like this before? Please help me through it.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [March 15, 2018, 2:04pm UTC](https://discourse.itk.org/t/simple-image-registration/615/21 "2018-03-15T14:04:50Z")

</div>

You need to select which example will be launched once you press F5. To do that, right click on an example name in the list of projects in Solution Explorer, then select “Set as startup project”. ALL\_BUILD is not an executable, and it would be surprising if you could somehow run it 😃

---

<div class="post-metadata">

### Author: ![ankita](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/91b2a8/32.png) [@ankita](https://discourse.itk.org/u/ankita)
#### Post date: [March 17, 2018, 3:02pm UTC](https://discourse.itk.org/t/simple-image-registration/615/22 "2018-03-17T15:02:26Z")

</div>

Thank you sir. It worked!!!😊

[Next page](https://discourse.itk.org/t/simple-image-registration/615.md?page=2)
