code: def add_dividing_lines(labels):
      """
      Remove pixels from an object that are adjacent to
      another object’s pixels unless doing so would change the object’s
      Euler number
      """
  
      adjacent_mask = centrosome.cpmorphology.adjacent(labels)
  
      thinnable_mask = (
          centrosome.cpmorphology.binary_shrink(labels, 1) != 0
      )
  
      out_labels = labels.copy()
  
      out_labels[adjacent_mask & ~thinnable_mask] = 0
  
      return out_labels
  
imports: from typing import Literal
  import centrosome.cpmorphology
  import numpy
  import scipy.ndimage
  import skimage.morphology
  import mahotas
label_desc: Use image node_id 3 for calling a global function with example usage: add_dividing_lines(labels) and returns: out_labels