diff --git a/viewer/toolbar/JFJochViewerToolbarImage.cpp b/viewer/toolbar/JFJochViewerToolbarImage.cpp index 0ef35b37..ea6f99e9 100644 --- a/viewer/toolbar/JFJochViewerToolbarImage.cpp +++ b/viewer/toolbar/JFJochViewerToolbarImage.cpp @@ -98,8 +98,8 @@ JFJochViewerToolbarImage::JFJochViewerToolbarImage(QWidget *parent) : QToolBar(p void JFJochViewerToolbarImage::updateButtons() { if (image_count_in_dataset > 0) { current_image_edit->setDisabled(false); - current_image_edit->setText(QString::number(curr_image)); - current_image_edit_validator->setRange(0, image_count_in_dataset - 1); + current_image_edit->setText(QString::number(curr_image + 1)); + current_image_edit_validator->setRange(1, image_count_in_dataset); left_button->setDisabled(curr_image < jump_value); right_button->setDisabled(curr_image >= image_count_in_dataset - jump_value); @@ -123,7 +123,7 @@ void JFJochViewerToolbarImage::updateButtons() { if (image_count_in_dataset == 0) total_number_label->setText("/ - "); else - total_number_label->setText("/" + QString::number(image_count_in_dataset - 1)); + total_number_label->setText("/" + QString::number(image_count_in_dataset)); } void JFJochViewerToolbarImage::setImageNumber(int64_t total_images, int64_t current_image) { @@ -173,8 +173,8 @@ void JFJochViewerToolbarImage::editFinalized() { bool ok; int editedValue = current_image_edit->text().toInt(&ok); - if (ok && editedValue >= 0 && editedValue <= image_count_in_dataset - 1) { - emit loadImage(editedValue, sum); + if (ok && editedValue >= 1 && editedValue <= image_count_in_dataset) { + emit loadImage(editedValue - 1, sum); } } diff --git a/viewer/windows/JFJochViewerImageListWindow.cpp b/viewer/windows/JFJochViewerImageListWindow.cpp index 85f373b2..5316c59d 100644 --- a/viewer/windows/JFJochViewerImageListWindow.cpp +++ b/viewer/windows/JFJochViewerImageListWindow.cpp @@ -123,7 +123,7 @@ void JFJochViewerImageListWindow::datasetLoaded(std::shared_ptrmax_value.size() > i) max_value = dataset->max_value[i]; - addDataRow(i, + addDataRow(i + 1, bkg_estimate, indexing_result, spot_count, @@ -156,5 +156,5 @@ void JFJochViewerImageListWindow::onTableRowDoubleClicked(const QModelIndex &ind QModelIndex sourceIndex = proxyModel->mapToSource(index); int imageNumber = tableModel->item(sourceIndex.row(), 0)->data(Qt::DisplayRole).toInt(); - emit imageSelected(imageNumber, 1); + emit imageSelected(imageNumber - 1, 1); }