- Notifications
You must be signed in to change notification settings - Fork 66
Fixes issue #115 - issues with "edge mask" aka aperture reduction#116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -152,6 +152,8 @@ void IgramArea::computeEdgeRadius(){ | ||
| mirrorDlg &md = *mirrorDlg::get_Instance(); | ||
| double pixelsPermm =(m_outside.m_radius/(md.diameter/2.)); | ||
| m_edgeMaskWidth = md.aperatureReduction * pixelsPermm; | ||
| if (md.m_aperatureReductionEnabled == false) | ||
| m_edgeMaskWidth = 0; | ||
| } | ||
| @@ -2140,45 +2142,6 @@ void IgramArea::loadOutlineFile(QString fileName){ | ||
| emit dftCenterFilter(filter); | ||
| // edge mask | ||
| const QJsonValue jedge = loadDoc["edge_mask_width_mm"]; | ||
| mirrorDlg &md = *mirrorDlg::get_Instance(); | ||
| if (jedge.isDouble()) { | ||
| const double edge = jedge.toDouble(); | ||
| // if outline edge mask is different than current ask user | ||
| if (edge != md.aperatureReduction){ | ||
| QString text( | ||
| "Do you want to change the mirror config value to match the value in the outline file?\n" | ||
| "If no then the current mirror config value will be used instead." | ||
| ); | ||
| QMessageBox mb; | ||
| mb.setText(QString("Edge mask value in outline file for this interferogram is %1 and is different than mirror config value of %2.").arg( | ||
| edge, 6, 'f', 1).arg(md.aperatureReduction, 6, 'f', 1) ); | ||
| mb.setInformativeText(text); | ||
| mb.setStandardButtons( QMessageBox::Yes|QMessageBox::No ); | ||
| mb.setWindowTitle("Existing Interferogram outline file and Mirror Config difference."); | ||
| int width = QGuiApplication::primaryScreen()->geometry().width() * .5; | ||
| QSpacerItem* horizontalSpacer = new QSpacerItem(width, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); | ||
| QGridLayout* layout = (QGridLayout*)mb.layout(); | ||
| layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount()); | ||
| int resp = mb.exec(); | ||
| switch (resp){ | ||
| case QMessageBox::Yes: | ||
| md.changeEdgeMaskvalues(edge); | ||
| break; | ||
| case QMessageBox::No: | ||
| default: // if they click red X do same thing as "no" button | ||
| md.changeEdgeMaskvalues(md.aperatureReduction); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| else{ // just enable edge mask check box to use the current value. | ||
| md.changeEdgeMaskvalues(md.aperatureReduction); | ||
| } | ||
| // mask polygons regions | ||
| m_polygons.clear(); | ||
| @@ -2257,40 +2220,7 @@ void IgramArea::loadOutlineFileOldV6(QString fileName){ | ||
| mirrorDlg &md = *mirrorDlg::get_Instance(); | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line can be deleted as CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops. Already merged. Didn't see your comment until now. Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can fix in the other PR. It's really minor. | ||
| if (line == "Edge Mask width"){ | ||
| std::getline(file,line); | ||
| double edge = QString::fromStdString(line).toDouble(); | ||
| // if outline edge mask is different than current ask user | ||
| if (edge != md.aperatureReduction){ | ||
| QString text( | ||
| "Do you want to change the mirror config value to match the value in the outline file?\n" | ||
| "If no then the current mirror config value will be used instead." | ||
| ); | ||
| QMessageBox mb; | ||
| mb.setText(QString("Edge mask value in outline file for this interferogram is %1 and is different than mirror config value of %2.").arg( | ||
| edge, 6, 'f', 1).arg(md.aperatureReduction, 6, 'f', 1) ); | ||
| mb.setInformativeText(text); | ||
| mb.setStandardButtons( QMessageBox::Yes|QMessageBox::No ); | ||
| mb.setWindowTitle("Existing Interferogram outline file and Mirror Config difference."); | ||
| int width = QGuiApplication::primaryScreen()->geometry().width() * .5; | ||
| QSpacerItem* horizontalSpacer = new QSpacerItem(width, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); | ||
| QGridLayout* layout = (QGridLayout*)mb.layout(); | ||
| layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount()); | ||
| int resp = mb.exec(); | ||
| switch (resp){ | ||
| case QMessageBox::Yes: | ||
| md.changeEdgeMaskvalues(edge); | ||
| break; | ||
| case QMessageBox::No: | ||
| md.changeEdgeMaskvalues(md.aperatureReduction); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| else{ // just enable edge mask check box to use the current value. | ||
| md.changeEdgeMaskvalues(md.aperatureReduction); | ||
| } | ||
| } | ||
| @@ -2370,10 +2300,7 @@ void IgramArea::writeOutlinesOldV6(QString fileName){ | ||
| } | ||
| } | ||
| saveRegions(); // save regions to registry also | ||
| if (m_edgeMaskWidth != 0){ | ||
| mirrorDlg &md = *mirrorDlg::get_Instance(); | ||
| file << "\nEdge Mask width" << std::endl << md.aperatureReduction << std::endl; | ||
| } | ||
| file.flush(); | ||
| file.close(); | ||
| @@ -2404,11 +2331,6 @@ void IgramArea::writeOutlines(QString fileName){ | ||
| double filterRad = set.value("DFT Center Filter",10).toDouble(); | ||
| j1["dft_filter_radius"]=filterRad; | ||
| if (m_edgeMaskWidth != 0) { | ||
| mirrorDlg &md = *mirrorDlg::get_Instance(); | ||
| j1["edge_mask_width_mm"] = md.aperatureReduction; | ||
| } | ||
| QJsonArray jRegions; | ||
| for (int i = 0; i < m_polygons.size(); ++ i){ | ||
| if (m_polygons[i].size() > 0){ | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this line of code (line 2180 just above) is particularly nasty and found when reading OLN file: both the older V6 style OLN file and also when reading V7. It checks the "edge mask" checkbox even if nothing is found regarding edge mask in the OLN file!
Not only did I get rid of the above code in both "writeOLN" functions, I got rid of the entire function (which is where it checks the box in the gui). That function, changeEdgeMaskvalue(), was used in many places when reading OLN files but nowhere else. So I got rid of it.