# General Registration (BRAINS) does not seem to work properly

**URL:** <https://discourse.slicer.org/t/general-registration-brains-does-not-seem-to-work-properly/28650>\
**Category:** Support\
**Tags:** registration\
**Created:** [March 29, 2023, 10:18am UTC](https://discourse.slicer.org/t/general-registration-brains-does-not-seem-to-work-properly/28650 "2023-03-29T10:18:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luke90](https://avatars.discourse-cdn.com/v4/letter/l/bcef8e/32.png) [@luke90](https://discourse.slicer.org/u/luke90)\
**Post date:** [March 29, 2023, 10:18am UTC](https://discourse.slicer.org/t/general-registration-brains-does-not-seem-to-work-properly/28650/1 "2023-03-29T10:18:33Z")

</div>

Hello guys,

I have done a registration in the general registration module (BRAINS) but the output image volume does not match with the fixed image volume. The goal is to apply a linear transformation (rotation and translation) to a CT dicom volume and then save the transformed volume as dicom. As you can see, I have imported the CT dicom volume (fix\_img) and I have cloned it (mov\_img).  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/8/9804b89bd60dd906b19206c79c86ae36fb1fabbf.png)  
In the Transform module I have created a new linear transform,  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/f/2f7eeb89e07d0607ba85af43a366db50192e4d93.png)  
I have moved the fix\_img under Transformed  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/7/773c5d349ea6f22f8546316460178b4bd7eaa8ac.png)  
and then I have rotated and translated the volume.  
As you can see in the image below, I created a transform matrix with different rotations and translations. Strangely, unlike the translations, the rotations of the planes seem set to 0° despite being present in the Transform matrix. In other words, for example if I rotate the LR plane of 20° and then rotate the IS plane of 10°, then the rotation of the LR plane will be shown at 0°. I don’t know if this will affect the final result in any way.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/1/3110aecc9fd25a92b60d1c4b2c3b71ce5d82c952.png)  
Then I have applied the transformations to the fix\_img using Harden transform.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/4/9478df3f72be01ab51a1c3d6b5142d006d8e2659.png)  
In the general registration (BRAINS) module, I have set as Fixed Image volume the fix\_img and as Moving Image volume the mov\_img that will be transformed into the fixed image space using the linear transformation.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/2/a2011c508f9036f613f3ddd48d0f3fa544dde093.png)

Unfortunately, Output image volume is not properly rotated and translated.  
Another strange thing I have noticed is that if I go back to Data and display the fix\_img volume, it doesn’t seem rotated and translated even though I have used harden transform. If I re-apply the linear transformation to the fix\_img volume it is correctly rotated and moved. But this should not happen as I have already applied the linear transformation using harden transform. It is as if selecting a volume in Data, each transformation is deleted.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/9/99435f6795dc7c4ac49ea44003d8b095dbb6ac92.png)  
Does anyone know how to save a dicom volume with a new reference system after a linear transformation?  
Thank you

---

<div class="post-metadata">

**Author:** ![luke90](https://avatars.discourse-cdn.com/v4/letter/l/bcef8e/32.png) [@luke90](https://discourse.slicer.org/u/luke90)\
**Post date:** [March 29, 2023, 5:53pm UTC](https://discourse.slicer.org/t/general-registration-brains-does-not-seem-to-work-properly/28650/2 "2023-03-29T17:53:08Z")

</div>

I found a solution. I used the resample image module and was able to save the transformed volume without any problems
