Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions RevisionHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<h1>DFTFringe Version History</h1>
<ul>

<li>Version 8.3.2</li>
<ul>
<li>Fixed bug introduced in 8.3.1 in Ronchi Foucault where it was always doing autocollimate mode</li>
</ul>

<li>Version 8.3.1</li>
<ul>
<li>Auto-invert feature (and dialog) only applies to wavefronts created form igram, not those loaded from file, simulated, averaged, subtracted, etc.</li>
Expand Down
16 changes: 12 additions & 4 deletions foucaultview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ QVector<QPoint> scaleProfile(QPolygonF points, int width,
}


QImage foucaultView::generateOpticalTestImage(OpticalTestType type, wavefront* wf, const OpticalTestSettings& s)
QImage foucaultView::generateOpticalTestImage(OpticalTestType type, wavefront* wf, const OpticalTestSettings& s, bool bAutoCollimate)
{
if (!wf || wf->data.cols == 0) return QImage();

Expand Down Expand Up @@ -200,8 +200,15 @@ QImage foucaultView::generateOpticalTestImage(OpticalTestType type, wavefront* w

SimulationsView *sv = SimulationsView::getInstance(0);
sv->setSurface(wf);

bool oldDoNull = md->doNull;
if (bAutoCollimate == false)
md->doNull = false; // this is normal foucault/ronchi so we *don't* subtract the null (autcoCollimate ronchi or foucault mode will typically subtract the null)

cv::Mat surf_fft = sv->computeStarTest(s.heightMultiply * sv->nulledSurface(effectiveZ3), size, actualPad, true);

wf->InputZerns = originalZerns; // Restore state immediately
md->doNull = oldDoNull;

// 3. Mask Generation
cv::Mat mask = cv::Mat::zeros(size, size, CV_64FC1);
Expand Down Expand Up @@ -275,6 +282,7 @@ void foucaultView::on_makePb_clicked()

QApplication::setOverrideCursor(Qt::WaitCursor);


// 1. Pack the current UI state into the settings struct
OpticalTestSettings settings;
settings.rocOffset = ui->rocOffsetSb->value();
Expand All @@ -293,8 +301,8 @@ void foucaultView::on_makePb_clicked()
settings.outputLambda = outputLambda;

// 2. Call the refactored static engine for both images
QImage ronchiImg = generateOpticalTestImage(OpticalTestType::Ronchi, m_wf, settings);
QImage foucaultImg = generateOpticalTestImage(OpticalTestType::Foucault, m_wf, settings);
QImage ronchiImg = generateOpticalTestImage(OpticalTestType::Ronchi, m_wf, settings, ui->autocollimation->isChecked());
QImage foucaultImg = generateOpticalTestImage(OpticalTestType::Foucault, m_wf, settings, ui->autocollimation->isChecked());

// Store for potential saving/external access
m_foucaultQimage = foucaultImg;
Expand Down Expand Up @@ -402,7 +410,7 @@ void foucaultView::generateBatchRonchiImage(const QList<wavefront*>& wavefrontLi
int row = i / cols;
int col = i % cols;

QImage ronchi = generateOpticalTestImage(OpticalTestType::Ronchi, currentWf, s);
QImage ronchi = generateOpticalTestImage(OpticalTestType::Ronchi, currentWf, s, ui->autocollimation->isChecked());

if (!ronchi.isNull()) {
// Store a copy for the comparison feature
Expand Down
2 changes: 1 addition & 1 deletion foucaultview.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class foucaultView : public QWidget
bool needsDrawing;

// The Refactored Static Engine - Callable from other classes
static QImage generateOpticalTestImage(OpticalTestType type, wavefront* wf, const OpticalTestSettings& settings);
static QImage generateOpticalTestImage(OpticalTestType type, wavefront* wf, const OpticalTestSettings& settings, bool bAutoCollimate);

public slots:
void on_makePb_clicked();
Expand Down
Loading