# Registering 2D images using Slicer Elastix

**URL:** <https://discourse.slicer.org/t/registering-2d-images-using-slicer-elastix/25379>\
**Category:** Support\
**Created:** [September 21, 2022, 4:55pm UTC](https://discourse.slicer.org/t/registering-2d-images-using-slicer-elastix/25379 "2022-09-21T16:55:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krishna\_Nanda](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/krishna_nanda/32/7632_2.png) [@Krishna\_Nanda](https://discourse.slicer.org/u/Krishna_Nanda)\
**Post date:** [September 21, 2022, 4:55pm UTC](https://discourse.slicer.org/t/registering-2d-images-using-slicer-elastix/25379/1 "2022-09-21T16:55:30Z")

</div>

Operating system: Windows 10  
Slicer version: 5.0.3  
Expected behavior: Completes successfully  
Actual behavior: Error during registration

Hello,

I am trying to register 2 X-ray images using the Slicer Elastix module with preset: generic (all). However the registration fails with the message “Error occurred during actual registration”. I also saw the following messages “Stopping Condition: Error in metric.” and “Description: ITK ERROR: Region ImageRegion (00000042EDDFCCD0)  
Dimension: 3  
Index: [-9223372036854775808, -9223372036854775808, -9223372036854775808]  
Size: [4, 4, 4]  
is outside of buffered region ImageRegion (0000019CA452D440)  
Dimension: 3  
Index: [0, 0, 0]  
Size: [11, 11, 4]”.

I wanted to check if Slicer Elastix supports registration of 2D images as is, similar to say the original Elastix or Simple Elastix? Any advice on running this registration successfully will be helpful.

Thank you!

---

<div class="post-metadata">

**Author:** ![Krishna\_Nanda](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/krishna_nanda/32/7632_2.png) [@Krishna\_Nanda](https://discourse.slicer.org/u/Krishna_Nanda)\
**Post date:** [September 25, 2022, 2:37am UTC](https://discourse.slicer.org/t/registering-2d-images-using-slicer-elastix/25379/2 "2022-09-25T02:37:46Z")

</div>

Hello, any suggestions will be greatly helpful, thank you!

---

<div class="post-metadata">

**Author:** ![Krishna\_Nanda](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/krishna_nanda/32/7632_2.png) [@Krishna\_Nanda](https://discourse.slicer.org/u/Krishna_Nanda)\
**Post date:** [January 10, 2023, 12:04pm UTC](https://discourse.slicer.org/t/registering-2d-images-using-slicer-elastix/25379/3 "2023-01-10T12:04:30Z")

</div>

Any pointers will be helpful, thank you!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [January 10, 2023, 5:28pm UTC](https://discourse.slicer.org/t/registering-2d-images-using-slicer-elastix/25379/4 "2023-01-10T17:28:21Z")

</div>

If you want to do 2D registrations you are probably better of using the Elastix or ANTS directly, and not from Slicer.

Slicer treats every dataset, even if it is a single slice as if it is 3D. You can see from the output that there are three dimensions (4,4,4) reported for your data. Even if the registration concludes successfully, this is probably not going to be an ideal result (because every voxel can now move in 3D space as opposed in 2D as they should).
