Skip to content

Commit 074b9e6

Browse files
committed
Revision 3.3
1 parent 321d4b2 commit 074b9e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1297
-214
lines changed

DFTFringe.pro

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ SOURCES += main.cpp\
120120
rejectedwavefrontsdlg.cpp \
121121
outlinestatsdlg.cpp \
122122
filteroutlinesdlg.cpp \
123-
outlineplots.cpp
123+
outlineplots.cpp \
124+
transformwavefrontdlg.cpp \
125+
showallcontoursdlg.cpp
124126
punwrap.cpp
125127

126128
HEADERS += mainwindow.h \
@@ -224,7 +226,9 @@ HEADERS += mainwindow.h \
224226
rejectedwavefrontsdlg.h \
225227
outlinestatsdlg.h \
226228
filteroutlinesdlg.h \
227-
outlineplots.h
229+
outlineplots.h \
230+
transformwavefrontdlg.h \
231+
showallcontoursdlg.h
228232
FORMS += mainwindow.ui \
229233
dfttools.ui \
230234
dftarea.ui \
@@ -292,7 +296,9 @@ FORMS += mainwindow.ui \
292296
rejectedwavefrontsdlg.ui \
293297
outlinestatsdlg.ui \
294298
filteroutlinesdlg.ui \
295-
outlineplots.ui
299+
outlineplots.ui \
300+
transformwavefrontdlg.ui \
301+
showallcontoursdlg.ui
296302

