def registration_cost(xyz0, xyz1):
# 	scaled_xyz0, _ = registration.unit_boxify(xyz0)
# 	scaled_xyz1, _ = registration.unit_boxify(xyz1)
	
	f,g = registration.tps_rpm_bij(xyz0, xyz1, rot_reg=1e-3, n_iter=50)
	cost = (registration.tps_reg_cost(f) + registration.tps_reg_cost(g))/2.0
	return cost
def registration_cost(xyz0_p, xyz1_p):
    f,g = registration.tps_rpm_bij(xyz0_p[0], xyz1_p[0], rot_reg=tps_rot_reg, n_iter=tps_n_iter)
    cost = registration.tps_reg_cost(f) + registration.tps_reg_cost(g)
    f = registration.unscale_tps(f, xyz0_p[1], xyz1_p[1])
    g = registration.unscale_tps(g, xyz1_p[1], xyz0_p[1])

    return cost, f, g