code: def __init__(self, peak_actor):
      self.__actor = peak_actor
      self.__name = "Peaks"
  
      self.__tab_id = 0
      self.__tab_ui = None
  
      self.__toggler_label_view_mode = build_label(text="View Mode")
  
      """
          self.__interaction_mode_label.actor.AddObserver(
              'LeftButtonPressEvent', self.__change_interaction_mode_callback,
              1.)
          """
  
      self.__view_modes = {"Cross section": 0, "Range": 1}
      self.__view_mode_toggler = ui.RadioButton(
          list(self.__view_modes),
          ["Cross section"],
          padding=1.5,
          font_size=16,
          font_family="Arial",
      )
  
      self.__view_mode_toggler.on_change = self.__toggle_view_mode
  
      self.__slider_label_x = build_label(text="X Slice")
      self.__slider_label_y = build_label(text="Y Slice")
      self.__slider_label_z = build_label(text="Z Slice")
  
      # Initializing sliders
      min_centers = self.__actor.min_centers
      max_centers = self.__actor.max_centers
  
      length = 450
      lw = 3
      radius = 8
      fs = 16
      tt = "{value:.0f}"
  
      # Initializing cross section sliders
      cross_section = self.__actor.cross_section
  
      self.__slider_slice_x = ui.LineSlider2D(
          initial_value=cross_section[0],
          min_value=min_centers[0],
          max_value=max_centers[0],
          length=length,
          line_width=lw,
          outer_radius=radius,
          font_size=fs,
          text_template=tt,
      )
  
      self.__slider_slice_y = ui.LineSlider2D(
          initial_value=cross_section[1],
          min_value=min_centers[1],
          max_value=max_centers[1],
          length=length,
          line_width=lw,
          outer_radius=radius,
          font_size=fs,
          text_template=tt,
      )
  
      self.__slider_slice_z = ui.LineSlider2D(
          initial_value=cross_section[2],
          min_value=min_centers[2],
          max_value=max_centers[2],
          length=length,
          line_width=lw,
          outer_radius=radius,
          font_size=fs,
          text_template=tt,
      )
  
      color_single_slider(self.__slider_slice_x)
      color_single_slider(self.__slider_slice_y)
      color_single_slider(self.__slider_slice_z)
  
      self.__slider_slice_x.on_change = self.__change_slice_x
      self.__slider_slice_y.on_change = self.__change_slice_y
      self.__slider_slice_z.on_change = self.__change_slice_z
  
      # Initializing cross section sliders
      low_ranges = self.__actor.low_ranges
      high_ranges = self.__actor.high_ranges
  
      self.__slider_range_x = ui.LineDoubleSlider2D(
          line_width=lw,
          outer_radius=radius,
          length=length,
          initial_values=(low_ranges[0], high_ranges[0]),
          min_value=min_centers[0],
          max_value=max_centers[0],
          font_size=fs,
          text_template=tt,
      )
  
      self.__slider_range_y = ui.LineDoubleSlider2D(
          line_width=lw,
          outer_radius=radius,
          length=length,
          initial_values=(low_ranges[1], high_ranges[1]),
          min_value=min_centers[1],
          max_value=max_centers[1],
          font_size=fs,
          text_template=tt,
      )
  
      self.__slider_range_z = ui.LineDoubleSlider2D(
          line_width=lw,
          outer_radius=radius,
          length=length,
          initial_values=(low_ranges[2], high_ranges[2]),
          min_value=min_centers[2],
          max_value=max_centers[2],
          font_size=fs,
          text_template=tt,
      )
  
      color_double_slider(self.__slider_range_x)
      color_double_slider(self.__slider_range_y)
      color_double_slider(self.__slider_range_z)
  
      self.__slider_range_x.on_change = self.__change_range_x
      self.__slider_range_y.on_change = self.__change_range_y
      self.__slider_range_z.on_change = self.__change_range_z
  
imports: import numpy
  from dipy.utils.optpkg import optional_package
  from dipy.viz.horizon.tab import HorizonTab, build_label, color_double_slider, color_single_slider
label_desc: Use image node_id 1 to create a new PeaksTab object from inherited base classes: HorizonTab with example: obj = PeaksTab(peak_actor)