v1.0.0-rc.34

This commit is contained in:
2025-04-14 11:52:06 +02:00
parent 708b5fbc4b
commit b0607ab3ca
238 changed files with 4590 additions and 1329 deletions
+24 -27
View File
@@ -11,17 +11,23 @@
#include "JFJochViewerSidePanel.h"
#include "widgets/TitleLabel.h"
#include "JFJochViewerImageStatistics.h"
JFJochViewerSidePanel::JFJochViewerSidePanel(JFJochReader &in_reader, QWidget *parent)
: reader(in_reader), QWidget(parent) {
setFixedWidth(250);
setMinimumWidth(250);
setMaximumWidth(500);
auto layout = new QVBoxLayout(this);
layout->addWidget(new TitleLabel("Image statistics", this));
image_stats = new QLabel();
SetImageStats({});
layout->addWidget(image_stats);
auto stats = new JFJochViewerImageStatistics(reader, this);
layout->addWidget(stats);
connect(this, &JFJochViewerSidePanel::imageLoaded,
stats, &JFJochViewerImageStatistics::loadImage);
connect(this, &JFJochViewerSidePanel::imageCleared,
stats, &JFJochViewerImageStatistics::noImage);
layout->addWidget(new TitleLabel("Image features", this));
@@ -84,7 +90,6 @@ JFJochViewerSidePanel::JFJochViewerSidePanel(JFJochReader &in_reader, QWidget *p
}
});
connect(autoResRingsCheckBox, &QCheckBox::toggled, this, &JFJochViewerSidePanel::enableAutoResRings);
connect(res_rings_edit, &QLineEdit::editingFinished,
@@ -93,6 +98,10 @@ JFJochViewerSidePanel::JFJochViewerSidePanel(JFJochReader &in_reader, QWidget *p
connect(resRingsCheckBox, &QCheckBox::toggled,
this, &JFJochViewerSidePanel::enableResRings);
layout->addWidget(new TitleLabel("Azim. integration", this));
azint_plot = new JFJochSimpleChartView(this);
layout->addWidget(azint_plot);
layout->addStretch();
setLayout(layout); // Set the layout to the widget
}
@@ -106,26 +115,6 @@ void JFJochViewerSidePanel::enableAutoResRings(bool input) {
}
}
void JFJochViewerSidePanel::SetImageStats(const std::shared_ptr<JFJochReaderImage> &image) {
QString text;
if (image != nullptr) {
text = "Detector: <b>%1</b><br/>"
"Error pixels: <b>%2</b><br/>"
"Saturated pixels: <b>%3</b><br/>"
"Spots: <b>%4</b><br/>"
"Valid values: <b>%5</b> - <b>%6</b>";
text = text.arg(QString::fromStdString(image->dataset->detector_name))
.arg(image->error_pixel.size())
.arg(image->saturated_pixel.size())
.arg(image->spots.size())
.arg(image->valid_pixel.begin()->first)
.arg(image->valid_pixel.rbegin()->first);
} else
text="No file loaded<br/><br/><br/><br/>";
image_stats->setText(text);
}
void JFJochViewerSidePanel::spotsToggled(bool input) {
emit showSpots(input);
}
@@ -157,7 +146,15 @@ void JFJochViewerSidePanel::editingFinished() {
void JFJochViewerSidePanel::loadImage() {
auto image = reader.CopyImage();
SetImageStats(image);
if (image && image->dataset)
azint_plot->UpdateData(image->dataset->az_int_bin_to_q, image->az_int);
emit imageLoaded();
}
void JFJochViewerSidePanel::noImage() {
azint_plot->ClearData();
emit imageCleared();
}
void JFJochViewerSidePanel::enableResRings(bool input) {