# Use masks for registration in itk-elastix

**URL:** <https://discourse.itk.org/t/use-masks-for-registration-in-itk-elastix/7051>\
**Category:** Beginner Questions\
**Created:** [July 11, 2024, 4:10pm UTC](https://discourse.itk.org/t/use-masks-for-registration-in-itk-elastix/7051 "2024-07-11T16:10:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cousin](https://discourse.itk.org/user_avatar/discourse.itk.org/cousin/32/4291_2.png) [@cousin](https://discourse.itk.org/u/cousin)\
**Post date:** [July 11, 2024, 4:10pm UTC](https://discourse.itk.org/t/use-masks-for-registration-in-itk-elastix/7051/1 "2024-07-11T16:10:46Z")

</div>

Greetings to everyone,

I am discovering itk-elastix in python (module loaded as itk) and I am starting to use `itk.elastix_registration_method`

I could not find the signature of this function but managed to grab some information from the example notebooks. Thanks a lot for preparing these notebooks.

However, I would like to use masking for my registrations.  
Please, can anyone tell me how this is specified in the arguments of `itk.elastix_registration_method` ?

Best,  
Gaël.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [July 23, 2024, 2:30pm UTC](https://discourse.itk.org/t/use-masks-for-registration-in-itk-elastix/7051/2 "2024-07-23T14:30:35Z")

</div>

Hi Gaël,

Welcome to the ITK community! 🌞

To use masks with itk-elastix, pass

`fixed_mask=fixed_mask, moving_mask=moving_mask,`

to `itk.elastix_registration_method`.

A full example can be found in [this notebook](https://github.com/InsightSoftwareConsortium/ITKElastix/blob/main/examples/ITK_Example03_Masked_3D_Registration.ipynb).

---

<div class="post-metadata">

**Author:** ![cousin](https://discourse.itk.org/user_avatar/discourse.itk.org/cousin/32/4291_2.png) [@cousin](https://discourse.itk.org/u/cousin)\
**Post date:** [August 7, 2024, 4:05pm UTC](https://discourse.itk.org/t/use-masks-for-registration-in-itk-elastix/7051/3 "2024-08-07T16:05:57Z")

</div>

Thank you very much Matt !
