A novel algorithm for registering brain images in magnetic resonance imaging is presented. It is based on an improved variant to the classic tensor-based moment-of-inertia rigid body method. Given a reference image and a test to register, binary masks are applied so that only pixels above a given threshold are used for the calculation. Application of a low pass Hanning filter on k-space data is new and adds an important constraint to the procedure in order to reduce the errors associated with finite sampling. Further, this process is applied iteratively and leads to an improved accuracy due to the filtering step. The algorithm is validated with simulation data and with added noise. In analyzing this error, a Euclidean distance measure and MSE (mean square error) are used. The average accuracy was 1.8×10−4 fractional pixel for misplacements along X and Y axes and MSE is 0.01 for the error image. The average value of accuracy was 5.8×10−3, 1.8×10−5 deg, and 1.7×10−4 deg for rotations about X, Y and Z axes. The accuracy was better than 4×10−3 fractional pixel for misplacement for estimated SNR varying between 100:1 and 6:1. The algorithm is found to be superior to that obtained by using a single iteration of the tensor-based registration method.