# itk::ERROR Image(0x55f0ab8f5690): A spacing of 0 is not allowed: Spacing is \[0, 0, 0\]

**URL:** <https://discourse.itk.org/t/itk-error-image-0x55f0ab8f5690-a-spacing-of-0-is-not-allowed-spacing-is-0-0-0/3648>\
**Category:** Algorithms\
**Tags:** deformable, registration\
**Created:** [November 25, 2020, 8:37pm UTC](https://discourse.itk.org/t/itk-error-image-0x55f0ab8f5690-a-spacing-of-0-is-not-allowed-spacing-is-0-0-0/3648 "2020-11-25T20:37:07Z")\
**Posts on this page:** 4\
**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:** [November 25, 2020, 8:37pm UTC](https://discourse.itk.org/t/itk-error-image-0x55f0ab8f5690-a-spacing-of-0-is-not-allowed-spacing-is-0-0-0/3648/1 "2020-11-25T20:37:07Z")

</div>

Hello, everyone!  
I am struggling with that error:  
`itk::ERROR Image(0x55f0ab8f5690): A spacing of 0 is not allowed: Spacing is [0, 0, 0]`

The situation is the following:  
I am performing a multistage image registration.  
First stage is a `rigid transform` (`3DVersorRigidTransform`) using the `regularStepGradientDiscentOptimizer`;

After that I resample the moving image to obtained a rigidly registered image.

That image is used as the input for the` deformable stage`.  
This stage starts ok, but crashes right away with that `error message`.

I already tested the process with two different optimizers for the deformable stage: `LBFGSBOptimizer` and `LBFGSOptimizer` . No success though.

Any clues are welcome.  
Thanks,

Leo.

---

<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:** [November 25, 2020, 10:43pm UTC](https://discourse.itk.org/t/itk-error-image-0x55f0ab8f5690-a-spacing-of-0-is-not-allowed-spacing-is-0-0-0/3648/2 "2020-11-25T22:43:57Z")

</div>

Sounds like you have a bug in your code. Trying to create a MWE might reveal it.

---

<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:** [November 26, 2020, 1:07pm UTC](https://discourse.itk.org/t/itk-error-image-0x55f0ab8f5690-a-spacing-of-0-is-not-allowed-spacing-is-0-0-0/3648/3 "2020-11-26T13:07:39Z")

</div>

I’m not aware of how to create and handle a **MWE**.  
Could you go into the specifics of that?

I also tried to debug with Qt Creator, but no success.

My pipeline is based on `DeformableRegistration8.cxx`.  
I even tried to run the example alone, but it is running tooo slow, and the optimizer output do not sound reasonable.

Thanks.

---

<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:** [November 26, 2020, 4:41pm UTC](https://discourse.itk.org/t/itk-error-image-0x55f0ab8f5690-a-spacing-of-0-is-not-allowed-spacing-is-0-0-0/3648/4 "2020-11-26T16:41:23Z")

</div>

Here are some instructions on how to create [minimum working example (MWE)](http://sscce.org/).
