code: def border_pixels(
              self,
              grad_sigma=0.5,
              grad_lower_thresh=0.1,
              grad_upper_thresh=1.0):
          
          # boundary pixels
          boundary_im = np.ones(self.shape)
          for i in range(1, self.num_segments):
              label_border_im = self.data.copy()
              label_border_im[self.data == 0] = i
              grad_mag = sf.gaussian_gradient_magnitude(
                  label_border_im.astype(np.float32), sigma=grad_sigma)
  
              nonborder_px = np.where(
                  (grad_mag < grad_lower_thresh) | (
                      grad_mag > grad_upper_thresh))
              boundary_im[nonborder_px[0], nonborder_px[1]] = 0
  
          # return boundary pixels
          border_px = np.where(boundary_im > 0)
          border_px = np.c_[border_px[0], border_px[1]]
          return border_px
docs: Returns the pixels on the boundary between all segments, excluding the zero segment.
  
          Parameters
          ----------
          grad_sigma : float
              standard deviation used for gaussian gradient filter
          grad_lower_thresh : float
              lower threshold on gradient threshold used to determine the boundary pixels
          grad_upper_thresh : float
              upper threshold on gradient threshold used to determine the boundary pixels
  
          Returns
          -------
          :obj:`numpy.ndarray`
               Nx2 array of pixels on the boundary