# Registration problem

**URL:** <https://discourse.slicer.org/t/registration-problem/36544>\
**Category:** Support\
**Tags:** registration\
**Created:** [June 1, 2024, 11:33pm UTC](https://discourse.slicer.org/t/registration-problem/36544 "2024-06-01T23:33:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aysegul\_sayin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aysegul_sayin/32/14944_2.png) [@aysegul\_sayin](https://discourse.slicer.org/u/aysegul_sayin)\
**Post date:** [June 1, 2024, 11:33pm UTC](https://discourse.slicer.org/t/registration-problem/36544/1 "2024-06-01T23:33:17Z")

</div>

I have two volumes and I want to overlay them. However, as seen in the image, they do not perfectly overlay. I have set their origins to be the same, aligned their directions from IJK to RAS, adjusted their spacing values, dimensions, and affine matrices to be identical. Despite all these adjustments, they still do not overlay properly. What other parameters can I change to achieve this?

 ![Ekran Resmi 2024-06-02 02.20.29](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/9/793899fe6e863994d0f681563053e0784448d1ca.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 2, 2024, 1:03pm UTC](https://discourse.slicer.org/t/registration-problem/36544/2 "2024-06-02T13:03:49Z")

</div>

Please copy here the complete image header of both images.

---

<div class="post-metadata">

**Author:** ![aysegul\_sayin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aysegul_sayin/32/14944_2.png) [@aysegul\_sayin](https://discourse.slicer.org/u/aysegul_sayin)\
**Post date:** [June 2, 2024, 2:35pm UTC](https://discourse.slicer.org/t/registration-problem/36544/3 "2024-06-02T14:35:23Z")

</div>

this one is my volume:  
Image (0x7f7e26737340)  
RTTI typeinfo: itk::Image\<short, 3u\>  
Reference Count: 1  
Modified Time: 12445  
Debug: Off  
Object Name:  
Observers:  
none  
Source: (none)  
Source output name: (none)  
Release Data: Off  
Data Released: False  
Global Release Data: Off  
PipelineMTime: 12422  
UpdateMTime: 12444  
RealTimeStamp: 0 seconds  
LargestPossibleRegion:  
Dimension: 3  
Index: [0, 0, 0]  
Size: [256, 256, 256]  
BufferedRegion:  
Dimension: 3  
Index: [0, 0, 0]  
Size: [256, 256, 256]  
RequestedRegion:  
Dimension: 3  
Index: [0, 0, 0]  
Size: [256, 256, 256]  
Spacing: [0.2, 0.2, 0.2]  
Origin: [53.5598, 27.6676, -19.3769]  
Direction:  
-0.84309 -0.149155 -0.516674  
-0.122292 -0.88242 0.454291  
-0.523683 0.446193 0.725719

IndexToPointMatrix:  
-0.168618 -0.029831 -0.103335  
-0.0244584 -0.176484 0.0908582  
-0.104737 0.0892386 0.145144

PointToIndexMatrix:  
-4.21545 -0.61146 -2.61841  
-0.745774 -4.4121 2.23097  
-2.58337 2.27145 3.62859

Inverse Direction:  
-0.84309 -0.122292 -0.523683  
-0.149155 -0.88242 0.446193  
-0.516674 0.454291 0.725719

PixelContainer:  
ImportImageContainer (0x600006145920)  
RTTI typeinfo: itk::ImportImageContainer\<unsigned long, short\>  
Reference Count: 1  
Modified Time: 12441  
Debug: Off  
Object Name:  
Observers:  
none  
Pointer: 0x7f7dceae0000  
Container manages memory: true  
Size: 16777216  
Capacity: 16777216

and this one is original:  
Image (0x7f7df6974590)  
RTTI typeinfo: itk::Image\<short, 3u\>  
Reference Count: 1  
Modified Time: 8217  
Debug: Off  
Object Name:  
Observers:  
none  
Source: (none)  
Source output name: (none)  
Release Data: Off  
Data Released: False  
Global Release Data: Off  
PipelineMTime: 8194  
UpdateMTime: 8216  
RealTimeStamp: 0 seconds  
LargestPossibleRegion:  
Dimension: 3  
Index: [0, 0, 0]  
Size: [256, 256, 256]  
BufferedRegion:  
Dimension: 3  
Index: [0, 0, 0]  
Size: [256, 256, 256]  
RequestedRegion:  
Dimension: 3  
Index: [0, 0, 0]  
Size: [256, 256, 256]  
Spacing: [0.2, 0.2, 0.2]  
Origin: [53.5598, 27.6676, -19.3769]  
Direction:  
-0.84309 -0.149155 -0.516674  
-0.122292 -0.88242 0.454291  
-0.523683 0.446193 0.725719

IndexToPointMatrix:  
-0.168618 -0.029831 -0.103335  
-0.0244584 -0.176484 0.0908582  
-0.104737 0.0892386 0.145144

PointToIndexMatrix:  
-4.21545 -0.61146 -2.61841  
-0.745774 -4.4121 2.23097  
-2.58337 2.27145 3.62859

Inverse Direction:  
-0.84309 -0.122292 -0.523683  
-0.149155 -0.88242 0.446193  
-0.516674 0.454291 0.725719

PixelContainer:  
ImportImageContainer (0x600006179440)  
RTTI typeinfo: itk::ImportImageContainer\<unsigned long, short\>  
Reference Count: 1  
Modified Time: 8213  
Debug: Off  
Object Name:  
Observers:  
none  
Pointer: 0x7f7e52000000  
Container manages memory: true  
Size: 16777216  
Capacity: 16777216

there is two volume: [example\_nii - Google Drive](https://drive.google.com/drive/folders/1GtVvnPv0G-xs9hYxugUKF_ENNJM6fdSK?usp=sharing)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 2, 2024, 3:55pm UTC](https://discourse.slicer.org/t/registration-problem/36544/4 "2024-06-02T15:55:31Z")

</div>

Nifti file stores image orientation in a redundant and potentially ambiguous way, so this kind of issues are practically inevitable. I would recommend to use nrrd file format instead.

---

<div class="post-metadata">

**Author:** ![AlfredoMoralesPinzon](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@AlfredoMoralesPinzon](https://discourse.slicer.org/u/AlfredoMoralesPinzon)\
**Post date:** [June 6, 2024, 1:21am UTC](https://discourse.slicer.org/t/registration-problem/36544/5 "2024-06-06T01:21:47Z")

</div>

I loaded the images “case12” and “exm2” (exam2 loaded as a segmentation) in Slicer, and they are actually in the same space. However, the object is in different places in the images.

 ![Compare_case12_exm2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/7/e7fdd127d960b45ec4af251703c7fb60218c1a0c.png)
