A, An original image. B, Image generated by rotating A and deforming the tip of the hat (dashed circle). C, An ordinary subtracted image that was obtained by subtracting image B from A. This step causes misregistration in which a large amount of the white or black area is seen. D and E, Subtracted images that were obtained by subtracting image A from the warped image of image B created by rigid and nonrigid registration, respectively. D, Deformation of the hat remains and leads to misregistration around the tip of the hat. E, Perfect subtraction by restoring the rotation and deformation.