297303
win32 {
298304
CONFIG( debug, debug|release ) {
@@ -330,7 +336,7 @@ RC_FILE = DFTFringe.rc
330336
QMAKE_CXXFLAGS += -std=c++11
331337

332338
# The application version
333-
VERSION = 3.2c
339+
VERSION = 3.3
334340

335341
# Define the preprocessor macro to get the application version in our application.
336342
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

RevisionHistory.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,31 @@
223223
<li>Fixed bug where slope error was not displayed correctly on profile plot.</li>
224224
<li>Rotation dialog now remembers last used rotation parameters.</li>
225225
</ul></ul>
226+
<ul><li>Version 3.3</li>
227+
<ul>
228+
<li>Major enhancment links contour plot and profile plot. <br>
229+
Added current profile line indicator to contour plot. Linked contour plot and profile plot so that moving the profile angle moves the contour
230+
profile.<br>
231+
Displays error of pixel under contour plot cursor and move the profie angle to match and include that point.
232+
<br>Left click and drag creates a zoom rectanngle. Right click zooms out full size.</li>
233+
<li>Tools menu. Added wavefront transforms to change size of wave front, to change input wave length, to flip wave front.
234+
Necessare to compare wave fronts from other users done at different settings</li>
235+
<li>Tools menu. Added tilt vs astig analysis.</li>
236+
<li>Added save Foucault and Ronchi images to the scan control.</li>
237+
<li> Region editing. Pressing control key with shift and left button mouse moves all regions. </li>
238+
<li>Preferences DFT. Added flip resulting analysis settings.</li>
239+
<li>Remembers zoom to edge setting on load of new interferogram and in batch processing.</li>
240+
<li>Moved progress bar for batch processing to the Batch dialog</li>
241+
<li>File menu Added save current profile to a text file.</li>
242+
<li>Corrected bug so that last used central obstruction outline is remembered correctly.</li>
243+
<li>Corrected issue with contour plot and 3d plot which did not show as desired in report.</ll>
244+
<li>Corrected obstruction shown in profile plot</li>
245+
<li>Inhibited asking about inverting wavefront during test stand removal process.</li>
246+
<li>Enhanced test stand astig circle plot to show lines linking rotations 90 deg apart.</li>
247+
<li>Enhanced test stand astig circle plot to pick a better circle fit algorithm when points are mostly on a line.</li>
248+
<li>Fixed last outlines not being remembered correct when next igram is loaded and center outline was last selected.</li>
249+
<li>Fixed bug that would not invert wave fronts.</li>
250+
<li>Added dialog to configure size of contours in show all counters feature.</li>
251+
<li>Corrected calculation of polar angle of atig value displays.</li>
252+
<li>Batch feature. Changed review to save indiviual images instead of making a movie.</li>
253+
</ul></ul>

astigstatsdlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ QwtPlot *astigStatsDlg::avgPlot(cv::Mat x, cv::Mat y){
554554
double yz = y.at<float>(i);
555555
double angle, mag;
556556
if (m_usePolar){
557-
angle = atan2(yz,xz);
557+
angle = atan2(yz,xz)/2;
558558
mag = sqrt(xz * xz + yz * yz);
559559

560560
xz = mag;

batchigramwizard.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ QPushButton *batchIgramWizard::saveZerns = 0;
2424
QLabel *batchIgramWizard::memStatus = 0;
2525
QCheckBox *batchIgramWizard::makeReviewAvi = 0;
2626
QString batchIgramWizard::reviewFileName;
27-
QPushButton *batchIgramWizard::playReview = 0;
2827
QCheckBox *batchIgramWizard::autoOutlineCenter = 0;
2928
QCheckBox *batchIgramWizard::autoOutlineOutside = 0;
3029

@@ -142,7 +141,7 @@ batchIntro::batchIntro(QStringList files, QWidget *manager, QWidget *p):
142141

143142
connect(this, SIGNAL(processBatchList(QStringList)), qobject_cast<MainWindow *>(manager), SLOT(batchProcess(QStringList)));
144143

145-
144+
pgrBar = new QProgressBar;
146145
batchIgramWizard::addFiles = new QPushButton(tr("Add Files"));
147146
batchIgramWizard::skipFile = new QPushButton(tr("Skip"));
148147
connect(batchIgramWizard::skipFile, SIGNAL(clicked(bool)), qobject_cast<MainWindow *>(manager), SLOT(skipBatchItem()));
@@ -183,13 +182,12 @@ batchIntro::batchIntro(QStringList files, QWidget *manager, QWidget *p):
183182
QHBoxLayout *gbLayout = new QHBoxLayout();
184183
//gbLayout->addWidget(batchIgramWizard::autoOutlineOutside);
185184
gbLayout->addWidget(batchIgramWizard::autoOutlineCenter);
185+
gbLayout->addWidget(pgrBar);
186186
outlineGB->setLayout(gbLayout);
187-
batchIgramWizard::makeReviewAvi = new QCheckBox(tr("Make review AVI"));
188-
batchIgramWizard::makeReviewAvi->setToolTip("Create a movie where each frame \nshows the igram, dft, 3D and contour plot\n"
187+
batchIgramWizard::makeReviewAvi = new QCheckBox(tr("Make review images"));
188+
batchIgramWizard::makeReviewAvi->setToolTip("Create a sub directory \"review\" where each file \nshows the igram, dft, 3D and contour plot\n"
189189
" of each interferogram analyzed.");
190-
batchIgramWizard::playReview = new QPushButton(tr("Play review movie"), this);
191-
batchIgramWizard::playReview->setEnabled(false);
192-
connect(batchIgramWizard::playReview, SIGNAL(pressed()), this, SLOT(play_review()));
190+
193191
batchIgramWizard::saveZerns->setEnabled(false);
194192
batchIgramWizard::saveZerns->setToolTip("If wavefronts were being deleted to save space.\n"
195193
"Use this to save the zernike values just created by\nthe "
@@ -218,7 +216,6 @@ batchIntro::batchIntro(QStringList files, QWidget *manager, QWidget *p):
218216
hlayout3->addWidget(batchIgramWizard::goPb,0, Qt::AlignLeft);
219217
hlayout3->addWidget(batchIgramWizard::showProcessPlots);
220218
hlayout3->addWidget(batchIgramWizard::makeReviewAvi);
221-
hlayout3->addWidget(batchIgramWizard::playReview);
222219
hlayout3->addWidget(batchIgramWizard::memStatus);
223220
hlayout3->addWidget(batchIgramWizard::saveZerns);
224221
layout->addLayout(hlayout3);
@@ -228,9 +225,7 @@ batchIntro::batchIntro(QStringList files, QWidget *manager, QWidget *p):
228225

229226

230227
}
231-
void batchIntro::play_review(){
232-
QDesktopServices::openUrl(QUrl(batchIgramWizard::reviewFileName));
233-
}
228+
234229

235230
void batchIntro::on_filter(bool flag){
236231
if (flag){
@@ -254,6 +249,10 @@ void batchIgramWizard::addAstig(QString name, QPointF value){
254249
introPage->astigPlot->addValue(name,value);
255250
}
256251

252+
void batchIgramWizard::progressValue(int min, int max, int value){
253+
introPage->pgrBar->setRange(min, max);
254+
introPage->pgrBar->setValue(value);
255+
}
257256

258257
void batchIgramWizard::addRms(QString name, QPointF p){
259258
introPage->m_rmsPlot->addValue(name,p);

batchigramwizard.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <QStringList>
88
#include <QCheckBox>
99
#include <QPointF>
10-
10+
#include <QProgressBar>
1111
class wavefrontFilterDlg;
1212
class QwtPlot;
1313
class astigScatterPlot;
@@ -37,7 +37,7 @@ class batchIgramWizard : public QWizard
3737
static QCheckBox *makeReviewAvi;
3838
static QLabel *memStatus;
3939
static QString reviewFileName;
40-
static QPushButton *playReview;
40+
4141
static QCheckBox *autoOutlineOutside;
4242
static QCheckBox *autoOutlineCenter;
4343
explicit batchIgramWizard(QStringList files, QWidget *parent = 0 , Qt::WindowFlags flags = 0);
@@ -46,6 +46,7 @@ class batchIgramWizard : public QWizard
4646

4747
void addAstig(QString name, QPointF value);
4848
void addRms(QString name, QPointF p);
49+
void progressValue(int min, int max, int value);
4950
void select(int n);
5051
void showPlots(bool flags);
5152
batchIntro *introPage;
@@ -70,6 +71,7 @@ class batchIntro : public QWizardPage
7071
public:
7172
batchIntro(QStringList files, QWidget *manger, QWidget *parent = 0);
7273
QListWidget *filesList;
74+
QProgressBar *pgrBar;
7375
astigScatterPlot *astigPlot;
7476
rmsPlot *m_rmsPlot;
7577
bool filterFile;
@@ -85,7 +87,7 @@ public slots:
8587
void eraseItem();
8688
void showPlots(bool flags);
8789
void on_filter(bool);
88-
void play_review();
90+
8991
signals:
9092
void processBatchList(QStringList);
9193
private:

contourplot.cpp

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,35 @@
4242
#include "utils.h"
4343
#include <qwt_plot_shapeitem.h>
4444
#include <QSettings>
45+
#include <qwt_picker_machine.h>
46+
47+
4548
double zOffset = 0;
4649

4750
class MyZoomer: public QwtPlotZoomer
4851
{
4952
public:
50-
MyZoomer( QWidget *canvas ):
51-
QwtPlotZoomer( canvas )
53+
ContourPlot* thePlot;
54+
MyZoomer( QWidget *canvas ,ContourPlot* plot):
55+
QwtPlotZoomer( canvas ), thePlot(plot)
5256
{
5357
setTrackerMode( AlwaysOn );
5458
}
5559

5660
virtual QwtText trackerTextF( const QPointF &pos ) const
5761
{
62+
if (thePlot->m_wf == 0)
63+
return QwtText("");
5864
QColor bg( Qt::white );
5965
bg.setAlpha( 200 );
66+
int x = thePlot->invTransform(QwtPlot::xBottom, pos.x());
67+
int y = thePlot->invTransform(QwtPlot::yLeft, pos.y());
68+
double v = thePlot->d_spectrogram->data()->value(pos.x(),pos.y());
6069

61-
QwtText text = QwtPlotZoomer::trackerTextF( pos );
70+
QwtText text(QString().sprintf("%lf",v));
71+
text.setFont(QFont("Arial",12));
6272
text.setBackgroundBrush( QBrush( bg ) );
73+
thePlot->selected(pos);
6374
return text;
6475
}
6576
signals:
@@ -69,14 +80,17 @@ class MyZoomer: public QwtPlotZoomer
6980

7081
SpectrogramData::SpectrogramData(): m_wf(0)
7182
{
83+
7284
}
7385

86+
7487
void SpectrogramData::setSurface(wavefront *surface) {
7588
m_wf = surface;
7689
setInterval( Qt::XAxis, QwtInterval(0,m_wf->workData.cols));
7790
setInterval( Qt::YAxis, QwtInterval(0, m_wf->workData.rows));
7891
}
7992
#include <qwt_round_scale_draw.h>
93+
extern double g_angle;
8094
double SpectrogramData::value( double x, double y ) const
8195
{
8296

@@ -177,8 +191,8 @@ void ContourPlot::setZRange(){
177191

178192
}
179193
else if (m_zRangeMode == "Min/Max"){
180-
zmin = m_wf->min;
181-
zmax = m_wf->max;
194+
zmin = m_min;
195+
zmax = m_max;
182196
}
183197
else if (m_zRangeMode == "Fractions of Wave"){
184198
zmin = -m_waveRange/2;
@@ -195,6 +209,8 @@ void ContourPlot::setZRange(){
195209
}
196210
void ContourPlot::newDisplayErrorRange(double min,double max){
197211
QwtInterval zInt(min,max);
212+
m_min = min;
213+
m_max = max;
198214
SpectrogramData *data = (SpectrogramData*)d_spectrogram->data();
199215
data->setInterval( Qt::ZAxis, zInt);
200216
setColorMap(m_colorMapNdx);
@@ -277,6 +293,9 @@ void ContourPlot::ruler(){
277293

278294
item->attach( this );
279295
}
296+
297+
298+
280299
QwtPlotMarker *yAxis = new QwtPlotMarker();
281300
yAxis->setLineStyle(QwtPlotMarker::VLine);
282301
yAxis->setXValue(m_wf->data.cols/2);
@@ -292,6 +311,52 @@ void ContourPlot::ruler(){
292311

293312
}
294313
}
314+
void ContourPlot::moved(const QPointF pos){
315+
316+
}
317+
318+
void ContourPlot::selected(const QPointF& pos){
319+
if (m_wf==0)
320+
return;
321+
322+
int half = m_wf->data.rows/2.;
323+
double delx = pos.x() - half;
324+
double dely = pos.y() - half;
325+
double angle = atan2(dely,delx);
326+
if (angle != m_lastAngle){
327+
drawProfileLine(angle);
328+
emit sigPointSelected(pos);
329+
m_lastAngle = angle;
330+
}
331+
}
332+
333+
void ContourPlot::drawProfileLine(const double angle){
334+
335+
ruler();
336+
double sina = sin(angle);
337+
double cosa = cos(angle);
338+
QPainterPath radials;
339+
int half = m_wf->data.rows/2.;
340+
// move to start
341+
int startx = -half * cosa;
342+
int starty = -half * sina;
343+
radials.moveTo( half + startx,half + starty);
344+
// line to end
345+
int endx = half - startx;
346+
int endy = half - starty;
347+
radials.lineTo(endx,endy);
348+
QwtPlotShapeItem *item = new QwtPlotShapeItem( "");
349+
item->setShape(radials);
350+
item->setPen(QColor(50,50,50,100),3,Qt::DashDotDotLine);
351+
352+
QwtPlotShapeItem *itemb = new QwtPlotShapeItem( "");
353+
itemb->setShape(radials);
354+
itemb->setPen(QColor(250,250,250,100),10);
355+
itemb->attach(this);
356+
item->attach(this);
357+
replot();
358+
}
359+
295360

296361
void ContourPlot::setSurface(wavefront * wf) {
297362
m_wf = wf;
@@ -337,7 +402,7 @@ void ContourPlot::setSurface(wavefront * wf) {
337402

338403
plotLayout()->setAlignCanvasToScales(true);
339404
showContoursChanged(contourRange);
340-
405+
tracker_->setZoomBase(true);
341406
replot();
342407
//resize(QSize(width()-1,height()-1));
343408
//resize(QSize(width()+1,height()+1));
@@ -351,6 +416,15 @@ ContourPlot::ContourPlot( QWidget *parent, ContourTools *tools, bool minimal ):
351416
QwtPlot( parent ),m_wf(0),m_tools(tools), m_autoInterval(false),m_minimal(minimal),m_contourPen(Qt::white)
352417
{
353418
d_spectrogram = new QwtPlotSpectrogram();
419+
picker_ = new QwtPlotPicker(this->canvas());
420+
picker_->setStateMachine(new QwtPickerClickPointMachine);
421+
422+
tracker_ = new MyZoomer(this->canvas(), this);
423+
424+
425+
connect(picker_, SIGNAL(selected(const QPointF&)),
426+
SLOT(selected(const QPointF&)));
427+
354428
QSettings settings;
355429
m_colorMapNdx = settings.value("colorMapType",0).toInt();
356430
contourRange = settings.value("contourRange", .1).toDouble();
@@ -457,6 +531,7 @@ void ContourPlot::setAlpha( int alpha )
457531
replot();
458532
}
459533

534+
460535
#ifndef QT_NO_PRINTER
461536

462537
void ContourPlot::printPlot()

0 commit comments

Comments
 (0)