v1.0.0-rc.85
This commit is contained in:
@@ -12,6 +12,15 @@ JFJochViewerDatasetInfo::JFJochViewerDatasetInfo(QWidget *parent) : QWidget(pare
|
||||
auto layout = new QGridLayout(this);
|
||||
combo_box = new QComboBox(this);
|
||||
|
||||
combo_box->addItem("Background estimate", 0);
|
||||
combo_box->addItem("Spot count", 1);
|
||||
combo_box->addItem("Spot count (indexed)", 2);
|
||||
combo_box->addItem("Spot count (ice rings)", 3);
|
||||
combo_box->addItem("Spot count (low res.)", 4);
|
||||
combo_box->addItem("Indexing result", 5);
|
||||
combo_box->addItem("Profile radius", 6);
|
||||
combo_box->setCurrentIndex(0);
|
||||
|
||||
layout->addWidget(combo_box, 0, 0);
|
||||
|
||||
auto reset_button = new QPushButton("Reset zoom", this);
|
||||
@@ -35,30 +44,7 @@ JFJochViewerDatasetInfo::JFJochViewerDatasetInfo(QWidget *parent) : QWidget(pare
|
||||
void JFJochViewerDatasetInfo::datasetLoaded(std::shared_ptr<const JFJochReaderDataset> dataset) {
|
||||
this->dataset = dataset;
|
||||
if (dataset) {
|
||||
QSignalBlocker blockCombo(combo_box); // signals temporarily blocked
|
||||
|
||||
combo_box->clear();
|
||||
|
||||
if (!dataset->bkg_estimate.empty())
|
||||
combo_box->addItem("Background estimate", 0);
|
||||
if (!dataset->spot_count.empty())
|
||||
combo_box->addItem("Spot count", 1);
|
||||
if (!dataset->indexing_result.empty())
|
||||
combo_box->addItem("Indexing result", 2);
|
||||
if (!dataset->resolution_estimate.empty())
|
||||
combo_box->addItem("Resolution estimate", 3);
|
||||
if (!dataset->b_factor.empty())
|
||||
combo_box->addItem("B-factor", 4);
|
||||
if (!dataset->profile_radius.empty())
|
||||
combo_box->addItem("Profile radius", 5);
|
||||
for (int i = 0; i < dataset->roi.size(); i++) {
|
||||
combo_box->addItem(QString::fromStdString("ROI " + dataset->roi[i] + " sum"),
|
||||
1024 + 4 * i);
|
||||
combo_box->addItem(QString::fromStdString("ROI " + dataset->roi[i] + " pixels"),
|
||||
1024 + 4 * i + 1);
|
||||
}
|
||||
|
||||
comboBoxSelected(0);
|
||||
UpdatePlot();
|
||||
} else
|
||||
chart_view->loadValues<float>({}, 0);
|
||||
}
|
||||
@@ -73,7 +59,8 @@ void JFJochViewerDatasetInfo::imageSelectedInChart(int64_t number) {
|
||||
emit imageSelected(number, 1);
|
||||
}
|
||||
|
||||
void JFJochViewerDatasetInfo::comboBoxSelected(int index) {
|
||||
void JFJochViewerDatasetInfo::UpdatePlot() {
|
||||
int index = combo_box->currentIndex();
|
||||
int val = combo_box->itemData(index).toInt();
|
||||
|
||||
std::vector<float> tmp;
|
||||
@@ -87,21 +74,21 @@ void JFJochViewerDatasetInfo::comboBoxSelected(int index) {
|
||||
else if (val == 1)
|
||||
chart_view->loadValues(dataset->spot_count, image_number);
|
||||
else if (val == 2)
|
||||
chart_view->loadValues(dataset->indexing_result, image_number);
|
||||
chart_view->loadValues(dataset->spot_count_indexed, image_number);
|
||||
else if (val == 3)
|
||||
chart_view->loadValues(dataset->resolution_estimate, image_number);
|
||||
chart_view->loadValues(dataset->spot_count_ice_rings, image_number);
|
||||
else if (val == 4)
|
||||
chart_view->loadValues(dataset->b_factor, image_number);
|
||||
chart_view->loadValues(dataset->spot_count_low_res, image_number);
|
||||
else if (val == 5)
|
||||
chart_view->loadValues(dataset->profile_radius, image_number);
|
||||
else if ((val & 1024)) {
|
||||
int roi_number = (val - 1024) / 4;
|
||||
if (roi_number < dataset->roi.size()) {
|
||||
if (val % 4 == 0)
|
||||
chart_view->loadValues(dataset->roi_sum[roi_number], image_number);
|
||||
else if (val % 4 == 1)
|
||||
chart_view->loadValues(dataset->roi_npixel[roi_number], image_number);
|
||||
}
|
||||
}
|
||||
chart_view->loadValues(dataset->indexing_result, image_number);
|
||||
else if (val == 6)
|
||||
chart_view->loadValues(dataset->profile_radius, image_number);
|
||||
else
|
||||
chart_view->loadValues<float>({}, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void JFJochViewerDatasetInfo::comboBoxSelected(int index) {
|
||||
UpdatePlot();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user