I ve sent two posts but the first did not show up.
RE: my post on 23 NOV 09
If one of the sub-regions in b-spline registration corresponds to a totally masked out part of the image (hence the mask is not empty but populated only by zeros), then the image_difference in the MI returns an NaN value.
As a workaround you can probably check for this case and simply set the image similarity to 0 for these regions. See previous post for the exact if statement
regarding the masks, could you please confirm what their structure should be? Is it just an image that contains 0s and 1s (where 0s correspond to areas to be masked out)
should the images to be registered be the same size? I also see that at some point in register_images.m you resize the moving image to have the same size with static... fair enough... you don't do this for the masks and I think the system complains about this
I don't understand how is it possible to expect, if you remove the masked pixels, to be able to reshape U or V to the same size prior to the pixel removal? A 32x32 image (vectorized 1024x1). Your remove lets say 5 pixels from the vector - now 1019x1, and then you ask it to be reshaped back to 32x32
(my version at least complains)
could you please elaborate on the usages of masks and if they have been tested?
thanks alot for your time and effort and for sharing this with us