Skip to content

Commit

Permalink
Fixed ROI placement (ML)
Browse files Browse the repository at this point in the history
The ROI position was not loaded correctly from the preferences. Additionally, the text in the about menu was updated.
BZandi committed Jun 21, 2021
1 parent 5c75617 commit c647487
Showing 4 changed files with 49 additions and 20 deletions.
2 changes: 1 addition & 1 deletion PupilEXT/src/main.cpp
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
// Changing this may change the settings path thus not loading old application settings!
QCoreApplication::setOrganizationName("FGLT");
QCoreApplication::setApplicationName("PupilEXT");
QCoreApplication::setApplicationVersion("0.1.0 Beta");
QCoreApplication::setApplicationVersion("0.1.1 Beta");

qRegisterMetaTypeStreamOperators<QMap<QString, QList<float>>>("QMap<QString,QList<float>>");
qRegisterMetaTypeStreamOperators<QList<QPair<QString, QString>>>("QList<QPair<QString, QString>>");
28 changes: 18 additions & 10 deletions PupilEXT/src/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -386,15 +386,23 @@ void MainWindow::closeEvent(QCloseEvent *event) {
}

void MainWindow::about() {
QMessageBox::about(this, tr("About ") + QCoreApplication::applicationName(),
tr("<b>%1</b> is an open source application for pupillometry.<br><br>Publication:<br>Babak Zandi, Moritz Lode, Alexander Herzog, Georgios Sakas and Tran Quoc Khanh, <b>PupilEXT: flexible open-source platform for high resolution pupil measurement in vision research</b>"
"<br><br>"
"Github: <a href=\"https://github.com/openPupil/Open-PupilEXT\">https://github.com/openPupil/Open-PupilEXT</a><br>"
"OpenPupil Project: <a href=\"https://openpupil.io\">www.openpupil.io</a><br><br>"
"Developer-Team: Moritz Lode, Babak Zandi<br>Version: %2<br>"
"<br>Application settings: %3<br><br><br>"
"Powered by <b>Open Source</b>. Licensed under <a href=\"https://www.gnu.org/licenses/gpl-3.0.txt\">GPL 3</a>"
).arg(QCoreApplication::applicationName(), QCoreApplication::applicationVersion(), applicationSettings->fileName()));
GettingsStartedWizard* wizard = new GettingsStartedWizard(this);
wizard->show();
connect(wizard->button(QWizard::FinishButton), SIGNAL(clicked()), this , SLOT(onGettingsStartedWizardFinish()));

// QMessageBox::about(this, tr("About ") + QCoreApplication::applicationName(),
// tr("%1 is an open source application for pupillometry.<br><br>"
// "Babak Zandi, Moritz Lode, Alexander Herzog, Georgios Sakas and Tran Quoc Khanh. (2021)."
// " PupilEXT: Flexible Open-Source Platform for High-Resolution Pupil Measurement in Vision Research. "
// "Frontiers in Neuroscience. doi:10.3389/fnins.2021.676220."
// "<br><br>"
// "Github: <a href=\"https://github.com/openPupil/Open-PupilEXT\">https://github.com/openPupil/Open-PupilEXT</a><br>"
// "Developer-Team: Moritz Lode, Babak Zandi<br>Version: %2<br><br>"
// "The software PupilEXT is licensed under <a href=\"https://github.com/openPupil/Open-PupilEXT/blob/main/PupilEXT/LICENSE\">GNU General Public License v.3.0.</a>"
// ", Copyright (c) 2021 Technical University of Darmstadt. PupilEXT is for academic and non-commercial use only."
// " Third-party libraries may be distributed under other open-source licenses (see GitHub repository).<br><br>"
// "Application settings: %3<br>"
// ).arg(QCoreApplication::applicationName(), QCoreApplication::applicationVersion(), applicationSettings->fileName()));
}

void MainWindow::openSourceDialog() {
@@ -432,7 +440,7 @@ void MainWindow::openSourceDialog() {
"Breeze Icon Theme, License: <a href=\"https://www.gnu.org/licenses/lgpl-3.0.txt\">LGPL v3</a><br><br>");

scroll->setWidget(label);

label->setOpenExternalLinks(true);
dialog->setLayout(l);
dialog->show();
}
22 changes: 14 additions & 8 deletions PupilEXT/src/subwindows/gettingsStartedWizard.cpp
Original file line number Diff line number Diff line change
@@ -21,14 +21,19 @@ QWizardPage* GettingsStartedWizard::createIntroPage()
QWizardPage *page = new QWizardPage;
page->setTitle("Introduction");

