code: def template_segmentation_image(
      source,
      map_som_size=[5, 5],
      radius=128.0,
      sync_order=0.998,
      show_dyn=False,
      show_som_map=False,
  ):
      data = read_image(source)
  
      network = syncsom(data, map_som_size[0], map_som_size[1], 1.0)
      (ticks, (dyn_time, dyn_phase)) = timedcall(
          network.process, show_dyn, sync_order
      )
      print(
          "Sample: ",
          source,
          "\t\tExecution time: ",
          ticks,
          "\t\tWinners: ",
          network.som_layer.get_winner_number(),
          "\n",
      )
  
      if show_dyn is True:
          draw_dynamics(dyn_time, dyn_phase)
  
      clusters = network.get_clusters()
      draw_image_mask_segments(source, clusters)
  
file_path: pyclustering/pyclustering/cluster/examples/syncsom_segmentation.py
imports: from pyclustering.utils import draw_image_mask_segments, read_image, draw_dynamics
  from pyclustering.utils import timedcall
  from pyclustering.samples.definitions import IMAGE_SIMPLE_SAMPLES
  from pyclustering.cluster.syncsom import syncsom
label_desc: Use image node_id 1 for calling a global function with example usage: template_segmentation_image(source, map_som_size, radius, sync_order, show_dyn, show_som_map) without return types