MCPcopy Create free account
hub / github.com/MITK/MITK / SetHistogram

Method SetHistogram

Modules/ImageStatisticsUI/src/QmitkHistogramVisualizationWidget.cpp:39–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void 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
65void QmitkHistogramVisualizationWidget::Reset()
66{

Callers

nothing calls this directly

Calls 7

AddData2DMethod · 0.80
UpdateData2DMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
SetChartTypeMethod · 0.45
ShowMethod · 0.45

Tested by

no test coverage detected