# Applying affine transform to label image in ITK

**URL:** <https://discourse.itk.org/t/applying-affine-transform-to-label-image-in-itk/3130>\
**Category:** Algorithms\
**Created:** [May 29, 2020, 6:57pm UTC](https://discourse.itk.org/t/applying-affine-transform-to-label-image-in-itk/3130 "2020-05-29T18:57:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EE18D504\_SINDHURA\_C](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/b3f665/32.png) [@EE18D504\_SINDHURA\_C](https://discourse.itk.org/u/EE18D504_SINDHURA_C)\
**Post date:** [May 29, 2020, 6:57pm UTC](https://discourse.itk.org/t/applying-affine-transform-to-label-image-in-itk/3130/1 "2020-05-29T18:57:50Z")

</div>

I did affine transformation between Moving and Fixed images. My moving image has label image too. After finding the transformation, I want to apply it to the label image of moving image and get the label for fixed image.  
For the images that are of similar intensities and taken from the same scanner, I am able to transfer the label. Why is it not happening for the images taken on different scanners?  
I’m using NNinterpolator right now.

---

<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:** [May 29, 2020, 7:51pm UTC](https://discourse.itk.org/t/applying-affine-transform-to-label-image-in-itk/3130/2 "2020-05-29T19:51:51Z")

</div>

If you do registration correctly, and use [resample](https://itk.org/ITKExamples/src/Filtering/ImageGrid/ResampleAnImage/Documentation.html) filter, it should not matter whether images came from the same scanner or from different modalities. Double check that the label map perfectly overlays the image you are registering to (by visualizing them in [Slicer](https://www.slicer.org/)). Also double check you are applying the transform in the correct direction (direct or inverse).
