# mask during image registration

**URL:** <https://discourse.itk.org/t/mask-during-image-registration/4413>\
**Category:** Beginner Questions\
**Created:** [September 11, 2021, 4:21am UTC](https://discourse.itk.org/t/mask-during-image-registration/4413 "2021-09-11T04:21:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anesh](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@Anesh](https://discourse.itk.org/u/Anesh)\
**Post date:** [September 11, 2021, 4:21am UTC](https://discourse.itk.org/t/mask-during-image-registration/4413/1 "2021-09-11T04:21:51Z")

</div>

Hi All,  
I have a basic question on registration using spatial object mask. Let’s say I have an image where the background is zero or close to zero and my mask is all ones, as illustrated below. When I run registration, will it take into account the surrounding voxels which are zero since the mask is 1 at these locations. This is the part I am confused on!

 ![image](https://discourse.itk.org/uploads/default/original/2X/1/1c1c864790e07c87defcb85783b4a4e1c2bd6ad8.png)  
Hope someone can clarify this for me.  
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:** [September 13, 2021, 3:49pm UTC](https://discourse.itk.org/t/mask-during-image-registration/4413/2 "2021-09-13T15:49:58Z")

</div>

> [@Anesh](#):
>
> my mask is all ones

If you supply a mask of all ones, it is theoretically the same as not supplying a mask at all. Practically, the no-mask option runs faster.

But yes, if your mask is all ones, the background pixels of (near) zero intensity will be taken into account.

---

<div class="post-metadata">

**Author:** ![Anesh](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@Anesh](https://discourse.itk.org/u/Anesh)\
**Post date:** [September 21, 2021, 2:32pm UTC](https://discourse.itk.org/t/mask-during-image-registration/4413/3 "2021-09-21T14:32:54Z")

</div>

Thanks!
