parameters: (self, y_pred_edges, y_edges)
return_statement: return surface_distance
docstring: Calculate the surface distances from `y_pred_edges` to `y_edges`.
  
           Args:
              y_pred_edges (np.ndarray): the edge of the predictions.
              y_edges (np.ndarray): the edge of the ground truth.
docstring_summary: Calculate the surface distances from `y_pred_edges` to `y_edges`.
docstring_tokens: Calculate the surface distances from y_pred_edges to y_edges .
function: def _get_surface_distance(self, y_pred_edges, y_edges):
          """
          Calculate the surface distances from `y_pred_edges` to `y_edges`.
  
           Args:
              y_pred_edges (np.ndarray): the edge of the predictions.
              y_edges (np.ndarray): the edge of the ground truth.
          """
  
          if not np.any(y_pred_edges):
              return np.array([])
  
          if not np.any(y_edges):
              dis = np.full(y_edges.shape, np.inf)
          else:
              if self.distance_metric == "euclidean":
                  dis = morphology.distance_transform_edt(~y_edges)
              elif self.distance_metric in self.distance_metric_list[-2:]:
                  dis = morphology.distance_transform_cdt(~y_edges, metric=self.distance_metric)
  
          surface_distance = dis[y_pred_edges]
  
          return surface_distance
function_tokens: def _get_surface_distance ( self , y_pred_edges , y_edges ) : if not np . any ( y_pred_edges ) : return np . array ( [ ] ) if not np . any ( y_edges ) : dis = np . full ( y_edges . shape , np . inf ) else : if self . distance_metric == "euclidean" : dis = morphology . distance_transform_edt ( ~ y_edges ) elif self . distance_metric in self . distance_metric_list [ - 2 : ] : dis = morphology . distance_transform_cdt ( ~ y_edges , metric = self . distance_metric ) surface_distance = dis [ y_pred_edges ] return surface_distance