|
@@ -99,7 +99,7 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
|
|
|
action_open_image_ = new QAction(this);
|
|
|
action_open_image_->setText(tr("&Load image"));
|
|
|
action_open_images_ = new QAction(this);
|
|
|
- action_open_images_->setText(tr("&Load images(recursively)"));
|
|
|
+ action_open_images_->setText(tr("&Load images (recursively)"));
|
|
|
action_open_labeled_image_ = new QAction(this);
|
|
|
action_open_labeled_image_->setText(tr("&Load labeled image"));
|
|
|
action_load_legend_ = new QAction(this);
|
|
@@ -339,7 +339,7 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
|
|
|
button_next_image_ = new QPushButton(central_widget_);
|
|
|
button_next_image_->setText("→");
|
|
|
button_next_image_->setAutoRepeat(true);
|
|
|
-
|
|
|
+
|
|
|
/*
|
|
|
* layouts part begins
|
|
|
*/
|
|
@@ -1610,7 +1610,7 @@ ImageLabeler::getImagesFromDir(const QDir &dir)
|
|
|
* Adds to filename of the current image to the window title
|
|
|
*/
|
|
|
void
|
|
|
-ImageLabeler::nextImage()
|
|
|
+ImageLabeler::nextImage(int iImageStep)
|
|
|
{
|
|
|
if (list_images_->isEmpty()) {
|
|
|
return;
|
|
@@ -1629,11 +1629,11 @@ ImageLabeler::nextImage()
|
|
|
segmented_image_.clear();
|
|
|
//clearLabelColorList();
|
|
|
|
|
|
- if (list_images_widget_->count() - 1 == image_ID_) {
|
|
|
+ if (list_images_widget_->count() - iImageStep == image_ID_) {
|
|
|
image_ID_ = 0;
|
|
|
}
|
|
|
else {
|
|
|
- image_ID_ ++;
|
|
|
+ image_ID_ += iImageStep;
|
|
|
}
|
|
|
|
|
|
if (!selectImage(image_ID_)) {
|
|
@@ -1668,7 +1668,7 @@ ImageLabeler::nextImage()
|
|
|
* Adds to filename of the current image to the window title
|
|
|
*/
|
|
|
void
|
|
|
-ImageLabeler::prevImage()
|
|
|
+ImageLabeler::prevImage(int iImageStep)
|
|
|
{
|
|
|
if (!list_images_widget_->count()) {
|
|
|
return;
|
|
@@ -1688,11 +1688,11 @@ ImageLabeler::prevImage()
|
|
|
//clearLabelColorList();
|
|
|
|
|
|
|
|
|
- if (!image_ID_) {
|
|
|
+ if (image_ID_ < iImageStep) {
|
|
|
image_ID_ = list_images_widget_->count() - 1;
|
|
|
}
|
|
|
else {
|
|
|
- image_ID_--;
|
|
|
+ image_ID_ -= iImageStep;
|
|
|
}
|
|
|
|
|
|
list_images_widget_->setCurrentRow(image_ID_);
|
|
@@ -2138,7 +2138,7 @@ ImageLabeler::loadInfo(QString filename)
|
|
|
}
|
|
|
/* legend */
|
|
|
else if (element.tagName() == "legend") {
|
|
|
- qDebug() << "legend";
|
|
|
+ //qDebug() << "legend";
|
|
|
list_label_->clear();
|
|
|
loadLegendFromNode(&element);
|
|
|
}
|
|
@@ -4116,11 +4116,20 @@ ImageLabeler::keyPressEvent(QKeyEvent *anEvent)
|
|
|
Qt::ControlModifier == keyboard_modifier_) {
|
|
|
prevImage();
|
|
|
}
|
|
|
+ if (Qt::Key_Down == anEvent->key() &&
|
|
|
+ Qt::ControlModifier == keyboard_modifier_) {
|
|
|
+ prevImage(5);
|
|
|
+ }
|
|
|
|
|
|
if (Qt::Key_Right == anEvent->key() &&
|
|
|
Qt::ControlModifier == keyboard_modifier_) {
|
|
|
nextImage();
|
|
|
}
|
|
|
+
|
|
|
+ if (Qt::Key_Up == anEvent->key() &&
|
|
|
+ Qt::ControlModifier == keyboard_modifier_) {
|
|
|
+ nextImage(5);
|
|
|
+ }
|
|
|
|
|
|
if ((Qt::Key_Enter == anEvent->key() ||
|
|
|
Qt::Key_Return == anEvent->key()) &&
|