예제 #1
0
  void SpectrumWidget::showMetaDistribution(const String& name)
  {
    Histogram<> dist = createMetaDistribution_(name);
    HistogramDialog dw(dist);
    dw.setLegend(name);

    if (dw.exec() == QDialog::Accepted)
    {
      DataFilters filters;

      if (dw.getLeftSplitter() > dist.minBound())
      {
        DataFilters::DataFilter filter;
        filter.value = dw.getLeftSplitter();
        filter.field = DataFilters::META_DATA;
        filter.meta_name = name;
        filter.op = DataFilters::GREATER_EQUAL;
        filter.value_is_numerical = true;
        filters.add(filter);
      }

      if (dw.getRightSplitter() < dist.maxBound())
      {
        DataFilters::DataFilter filter;
        filter.value = dw.getRightSplitter();
        filter.field = DataFilters::META_DATA;
        filter.meta_name = name;
        filter.op = DataFilters::LESS_EQUAL;
        filter.value_is_numerical = true;
        filters.add(filter);
      }

      canvas_->setFilters(filters);
    }
  }
예제 #2
0
  void SpectrumWidget::showIntensityDistribution()
  {
    Histogram<> dist = createIntensityDistribution_();
    HistogramDialog dw(dist);
    dw.setLegend("intensity");
    dw.setLogMode(true);
    if (dw.exec() == QDialog::Accepted)
    {
      DataFilters filters;

      if (dw.getLeftSplitter() > dist.minBound())
      {
        DataFilters::DataFilter filter;
        filter.value = dw.getLeftSplitter();
        filter.field = DataFilters::INTENSITY;
        filter.op = DataFilters::GREATER_EQUAL;
        filters.add(filter);
      }

      if (dw.getRightSplitter() < dist.maxBound())
      {
        DataFilters::DataFilter filter;
        filter.value = dw.getRightSplitter();
        filter.field = DataFilters::INTENSITY;
        filter.op = DataFilters::LESS_EQUAL;
        filters.add(filter);
      }

      canvas_->setFilters(filters);
    }
  }
예제 #3
0
START_SECTION((BinSizeType maxBound() const))
	TEST_REAL_SIMILAR(d.maxBound(), 10.0)
END_SECTION

START_SECTION((BinSizeType binSize() const))
	TEST_REAL_SIMILAR(d.binSize(), 1)
END_SECTION

START_SECTION((Size size() const ))
	TEST_EQUAL(d.size(), 10)
END_SECTION

START_SECTION((Histogram(BinSizeType min, BinSizeType max, BinSizeType bin_size)))
	Histogram<float, float> d3(5.5f, 7.7f, 0.2f);
	TEST_REAL_SIMILAR(d3.minBound(), 5.5)
	TEST_REAL_SIMILAR(d3.maxBound(), 7.7)
	TEST_REAL_SIMILAR(d3.binSize(), 0.2)
END_SECTION

START_SECTION((ValueType minValue() const))
	TEST_REAL_SIMILAR(d.minValue(), 0.0)
END_SECTION

START_SECTION((ValueType maxValue() const))
	TEST_REAL_SIMILAR(d.maxValue(), 0.0)
END_SECTION

START_SECTION((ValueType operator [] (Size index) const))
	d.reset(4, 14, 2);
	TEST_EQUAL(d.size(),5);
	TEST_REAL_SIMILAR(d[0],0.0);