예제 #1
0
  // TODO TIDY THIS UP do we need "reset cursor positions"
  private void zoomToLUT() {
    final double minMaxLUT[] = _histogramDataGroup.getMinMaxLUT();
    final double minLUT = minMaxLUT[0];
    final double maxLUT = minMaxLUT[1];

    // zoom to fit current min/max LUT settings
    final double minView = minLUT;
    final double maxView = maxLUT;

    changed(minView, maxView, minLUT, maxLUT);

    // reset cursor positions
    _histogramPanel.resetCursors();
  }
예제 #2
0
  /**
   * This method should be called whenever a new set of histogram values is to be displayed (i.e.
   * when a different image gets focus).
   *
   * @param histogramData
   */
  public void setHistogramData(final HistogramDataGroup histogramData) {
    double[] minMaxView;
    double[] minMaxLUT;
    synchronized (_synchObject) {
      _histogramDataGroup = histogramData;
      _histogramDataGroup.setListener(new HistogramDataListener());
      minMaxView = _histogramDataGroup.getMinMaxView();
      minMaxLUT = _histogramDataGroup.getMinMaxLUT();
    }

    //		IJ.log("----");
    //		IJ.log("setHistogramData");
    //		IJ.log("view " + minMaxView[0] + " "  + minMaxView[1] + " lut " + minMaxLUT[0] + " " +
    // minMaxLUT[1]);
    //		IJ.log("----");

    if (null != _frame) {
      if (_frame.isVisible()) {
        _frame.setVisible(true);
      }
      _frame.setTitle(histogramData.getTitle());

      _histogramPanel.setStatistics(histogramData.getStatistics(WIDTH));

      final boolean autoRange = histogramData.getAutoRange();
      if (autoRange) {
        // turn cursors off
        _histogramPanel.setCursors(null, null);
      } else {
        // set cursors to edges
        _histogramPanel.setCursors(INSET, INSET + WIDTH - 1);
      }
      _uiPanel.setAutoRange(autoRange);
      _uiPanel.setExcludePixels(histogramData.getExcludePixels());
      _uiPanel.setCombineChannels(histogramData.getCombineChannels());
      _uiPanel.setDisplayChannels(histogramData.getDisplayChannels());
      _uiPanel.enableChannels(histogramData.hasChannels());
      _uiPanel.setMinMaxLUT(minMaxLUT[0], minMaxLUT[1]);

      _colorBarPanel.setMinMax(minMaxView[0], minMaxView[1], minMaxLUT[0], minMaxLUT[1]);
    }
  }