QLabel *label = new QLabel(tr("<b>%1</b> is an open source application for pupillometry.<br><br>Presented in the work:<br>Babak Zandi, Moritz Lode, Alexander Herzog, Georgios Sakas and Tran Quoc Khanh, <b>PupilEXT: flexible open-source platform for high resolution pupil measurement in vision research</b>"
QLabel *label = new QLabel(tr("<b>%1 Version: %2 </b> is an open source application for pupillometry.<br><br>"
"Babak Zandi, Moritz Lode, Alexander Herzog, Georgios Sakas and Tran Quoc Khanh. (2021). "
"PupilEXT: Flexible Open-Source Platform for High-Resolution Pupil Measurement in Vision Research.</br>"
" Frontiers in Neuroscience. doi:10.3389/fnins.2021.676220."
"<br><br>Consider to cite our work, if you find this tool useful for your research."
"<br><br> Links:<br>"
"Github: <a href=\"https://github.com/openPupil/Open-PupilEXT\">https://github.com/openPupil/Open-PupilEXT</a><br>"
"OpenPupil Project: <a href=\"https://openpupil.io\">www.openPupil.io</a><br><br>"
"Powered by <b>Open Source</b>. Licensed under <a href=\"https://www.gnu.org/licenses/gpl-3.0.txt\">GPL 3</a>"
).arg(QCoreApplication::applicationName()));

"Github: <a href=\"https://github.com/openPupil/Open-PupilEXT\">https://github.com/openPupil/Open-PupilEXT</a><br><br>"
"The software PupilEXT is licensed under <a href=\"https://github.com/openPupil/Open-PupilEXT/blob/main/PupilEXT/LICENSE\">GNU General Public License v.3.0.</a>"
", Copyright (c) 2021 Technical University of Darmstadt. PupilEXT is for academic and non-commercial use only."
" Note that third-party libraries used in PupilEXT may be distributed under other open-source licenses (see GitHub repository).<br><br>"
"Application settings path: %3<br>"
).arg(QCoreApplication::applicationName(),QCoreApplication::applicationVersion(), applicationSettings->fileName()));

label->setOpenExternalLinks(true);
label->setWordWrap(true);

QVBoxLayout *layout = new QVBoxLayout;
@@ -58,6 +63,7 @@ QWizardPage* GettingsStartedWizard::createInfo1Page()

QLabel *label2= new QLabel("For more information and detailed video instructions visit the project website: <a href=\"https://github.com/openPupil/Open-PupilEXT\">PupilEXT</a>");
label2->setWordWrap(true);
label2->setOpenExternalLinks(true);

QGridLayout *layout = new QGridLayout;
layout->addWidget(label);
@@ -72,7 +78,7 @@ QWizardPage* GettingsStartedWizard::createConclusionPage()
QWizardPage *page = new QWizardPage;
page->setTitle("Conclusion");

QLabel *label = new QLabel("You are now ready to conduct pupil experiments! <br><br><br>Consider visiting <a href=\"https://openpupil.io\">openPupil.io</a> to review openly available pupil datasets and contribute your insights.");
QLabel *label = new QLabel("You are now ready to conduct pupil experiments! <br><br><br>Consider visiting <a href=\"https://openpupil.io\">openPupil.io</a> (under construction) to review openly available pupil datasets and contribute your insights.");
label->setWordWrap(true);

QVBoxLayout *layout = new QVBoxLayout;
17 changes: 16 additions & 1 deletion PupilEXT/src/subwindows/videoView.cpp
Original file line number Diff line number Diff line change
@@ -79,6 +79,16 @@ void VideoView::updateView(const cv::Mat &img) {
if(mode==FIT) {
graphicsView->fitInView(graphicsScene->sceneRect(), Qt::KeepAspectRatio);
}

// ML: ADDED START 20.06.21
// Reason: Prevent error if the ROI is bigger than the image itself
QRectF roi = roiSelection->sceneBoundingRect() - QMarginsF(0.5,0.5,0.5,0.5);
if(!graphicsScene->sceneRect().contains(roi)) {
roiSelection->setRect(0, 0, 32, 32);
saveROISelection();
}
// ML: ADDED END

initialFit = true;
}
}
@@ -205,7 +215,12 @@ void VideoView::setROISelection(float roiSize) {

// Sets a ROI selection based on a given rectangle
void VideoView::setROISelection(QRectF roi) {
if(!roi.isEmpty() && graphicsScene->sceneRect().contains(roi)) {
//if(!roi.isEmpty() && graphicsScene->sceneRect().contains(roi)) {
// roiSelection->setRect(roi);
//}
// ML: CHANGED START 20.06.21
if(!roi.isEmpty()) {
roiSelection->setRect(roi);
}
// ML: CHANGED END
}

0 comments on commit c647487

Please sign in to comment.