code: def compute_scaled_registration_error(xyz, T_gt, T_est, tol=1e-12):
      """
      compute the registration error as defined in:
      https://arxiv.org/pdf/2003.12841.pdf
      """
      xyz_est = xyz @ T_est[:3, :3].T + T_est[:3, 3]
      xyz_gt = xyz @ T_gt[:3, :3].T + T_gt[:3, 3]
      centroid = xyz_est.mean(axis=0)
  
      dist1 = torch.sqrt(torch.sum((xyz_est - xyz_gt) ** 2, axis=-1))
      dist2 = torch.sqrt(torch.sum((xyz_est - centroid) ** 2, axis=-1))
  
      err = torch.mean(dist1 / (dist2 + tol))
      return err
  
imports: import torch
  import numpy
  from sklearn.neighbors import NearestNeighbors
label_desc: Use image node_id 4 for calling a global function with example usage: compute_scaled_registration_error(xyz, T_gt, T_est, tol) and returns: err