About using mask and sampling simultaneously in registration

When these two strategies are used at the same time, is the sampling point selected only in the mask area?

In itkImageRegistrationMethodv4.hxx, the sample points are taken from the whole image, without respect to the masks.

The similarity metric checks if the point is “valid”, which includes checking if the point is inside the bounding box of the image being sampled, and if it’s inside a mask.

Using masks that are too small, or that don’t overlap well, can result in the number of valid points being quite small, which can cause poor performance or errors. A good initial alignment (eg, aligning the center of mass of the masks in the fixed and moving space) can avoid this.

1 Like

thank you very much