add affine registration code example