| 37 | } |
| 38 | |
| 39 | void QmitkHistogramVisualizationWidget::SetHistogram(itk::Statistics::Histogram<double>::ConstPointer histogram, const std::string& dataLabel) |
| 40 | { |
| 41 | if (histogram == nullptr) |
| 42 | return; |
| 43 | |
| 44 | bool histogramWasEmpty = m_Histograms.empty(); |
| 45 | |
| 46 | if (m_Histograms.find(dataLabel) == m_Histograms.end()) |
| 47 | { |
| 48 | m_Histograms.insert(std::make_pair(dataLabel, histogram)); |
| 49 | m_Controls->chartWidget->AddData2D(ConvertHistogramToPairList(histogram), dataLabel); |
| 50 | m_Controls->chartWidget->SetChartType(dataLabel, QmitkChartWidget::ChartType::bar); |
| 51 | } |
| 52 | else |
| 53 | { |
| 54 | m_Histograms[dataLabel] = histogram; |
| 55 | m_Controls->chartWidget->UpdateData2D(ConvertHistogramToPairList(histogram), dataLabel); |
| 56 | } |
| 57 | |
| 58 | if (m_Histograms.empty() != histogramWasEmpty) |
| 59 | { |
| 60 | m_Controls->chartWidget->Show(m_Controls->checkBoxShowSubchart->isChecked()); |
| 61 | SetGUIElementsEnabled(!m_Histograms.empty()); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | void QmitkHistogramVisualizationWidget::Reset() |
| 66 | { |
nothing calls this directly
no test coverage detected