casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fit2DTool.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2000
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 #ifndef FIT2DTOOL_QO_H
26 #define FIT2DTOOL_QO_H
27 
28 #include <QDialog>
29 #include <QProgressDialog>
30 #include <QFileDialog>
31 #include <casa/aipstype.h>
32 #include <display/Fit/Fit2DTool.ui.h>
38 
39 namespace casacore{
40 
41  template <class T> class ImageInterface;
42 }
43 
44 namespace casa {
45 
46  class Gaussian2DFitter;
47  class ColorComboDelegate;
48  class RegionShape;
49 
50  class Fit2DTool : public QDialog {
51  Q_OBJECT
52 
53  public:
54  Fit2DTool(QWidget *parent = 0);
55  void setImage( std::shared_ptr<const casacore::ImageInterface<float> > image);
56  bool setImageRegion( casacore::ImageRegion* imageRegion, int id );
57  void deleteImageRegion( int id );
58  void imageRegionSelected( int id );
59  ~Fit2DTool();
60 
61  signals:
62  void showOverlay(casacore::String, const QString&);
64  void remove2DFitOverlay( QList<RegionShape*> fitMarkers );
65  void add2DFitOverlay( QList<RegionShape*> fitMarkers );
67 
68  public slots:
69  void frameChanged( int frame );
70  void newRegion( int, const QString &shape, const QString &name,
71  const QList<double> &world_x, const QList<double> &world_y,
72  const QList<int> &pixel_x, const QList<int> &pixel_y,
73  const QString &linecolor, const QString &text, const QString &font, int fontsize, int fontstyle );
75  const QList<double> &world_x, const QList<double> &world_y,
76  const QList<int> &pixel_x, const QList<int> &pixel_y );
77 
78  private slots:
79  void showFileDialog();
80  void showFindSourcesDialog();
81  void showPixelRangeDialog();
82  void estimateFileChanged( const QString& fullPath );
83  void pixelRangeChanged();
84  void pixelRangeEnabledChanged( bool enabled );
85  void pixelRangeNoneSelected( bool selected );
86  void doFit();
87  void fitColorChanged( const QString& colorName);
88  void fitDone();
89  void clearFitMarkers();
90  void showResults();
91  void showSaveDialog();
93  void residualSupportChanged( bool enable );
94  void showResidualDialog();
95  void displayFitChanged( bool display );
96  void imageModeChanged( bool imageEnabled );
97 
98  private:
99  Fit2DTool( const Fit2DTool& fitTool );
100  Fit2DTool operator=( const Fit2DTool& fitTool );
104 
105  void setImageFunctionalityEnabled( bool enable );
106  void resetRegion( const QList<int>& pixelX, const QList<int>& pixelY );
107  bool populateSaveFile( casacore::String& saveFile );
108  bool populateResidualFile( casacore::String& saveFile );
109  void showFileChooserDialog(const QString& title, QFileDialog::FileMode mode, QLineEdit* destinationLineEdit );
110  bool validateFile( QLineEdit* directoryLineEdit, QLineEdit* fileLineEdit,
111  casacore::String& saveFile, const QString& purpose );
112  void addViewerFitMarkers();
113  void removeViewerFitMarkers();
114  void clearRegions();
115 
116  //Update the widgets that depend on knowing the frame.
117  void updateFrame();
118 
119  const QString REGION_LABEL;
120  std::shared_ptr<const casacore::ImageInterface<float> > image;
121  QList<RegionShape*> fitMarkers;
124  QProgressDialog progressBar;
130 
131  Ui::Fit2DToolClass ui;
132  };
133 }
134 #endif // FIT2DTOOL_QO_H
void pixelRangeEnabledChanged(bool enabled)
void addResidualFitImage(casacore::String)
void resetRegion(const QList< int > &pixelX, const QList< int > &pixelY)
void deleteImageRegion(int id)
void showResidualHistogramDialog()
bool populateResidualFile(casacore::String &saveFile)
std::shared_ptr< const casacore::ImageInterface< float > > image
Definition: Fit2DTool.qo.h:120
void displayFitChanged(bool display)
void updateRegion(int, viewer::region::RegionChanges, const QList< double > &world_x, const QList< double > &world_y, const QList< int > &pixel_x, const QList< int > &pixel_y)
Displays a dialog that allows the user to find and edit a source list that can be used as estimates f...
const QString REGION_LABEL
Definition: Fit2DTool.qo.h:119
void showFileDialog()
void remove2DFitOverlay(QList< RegionShape * > fitMarkers)
bool populateSaveFile(casacore::String &saveFile)
void populateIncludeExclude(casacore::Vector< float > &range) const
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void residualSupportChanged(bool enable)
void removeViewerFitMarkers()
void showOverlay(casacore::String, const QString &)
void imageRegionSelected(int id)
Ui::Fit2DToolClass ui
Definition: Fit2DTool.qo.h:131
Fit2DLogDialog logDialog
Definition: Fit2DTool.qo.h:127
void addViewerFitMarkers()
casacore::Vector< float > populateExclude() const
void showFileChooserDialog(const QString &title, QFileDialog::FileMode mode, QLineEdit *destinationLineEdit)
void showPixelRangeDialog()
void pixelRangeNoneSelected(bool selected)
void newRegion(int, const QString &shape, const QString &name, const QList< double > &world_x, const QList< double > &world_y, const QList< int > &pixel_x, const QList< int > &pixel_y, const QString &linecolor, const QString &text, const QString &font, int fontsize, int fontstyle)
ResidualHistogramDialog residualHistogramDialog
Definition: Fit2DTool.qo.h:128
ColorComboDelegate * fitColorDelegate
Definition: Fit2DTool.qo.h:123
Performs a 2DGaussian fit of an image in a background thread.
void setImage(std::shared_ptr< const casacore::ImageInterface< float > > image)
bool validateFile(QLineEdit *directoryLineEdit, QLineEdit *fileLineEdit, casacore::String &saveFile, const QString &purpose)
void showResidualDialog()
casacore::String residualImagePath
Definition: Fit2DTool.qo.h:129
PixelRangeDialog pixelRangeDialog
Definition: Fit2DTool.qo.h:126
Gaussian2DFitter * fitter
Definition: Fit2DTool.qo.h:122
QProgressDialog progressBar
Definition: Fit2DTool.qo.h:124
void imageModeChanged(bool imageEnabled)
FindSourcesDialog findSourcesDialog
Definition: Fit2DTool.qo.h:125
void showFindSourcesDialog()
void removeOverlay(casacore::String)
void frameChanged(int frame)
Fit2DTool(QWidget *parent=0)
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
void estimateFileChanged(const QString &fullPath)
QList< RegionShape * > fitMarkers
Definition: Fit2DTool.qo.h:121
Class to hold a region of interest in an image.
Definition: ImageRegion.h:86
void fitColorChanged(const QString &colorName)
bool setImageRegion(casacore::ImageRegion *imageRegion, int id)
void updateFrame()
Update the widgets that depend on knowing the frame.
Fit2DTool operator=(const Fit2DTool &fitTool)
void clearFitMarkers()
Displays a histogram that allows the user to set a include/exclude pixel range for the fit...
void showSaveDialog()
void setImageFunctionalityEnabled(bool enable)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Vector< float > populateInclude() const
void pixelRangeChanged()
void add2DFitOverlay(QList< RegionShape * > fitMarkers)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42