code: def fill_object_holes(labels, diameter, planewise=False):
      array = labels.copy()
      # Calculate radius from diameter
      radius = diameter / 2.0
  
      # Check if grayscale, RGB or operation is being performed planewise
      if labels.ndim == 2 or labels.shape[-1] in (3, 4) or planewise:
          # 2D circle area will be calculated
          factor = radius**2
      else:
          # Calculate the volume of a sphere
          factor = (4.0 / 3.0) * (radius**3)
  
      min_obj_size = numpy.pi * factor
  
      if (
          planewise
          and labels.ndim != 2
          and labels.shape[-1] not in (3, 4)
      ):
          for plane in array:
              for obj in numpy.unique(plane):
                  if obj == 0:
                      continue
                  filled_mask = skimage.morphology.remove_small_holes(
                      plane == obj, min_obj_size
                  )
                  plane[filled_mask] = obj
          return array
      else:
          for obj in numpy.unique(array):
              if obj == 0:
                  continue
              filled_mask = skimage.morphology.remove_small_holes(
                  array == obj, min_obj_size
              )
              array[filled_mask] = obj
      return array
  
imports: from typing import Literal
  import centrosome.cpmorphology
  import numpy
  import scipy.ndimage
  import skimage.morphology
  import mahotas
label_desc: Use image node_id 14 for calling a global function with example usage: fill_object_holes(labels, diameter, planewise) and returns: array, array