class_docstr: A base class containing for the 2D browser.
  
  This class contains all backend-independent attributes and methods.
class_docstr_tok: ["A","base","class","containing","for","the","2D","browser",".","This","class","contains","all","backend-independent","attributes","and","methods","."]
code: def __init__(self, **kwargs):
      from ..epochs import BaseEpochs
      from ..io import BaseRaw
      from ..preprocessing import ICA
  
      self.backend_name = None
  
      self._data = None
      self._times = None
  
      self.mne = BrowserParams(**kwargs)
  
      inst = kwargs.get("inst", None)
      ica = kwargs.get("ica", None)
  
      # what kind of data are we dealing with?
      if isinstance(ica, ICA):
          self.mne.instance_type = "ica"
      elif isinstance(inst, BaseRaw):
          self.mne.instance_type = "raw"
      elif isinstance(inst, BaseEpochs):
          self.mne.instance_type = "epochs"
      else:
          raise TypeError(
              "Expected an instance of Raw, Epochs, or ICA, "
              f"got {type(inst)}."
          )
  
      logger.debug(f"Opening {self.mne.instance_type} browser...")
  
      self.mne.ica_type = None
      if self.mne.instance_type == "ica":
          if isinstance(self.mne.ica_inst, BaseRaw):
              self.mne.ica_type = "raw"
          elif isinstance(self.mne.ica_inst, BaseEpochs):
              self.mne.ica_type = "epochs"
      self.mne.is_epochs = "epochs" in (
          self.mne.instance_type,
          self.mne.ica_type,
      )
  
      # things that always start the same
      self.mne.ch_start = 0
      self.mne.projector = None
      if hasattr(self.mne, "projs"):
          self.mne.projs_active = np.array(
              [p["active"] for p in self.mne.projs]
          )
      self.mne.whitened_ch_names = list()
      if hasattr(self.mne, "noise_cov"):
          self.mne.use_noise_cov = self.mne.noise_cov is not None
      # allow up to 10000 zorder levels for annotations
      self.mne.zorder = dict(
          patch=0,
          grid=1,
          ann=2,
          events=10003,
          bads=10004,
          data=10005,
          mag=10006,
          grad=10007,
          scalebar=10008,
          vline=10009,
      )
      # additional params for epochs (won't affect raw / ICA)
      self.mne.epoch_traces = list()
      self.mne.bad_epochs = list()
      if inst is not None:
          self.mne.sampling_period = (
              np.diff(inst.times[:2])[0] / inst.info["sfreq"]
          )
      # annotations
      self.mne.annotations = list()
      self.mne.hscroll_annotations = list()
      self.mne.annotation_segments = list()
      self.mne.annotation_texts = list()
      self.mne.new_annotation_labels = list()
      self.mne.annotation_segment_colors = dict()
      self.mne.annotation_hover_line = None
      self.mne.draggable_annotations = False
      # lines
      self.mne.event_lines = list()
      self.mne.event_texts = list()
      self.mne.vline_visible = False
      # decim
      self.mne.decim_times = None
      self.mne.decim_data = None
      # scalings
      if hasattr(self.mne, "butterfly"):
          self.mne.scale_factor = 0.5 if self.mne.butterfly else 1.0
      self.mne.scalebars = dict()
      self.mne.scalebar_texts = dict()
      # ancillary child figures
      self.mne.child_figs = list()
      self.mne.fig_help = None
      self.mne.fig_proj = None
      self.mne.fig_histogram = None
      self.mne.fig_selection = None
      self.mne.fig_annotation = None
      # extra attributes for epochs
      if self.mne.is_epochs:
          # add epoch boundaries & center epoch numbers between boundaries
          self.mne.midpoints = (
              np.convolve(
                  self.mne.boundary_times, np.ones(2), mode="valid"
              )
              / 2
          )
  
      # initialize picks and projectors
      self._update_picks()
      if not self.mne.instance_type == "ica":
          self._update_projector()
  
imports: import importlib
  from abc import ABC, abstractmethod
  from collections import OrderedDict
  from contextlib import contextmanager
  from copy import deepcopy
  from itertools import cycle
  import numpy
  from .._fiff.pick import _DATA_CH_TYPES_SPLIT
  from ..defaults import _handle_default
  from ..filter import _iir_filter, _overlap_add_filter
  from ..fixes import _compare_version
  from ..utils import _check_option, _get_stim_channel, _validate_type, get_config, logger, set_config, verbose
  from .backends._utils import VALID_BROWSE_BACKENDS
  from .utils import _get_color_list, _setup_plot_projector, _show_browser
label_desc: Use image node_id 1 to create a new BrowserBase object from inherited base classes: ABC with example: obj = BrowserBase()