jfjoch_viewer: Add azimuthal integration 2D viewer
This commit is contained in:
@@ -9,7 +9,6 @@ JFJochViewerSidePanelChart::JFJochViewerSidePanelChart(QWidget *parent) : QWidge
|
||||
|
||||
combo_box = new QComboBox(this);
|
||||
combo_box->addItem("Azimuthal integration (1D)", 0);
|
||||
combo_box->addItem("Azimuthal integration (2D)", 3);
|
||||
combo_box->addItem("Wilson plot", 1);
|
||||
combo_box->addItem("I/sigma", 2);
|
||||
combo_box->addItem("Spots (count)", 5);
|
||||
@@ -22,22 +21,16 @@ JFJochViewerSidePanelChart::JFJochViewerSidePanelChart(QWidget *parent) : QWidge
|
||||
this, &JFJochViewerSidePanelChart::comboBoxSelected);
|
||||
|
||||
azint_plot = new JFJochSimpleChartView(this);
|
||||
azint_image = new JFJochAzIntImage(this);
|
||||
one_over_d_sq_plot = new JFJochOneOverResSqChartView(this);
|
||||
|
||||
stack = new QStackedWidget(this);
|
||||
stack->addWidget(azint_plot); // index 0
|
||||
stack->addWidget(azint_image); // index 1
|
||||
stack->addWidget(one_over_d_sq_plot); // index 2
|
||||
|
||||
layout->addWidget(stack);
|
||||
|
||||
setLayout(layout);
|
||||
|
||||
connect(azint_image, &JFJochAzIntImage::writeStatusBar,
|
||||
[&](QString string, int timeout_ms) {
|
||||
emit writeStatusBar(string, timeout_ms);
|
||||
});
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanelChart::comboBoxSelected(int val) {
|
||||
@@ -86,20 +79,6 @@ void JFJochViewerSidePanelChart::redrawPlot() {
|
||||
one_over_d_sq_plot->UpdateData(x, y, "d [Å]", "Count");
|
||||
stack->setCurrentWidget(one_over_d_sq_plot);
|
||||
break;
|
||||
case 3: {
|
||||
// Render 2D azimuthal integration as an image
|
||||
const auto &profile = image->ImageData().az_int_profile;
|
||||
const auto &ds = image->Dataset();
|
||||
int az_bins = ds.azimuthal_bins;
|
||||
int q_bins = ds.q_bins;
|
||||
if (az_bins > 0 && q_bins > 0 && profile.size() == static_cast<size_t>(az_bins * q_bins)) {
|
||||
azint_image->SetData(profile, ds.az_int_bin_to_phi, ds.az_int_bin_to_q, az_bins);
|
||||
} else {
|
||||
azint_image->Clear();
|
||||
}
|
||||
stack->setCurrentWidget(azint_image);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,7 +87,3 @@ void JFJochViewerSidePanelChart::loadImage(std::shared_ptr<const JFJochReaderIma
|
||||
image = in_image;
|
||||
redrawPlot();
|
||||
}
|
||||
|
||||
void JFJochViewerSidePanelChart::setColorMap(int color_map) {
|
||||
azint_image->setColorMap(color_map);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user