code: def template_segmentation_image(
      source, color_radius, object_radius, noise_size, show_dyn
  ):
      algorithm = syncsegm(
          color_radius, object_radius, noise_size, False
      )
      analyser = algorithm.process(source, show_dyn)
  
      color_segments = analyser.allocate_colors(0.01, noise_size)
      draw_image_mask_segments(source, color_segments)
  
      if object_radius is not None:
          object_segments = analyser.allocate_objects(0.01, noise_size)
          draw_image_mask_segments(source, object_segments)
  
      if show_dyn is True:
          syncsegm_visualizer.show_first_layer_dynamic(analyser)
          syncsegm_visualizer.show_second_layer_dynamic(analyser)
  
imports: from pyclustering.samples.definitions import IMAGE_SIMPLE_SAMPLES, IMAGE_MAP_SAMPLES
  from pyclustering.nnet.syncsegm import syncsegm, syncsegm_visualizer
  from pyclustering.utils import draw_image_mask_segments
label_desc: Use image node_id 1 for calling a global function with example usage: template_segmentation_image(source, color_radius, object_radius, noise_size, show_dyn) without return types