# Problem in spacing and origin

**URL:** https://discourse.itk.org/t/problem-in-spacing-and-origin/3137
**Category:** Beginner Questions
**Created:** [June 1, 2020, 4:21pm UTC](https://discourse.itk.org/t/problem-in-spacing-and-origin/3137 "2020-06-01T16:21:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![basal](https://discourse.itk.org/letter_avatar_proxy/v4/letter/b/a8b319/32.png) [@basal](https://discourse.itk.org/u/basal)
#### Post date: [June 1, 2020, 4:21pm UTC](https://discourse.itk.org/t/problem-in-spacing-and-origin/3137/1 "2020-06-01T16:21:47Z")

</div>

Hi all,  
I am using thinplate spline algorithm to deform my landmarks. I have landmarks’ coordinates in index format. The problem is that when the spacing and origin of my nrrd image are 1 and 0 respectively, the result is desirable but when I change the spacing and origin of the input image to the values that I want to have, the output image is black. Dos anyone know what is the solution?

---

<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: [June 1, 2020, 4:59pm UTC](https://discourse.itk.org/t/problem-in-spacing-and-origin/3137/2 "2020-06-01T16:59:46Z")

</div>

In ITK in general, you are expected to work in physical space and not in index space, convert your indexes to physical points using the image’s `TransformIndexToPhysicalPoint` method then compute your thinplate spline.

When the spacing is all 1’s and origin 0’s the physical and index space coincide - this is rare for medical and microscopy images.

---

<div class="post-metadata">

### Author: ![basal](https://discourse.itk.org/letter_avatar_proxy/v4/letter/b/a8b319/32.png) [@basal](https://discourse.itk.org/u/basal)
#### Post date: [June 1, 2020, 6:33pm UTC](https://discourse.itk.org/t/problem-in-spacing-and-origin/3137/3 "2020-06-01T18:33:40Z")

</div>

Thanks for your helpful answer. Could you please let me know in thinplate spline code, the input image would be our target image?

---

<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: [June 1, 2020, 7:44pm UTC](https://discourse.itk.org/t/problem-in-spacing-and-origin/3137/4 "2020-06-01T19:44:18Z")

</div>

Not sure exactly what you are asking for, in any case, here is a link to a [C++ example](https://itk.org/Doxygen/html/Examples_2RegistrationITKv4_2ThinPlateSplineWarp_8cxx-example.html).
