Skip to content

Commit

Permalink
Merge pull request #84 from aglowacki/master
Browse files Browse the repository at this point in the history
update roi stats
  • Loading branch information
aglowacki authored Jun 6, 2024
2 parents e1bb2ca + 5903a26 commit cd35210
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/mvc/RoiStatisticsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#include <QScreen>

//---------------------------------------------------------------------------
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)
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion src/mvc/ScatterPlotView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions src/mvc/ScatterPlotWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(&QSpinBox::valueChanged), this, &ScatterPlotWidget::updateMarkerSize);


Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cd35210

Please sign in to comment.