class_docstr: Returns a slice from a 1-D array. Connect the 'widget' output to a plot to display a region-selection widget.
class_docstr_tok: ["Returns","a","slice","from","a","1-D","array",".","Connect","the","'widget","'","output","to","a","plot","to","display","a","region-selection","widget","."]
code: def process(self, data=None, display=True):
      # print "process.."
      s = self.stateGroup.state()
      region = [s["start"], s["stop"]]
  
      if display:
          conn = self["widget"].connections()
          for c in conn:
              plot = c.node().getPlot()
              if plot is None:
                  continue
              if c in self.items:
                  item = self.items[c]
                  item.setRegion(region)
                  # print "  set rgn:", c, region
                  # item.setXVals(events)
              else:
                  item = LinearRegionItem(values=region)
                  self.items[c] = item
                  # item.connect(item, QtCore.SIGNAL('regionChanged'), self.rgnChanged)
                  item.sigRegionChanged.connect(self.rgnChanged)
                  item.setVisible(s["display"])
                  item.setMovable(s["movable"])
                  # print "  new rgn:", c, region
                  # self.items[c].setYRange([0., 0.2], relative=True)
  
      if self["selected"].isConnected():
          if data is None:
              sliced = None
          elif hasattr(data, "implements") and data.implements(
              "MetaArray"
          ):
              sliced = data[0 : s["start"] : s["stop"]]
          else:
              mask = (data["time"] >= s["start"]) * (
                  data["time"] < s["stop"]
              )
              sliced = data[mask]
      else:
          sliced = None
      return {
          "selected": sliced,
          "widget": self.items,
          "region": region,
      }
  
imports: import numpy
  from ...graphicsItems.LinearRegionItem import LinearRegionItem
  from ...Qt import QtCore, QtWidgets
  from ...widgets.TreeWidget import TreeWidget
  from ..Node import Node
  from .None import functions
  from .common import CtrlNode
label_desc: Use image node_id 4 for calling the RegionSelectNode obj's underlying member method code with example usage: obj.process(data, display) and returns: dict