Hi All<div><br></div><div>I am solving somehow standard affine registration problem. I have image X(fixed img) and atlas A(moving img) with segmentation Sa. I am onlye interested in quality of  registering of one structure that is segmented in Sa. Of course the first idea is to use SetMovingImageMask( Sa ), however in that case I get  &quot;Too many samples map outside moving image buffer Vi/Vf&quot; error, because even when my small atlas A is fully overlapped with image X, volume of A is much less then the volume of X, and i get that hardcoded exception about samples. The same story, if I am cropping atlas image A, using bounding box for nonzero elements of Sa. </div>

<div><br></div><div>The second idea is to swap A and X and use A as fixed image and X as moving. Then I will be able to crop A and set appropriate fixed image region, so that there will be enough samples in that fixed image region. And also not to forget inverting the resulting transform. That somehow works, but it looks incredibly ugly and cant be used in case when the transform is not invertable.</div>

<div><br></div><div>So the question is: can I somehow ignore that annoying &quot;too many samples map outside moving...&quot;, without changing the ITK source and recompiling the whole thing again(moreover, I cannot do it on cluster that I use). May be some method, for setting MovingImageRegion, etc?</div>

<div><br></div><div>Thanks,</div><div>Valeriy.</div>