Correction of intensity nonuniformity in MR images of any orientation