code: def build_show(self, scene):
      title = "Horizon " + horizon_version
      self.show_m = window.ShowManager(
          scene,
          title=title,
          size=(1920, 1080),
          reset_camera=False,
          order_transparent=self.order_transparent,
      )
  
      if len(self.tractograms) > 0:
          if self.cluster:
              self.__clusters_visualizer = ClustersVisualizer(
                  self.show_m, scene, self.tractograms
              )
  
          color_ind = 0
  
          for t, sft in enumerate(self.tractograms):
              streamlines = sft.streamlines
  
              if "tracts" in self.random_colors:
                  colors = next(self.color_gen)
              else:
                  colors = None
  
              if not self.world_coords:
                  # TODO: Get affine from a StatefullTractogram
                  raise ValueError(
                      "Currently native coordinates are not supported for "
                      "streamlines."
                  )
  
              if self.cluster:
                  self.__clusters_visualizer.add_cluster_actors(
                      t, streamlines, self.cluster_thr, colors
                  )
              else:
                  if self.buan:
                      colors = self.buan_colors[color_ind]
  
                  streamline_actor = actor.line(
                      streamlines, colors=colors
                  )
                  streamline_actor.GetProperty().SetEdgeVisibility(1)
                  streamline_actor.GetProperty().SetRenderLinesAsTubes(
                      1
                  )
                  streamline_actor.GetProperty().SetLineWidth(6)
                  streamline_actor.GetProperty().SetOpacity(1)
                  scene.add(streamline_actor)
  
              color_ind += 1
  
          if self.cluster:
              # Information panel
              # It will be changed once all the elements wrapped in horizon
              # elements.
              text_block = build_label(HELP_MESSAGE, 18)
              text_block.message = HELP_MESSAGE
  
              self.help_panel = ui.Panel2D(
                  size=(300, 200),
                  position=(1615, 875),
                  color=(0.8, 0.8, 1.0),
                  opacity=0.2,
                  align="left",
              )
  
              self.help_panel.add_element(
                  text_block, coords=(0.02, 0.01)
              )
              scene.add(self.help_panel)
              self.__tabs.append(
                  ClustersTab(
                      self.__clusters_visualizer, self.cluster_thr
                  )
              )
  
      synchronize_slices = False
      self.images = check_img_dtype(self.images)
      if len(self.images) > 0:
          if self.__roi_images:
              roi_color = self.__roi_colors
          roi_actors = []
          img_count = 0
          synchronize_slices = check_img_shapes(self.images)
          for img in self.images:
              data, affine = img
              self.vox2ras = affine
              img_val_range = np.unique(data).shape[0]
              if img_val_range == 2:
                  if self.__roi_images:
                      if "rois" in self.random_colors:
                          roi_color = next(self.color_gen)
                      roi_actor = actor.contour_from_roi(
                          data, affine=affine, color=roi_color
                      )
                      scene.add(roi_actor)
                      roi_actors.append(roi_actor)
                  else:
                      slices_viz = SlicesVisualizer(
                          self.show_m.iren,
                          scene,
                          data,
                          affine=affine,
                          world_coords=self.world_coords,
                          percentiles=[0, 100],
                          rgb=self.rgb,
                      )
                      self.__tabs.append(
                          SlicesTab(
                              slices_viz,
                              slice_id=img_count + 1,
                              force_render=self._show_force_render,
                          )
                      )
                      img_count += 1
              else:
                  slices_viz = SlicesVisualizer(
                      self.show_m.iren,
                      scene,
                      data,
                      affine=affine,
                      world_coords=self.world_coords,
                      rgb=self.rgb,
                  )
                  self.__tabs.append(
                      SlicesTab(
                          slices_viz,
                          slice_id=img_count + 1,
                          force_render=self._show_force_render,
                      )
                  )
                  img_count += 1
          if len(roi_actors) > 0:
              self.__tabs.append(ROIsTab(roi_actors))
  
      if len(self.pams) > 0:
          pam = self.pams[0]
          peak_actor = actor.peak(pam.peak_dirs, affine=pam.affine)
          scene.add(peak_actor)
          self.__tabs.append(PeaksTab(peak_actor))
  
      else:
          data = None
          affine = None
          pam = None
  
      self.__win_size = scene.GetSize()
  
      if len(self.__tabs) > 0:
          self.__tab_mgr = TabManager(
              self.__tabs, self.__win_size, synchronize_slices
          )
  
          def tab_changed(actors):
              for act in actors:
                  scene.rm(act)
                  scene.add(act)
  
          self.__tab_mgr.tab_changed = tab_changed
          scene.add(self.__tab_mgr.tab_ui)
  
      self.show_m.initialize()
  
      options = [
          r"un\hide centroids",
          "invert selection",
          r"un\select all",
          "expand clusters",
          "collapse clusters",
          "save streamlines",
          "recluster",
      ]
      listbox = ui.ListBox2D(
          values=options,
          position=(10, 300),
          size=(200, 270),
          multiselection=False,
          font_size=18,
      )
  
      def display_element():
          action = listbox.selected[0]
          if action == r"un\hide centroids":
              self.__hide()
          if action == "invert selection":
              self.__invert()
          if action == r"un\select all":
              self.__show_all()
          if action == "expand clusters":
              self.__expand()
          if action == "collapse clusters":
              self.__reset()
          if action == "save streamlines":
              self.__save()
          if action == "recluster":
              self.__new_window()
  
      listbox.on_change = display_element
      listbox.panel.opacity = 0.2
      listbox.set_visibility(0)
  
      self.show_m.scene.add(listbox)
  
      def left_click_centroid_callback(obj, event):
          self.cea[obj]["selected"] = not self.cea[obj]["selected"]
          self.cla[self.cea[obj]["cluster_actor"]][
              "selected"
          ] = self.cea[obj]["selected"]
          self.show_m.render()
  
      def right_click_centroid_callback(obj, event):
          for lactor in listbox._get_actors():
              lactor.SetVisibility(not lactor.GetVisibility())
  
          listbox.scroll_bar.set_visibility(False)
          self.show_m.render()
  
      def left_click_cluster_callback(obj, event):
          if self.cla[obj]["selected"]:
              self.cla[obj]["centroid_actor"].VisibilityOn()
              ca = self.cla[obj]["centroid_actor"]
              self.cea[ca]["selected"] = 0
              obj.VisibilityOff()
              self.cea[ca]["expanded"] = 0
  
          self.show_m.render()
  
      def right_click_cluster_callback(obj, event):
          print("Cluster Area Selected")
          self.show_m.render()
  
      for cl in self.cla:
          cl.AddObserver(
              "LeftButtonPressEvent", left_click_cluster_callback, 1.0
          )
          cl.AddObserver(
              "RightButtonPressEvent", right_click_cluster_callback, 1.0
          )
          self.cla[cl]["centroid_actor"].AddObserver(
              "LeftButtonPressEvent", left_click_centroid_callback, 1.0
          )
          self.cla[cl]["centroid_actor"].AddObserver(
              "RightButtonPressEvent",
              right_click_centroid_callback,
              1.0,
          )
  
      self.mem.window_timer_cnt = 0
  
      def timer_callback(obj, event):
          self.mem.window_timer_cnt += 1
          # TODO possibly add automatic rotation option
          # self.show_m.scene.azimuth(0.01 * self.mem.window_timer_cnt)
          # self.show_m.render()
  
      scene.reset_camera()
      scene.zoom(1.5)
      scene.reset_clipping_range()
  
      if self.interactive:
          self.show_m.add_window_callback(self.__win_callback)
          self.show_m.add_timer_callback(True, 200, timer_callback)
          self.show_m.iren.AddObserver(
              "KeyPressEvent", self.__key_press_events
          )
  
          if self.return_showm:
              return self.show_m
  
          if self.recorded_events is None:
              self.show_m.render()
              self.show_m.start()
  
          else:
              # set to True if event recorded file needs updating
              recording = False
              recording_filename = self.recorded_events
  
              if recording:
                  self.show_m.record_events_to_file(recording_filename)
              else:
                  self.show_m.play_events_from_file(recording_filename)
  
      else:
          window.record(
              scene,
              out_path=self.out_png,
              size=(1200, 900),
              reset_camera=False,
          )
  
imports: from packaging.version import Version
  import warnings
  import numpy
  from dipy import __version__
  from dipy.io.stateful_tractogram import Space, StatefulTractogram
  from dipy.io.streamline import save_tractogram
  from dipy.tracking.streamline import Streamlines
  from dipy.utils.optpkg import optional_package
  from dipy.viz.gmem import GlobalHorizon
  from dipy.viz.horizon.tab import ClustersTab, PeaksTab, ROIsTab, SlicesTab, TabManager, build_label
  from dipy.viz.horizon.visualizer import ClustersVisualizer, SlicesVisualizer
  from dipy.viz.horizon.util import check_img_dtype, check_img_shapes
label_desc: Use image node_id 13 for calling the Horizon obj's underlying member method code with example usage: obj.build_show(scene) and returns: self