class_docstr: Converts SciPy-style contours (generated by skimage.measure.find_contours) to a more succinct version which only includes
  the pixels to which lines need to be drawn (i.e. not the intervening pixels along each line).
  
  Args:
      height: height of bounding box, used to detect direction of line segment.
      width: width of bounding box, used to detect direction of line segment.
  
  Returns:
      the pixels that need to be joined by straight lines to describe the outmost pixels of the foreground similar to
          OpenCV's cv.CHAIN_APPROX_SIMPLE (counterclockwise)
class_docstr_tok: ["Converts","SciPy-style","contours","(","generated","by","skimage.measure.find_contours",")","to","a","more","succinct","version","which","only","includes","the","pixels","to","which","lines","need","to","be","drawn","(","i.e",".","not","the","intervening","pixels","along","each","line",")",".","Args",":","height",":","height","of","bounding","box",",","used","to","detect","direction","of","line","segment",".","width",":","width","of","bounding","box",",","used","to","detect","direction","of","line","segment",".","Returns",":","the","pixels","that","need","to","be","joined","by","straight","lines","to","describe","the","outmost","pixels","of","the","foreground","similar","to","OpenCV","'s","cv.CHAIN_APPROX_SIMPLE","(","counterclockwise",")"]
docstr: Each sequence of coordinates describes a boundary between foreground and background starting and ending at two sides
  of the bounding box. To order the sequences correctly, we compute the distance from the top-left of the bounding box
  around the perimeter in a clockwise direction.
  
  Args:
      sequence: list of border points coordinates.
  
  Returns:
      the distance round the perimeter of the bounding box from the top-left origin
docstr_tok: ["Each","sequence","of","coordinates","describes","a","boundary","between","foreground","and","background","starting","and","ending","at","two","sides","of","the","bounding","box",".","To","order","the","sequences","correctly",",","we","compute","the","distance","from","the","top-left","of","the","bounding","box","around","the","perimeter","in","a","clockwise","direction",".","Args",":","sequence",":","list","of","border","points","coordinates",".","Returns",":","the","distance","round","the","perimeter","of","the","bounding","box","from","the","top-left","origin"]
code: def _calculate_distance_from_top_left(
      self, sequence: Sequence[tuple[int, int]]
  ) -> int:
      """
      Each sequence of coordinates describes a boundary between foreground and background starting and ending at two sides
      of the bounding box. To order the sequences correctly, we compute the distance from the top-left of the bounding box
      around the perimeter in a clockwise direction.
  
      Args:
          sequence: list of border points coordinates.
  
      Returns:
          the distance round the perimeter of the bounding box from the top-left origin
      """
      distance: int
      first_coord = sequence[0]
      if first_coord[0] == 0:
          distance = first_coord[1]
      elif first_coord[1] == self.width - 1:
          distance = self.width + first_coord[0]
      elif first_coord[0] == self.height - 1:
          distance = 2 * self.width + self.height - first_coord[1]
      else:
          distance = 2 * (self.width + self.height) - first_coord[0]
  
      return distance
  
imports: from __future__ import annotations
  import warnings
  from typing import Callable, Sequence
  import numpy
  import torch
  from monai.config.type_definitions import DtypeLike, NdarrayOrTensor
  from monai.transforms import Activations, AsDiscrete, BoundingRect, FillHoles, GaussianSmooth, RemoveSmallObjects, SobelGradients
  from monai.transforms.transform import Transform
  from monai.transforms.utils_pytorch_numpy_unification import max, maximum, min, sum, unique
  from monai.utils import TransformBackends, convert_to_numpy, optional_import
  from monai.utils.misc import ensure_tuple_rep
  from monai.utils.type_conversion import convert_to_dst_type, convert_to_tensor
label_desc: Use image node_id 3 for calling the GenerateSuccinctContour obj's underlying member method code with example usage: obj._calculate_distance_from_top_left(sequence) and returns: distance