From d8c9973ae1c7544a9a74edc2554182df29cb61c6 Mon Sep 17 00:00:00 2001 From: Arthur Glowacki Date: Wed, 5 Jun 2024 14:07:31 -0500 Subject: [PATCH 1/2] Removed 1 col from stats --- src/mvc/RoiStatisticsWidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mvc/RoiStatisticsWidget.cpp b/src/mvc/RoiStatisticsWidget.cpp index cab6b69..d11c07f 100644 --- a/src/mvc/RoiStatisticsWidget.cpp +++ b/src/mvc/RoiStatisticsWidget.cpp @@ -10,12 +10,12 @@ #include //--------------------------------------------------------------------------- -enum HEADER_NAME { ROI_Name=0, MapName=1, SumCnts=2, MeanCts=3, MedianCts=4, StdDevCts=5, SumUgcm2=6, MeanUg=7, MedianUg=8, StdDevUg=9, Area=10, MinCnts=11, MinPixel=12, MaxCnts=13, MaxPixel=14, Min_ugcm2=15, Max_ugcm2=16, Num_Spectra=17, TotalConcentrationCts=18, TotalConcentrationUg=19, TotalContentCts=20, TotalContentUg=21 }; +enum HEADER_NAME { ROI_Name=0, MapName=1, SumCnts=2, MeanCts=3, MedianCts=4, StdDevCts=5, SumUgcm2=6, MeanUg=7, MedianUg=8, StdDevUg=9, Area=10, MinCnts=11, MinPixel=12, MaxCnts=13, MaxPixel=14, Min_ugcm2=15, Max_ugcm2=16, Num_Spectra=17, TotalConcentrationCts=18, TotalConcentrationUg=19, TotalContentUg=20 }; //--------------------------------------------------------------------------- RoiStatisticsWidget::RoiStatisticsWidget() : QWidget() { - _base_header = { "ROI Name", "Map Name", "Sum Cnt/s", "Mean Cts/s", "Median Cts/s", "Std Dev Cts/s", "Sum ug/cm2", "Mean ug/cm2", "Median ug/cm2", "Std Dev ug/cm2", "Area", "Min Cnts/s", "Mix Pixel(x|y)", "Max Cnts/s", "Max Pixel (x|y)", "Min ug/cm2", "Max ug/cm2", "Num Spectra", "Total Concentration Cts/s (mean x # of pixels)", "Total Concentration ug/cm2", "Total Content Cts/s(mean x scan area with unit of femtogram 10^-15)", "Total Content ug/cm2" }; + _base_header = { "ROI Name", "Map Name", "Sum Cnt/s", "Mean Cts/s", "Median Cts/s", "Std Dev Cts/s", "Sum ug/cm2", "Mean ug/cm2", "Median ug/cm2", "Std Dev ug/cm2", "Area", "Min Cnts/s", "Mix Pixel(x|y)", "Max Cnts/s", "Max Pixel (x|y)", "Min ug/cm2", "Max ug/cm2", "Num Spectra", "Total Concentration Cts/s (mean x # of pixels)", "Total Concentration ug/cm2", "Total Content ug/cm2 (mean x scan area with unit of femtogram 10^-15)" }; //create save ordered vector by element Z number with K , L, M lines for (std::string el_name : data_struct::Element_Symbols) @@ -185,7 +185,6 @@ void RoiStatisticsWidget::_insert_item(QString roiName, _table_widget->setItem(i, Num_Spectra, new QTableWidgetItem(QString::number(roi_pixels.size()))); _table_widget->setItem(i, Area, new QTableWidgetItem(QString::number(area))); - _table_widget->setItem(i, TotalContentCts, new QTableWidgetItem(QString::number(area*mean_cts))); _table_widget->setItem(i, TotalConcentrationCts, new QTableWidgetItem(QString::number(mean_cts * (double)roi_pixels.size()))); if(hasNorm) From 5903a26c8aa41c8441dfdf4bec34b7313e239954 Mon Sep 17 00:00:00 2001 From: aglowacki Date: Thu, 6 Jun 2024 14:50:06 -0500 Subject: [PATCH 2/2] fix bug in scatter plot not allowing larger than 1 marker size --- src/mvc/ScatterPlotView.cpp | 7 ++++++- src/mvc/ScatterPlotWidget.cpp | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/mvc/ScatterPlotView.cpp b/src/mvc/ScatterPlotView.cpp index bf51f3a..71f5ddf 100644 --- a/src/mvc/ScatterPlotView.cpp +++ b/src/mvc/ScatterPlotView.cpp @@ -69,7 +69,12 @@ ScatterPlotView::ScatterPlotView(bool display_log10, bool black_background, QWid setBlackBackground(Preferences::inst()->getValue(STR_PFR_SCATTER_DARK_BACKGROUND).toBool()); _scatter_series->setBorderColor(Qt::transparent); - _scatter_series->setMarkerSize(1.0); + int val = Preferences::inst()->getValue(STR_PRF_ScatterPlot_Size).toInt(); + if (val < 1) + { + val = 1; + } + _scatter_series->setMarkerSize(val); //_scatter_series->setUseOpenGL(true); // causes exception when deconstructor called. _chart->addSeries(_scatter_series); _display_log10 = display_log10; diff --git a/src/mvc/ScatterPlotWidget.cpp b/src/mvc/ScatterPlotWidget.cpp index 6aa661d..a63a163 100644 --- a/src/mvc/ScatterPlotWidget.cpp +++ b/src/mvc/ScatterPlotWidget.cpp @@ -85,7 +85,12 @@ void ScatterPlotWidget::_createLayout() _sp_maker_size->setPrefix("Marker Size:"); _sp_maker_size->setRange(1, 100); _sp_maker_size->setSingleStep(1.0); - _sp_maker_size->setValue(1); + int val = Preferences::inst()->getValue(STR_PRF_ScatterPlot_Size).toInt(); + if (val < 1) + { + val = 1; + } + _sp_maker_size->setValue(val); connect(_sp_maker_size, qOverload(&QSpinBox::valueChanged), this, &ScatterPlotWidget::updateMarkerSize); @@ -196,7 +201,7 @@ void ScatterPlotWidget::setBlackBackground(int val) void ScatterPlotWidget::updateMarkerSize(int val) { - val = std::min(val, 1); + val = std::max(val, 1); for (auto& itr : _plot_view_list) { itr->updateMarkerSize(val);