casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FindSourcesDialog.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 
26 #ifndef FIND_SOURCES_DIALOG_QO_H
27 #define FIND_SOURCES_DIALOG_QO_H
28 
29 #include <QDialog>
30 #include <QMap>
31 #include <casa/Containers/Record.h>
32 #include <display/Fit/FindSourcesDialog.ui.h>
36 
37 class QFileSystemModel;
38 
39 namespace casa {
40 
41  class SkyCatOverlayDD;
42  class RegionBox;
43  class ColorComboDelegate;
44 
50  class FindSourcesDialog : public QDialog {
51  Q_OBJECT
52 
53  public:
54  FindSourcesDialog(QWidget *parent = 0, bool displayModeFunctionality = true);
55  void setImage( std::shared_ptr<const casacore::ImageInterface<float> > image );
56  void setChannel( int channel );
57 
58  void clearImage();
59 
60  QString getRegionString() const;
62  QString getImagePixelBox() const;
64  bool* errorWritingFile );
65  const static QStringList colorNames;
67 
68  signals:
69  void showOverlay(casacore::String, const QString& );
71  void estimateFileSpecified( const QString& fullPath );
72 
73  public slots:
74  void setImageMode( bool imageMode );
75  bool newRegion( int id, const QString & shape, const QString &name,
76  const QList<double> & world_x, const QList<double> & world_y,
77  const QList<int> &pixel_x, const QList<int> &pixel_y,
78  const QString & linecolor, const QString & text, const QString & font,
79  int fontsize, int fontstyle );
80  bool updateRegion( int id, viewer::region::RegionChanges changes,
81  const QList<double> & world_x, const QList<double> & world_y,
82  const QList<int> &pixel_x, const QList<int> &pixel_y );
83  void setOverlayColor(const QString& colorName);
84 
85  private slots:
86  void findSources();
87  void deleteSelectedSource();
88  void canceledFindSources();
89  void saveEstimateFile();
90  void directoryChanged(const QModelIndex& modelIndex );
91  void validateDirectory( const QString& str );
92  void cutoffModeChanged( bool noise );
93  void showPixelRange();
94  void pixelRangeChanged();
95  void viewerDisplayChanged();
96 
97  private:
98  FindSourcesDialog( const FindSourcesDialog& other );
100  void populatePixelBox();
101  //Written because when a fit of a residual image was being done, the region
102  //bounds were larger than the bounds in the residual image.
103  void populateImageBounds();
104 
105  void resetCurrentId( int suggestedId );
106  void resetSourceView();
107  void setSourceResultsVisible( bool visible );
108  void createTable();
110  void setTableValue(int row, int col, const casacore::String& val );
111  double populateCutOff(bool* valid) const;
112  casacore::Record makeRegion( bool * valid );
113  void resetSkyOverlay();
114  void clearSkyOverlay();
115  void clearRegions();
116  bool writeEstimateFile( QString& filePath,
117  bool screenEstimates = false, RegionBox* screeningBox = NULL );
118  QString getRemoveOverlayPath() const;
119 
123  };
124  std::shared_ptr<const casacore::ImageInterface<float> > image;
126  QString skyPath;
128  bool imageMode;
129  int channel;
132  QFileSystemModel* fileModel;
133  QMap< int, RegionBox*> regions;
134  const int DEFAULT_KEY;
135  const QString SKY_CATALOG;
140  Ui::FindSourcesDialogClass ui;
141  };
142 }
143 #endif // FIND_SOURCES_DIALOG_QO_H
void setOverlayColor(const QString &colorName)
FindSourcesDialog(QWidget *parent=0, bool displayModeFunctionality=true)
void directoryChanged(const QModelIndex &modelIndex)
static const QStringList colorNames
Displays a dialog that allows the user to find and edit a source list that can be used as estimates f...
QString getRegionString() const
FindSourcesDialog & operator=(const FindSourcesDialog &other)
QFileSystemModel * fileModel
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
casacore::String getPixelBox() const
casacore::Vector< int > trcVector
void removeOverlay(casacore::String path)
void validateDirectory(const QString &str)
void setSourceResultsVisible(bool visible)
Provides convenient accessors and functionality for a ComponentList.
void setTableValue(int row, int col, const casacore::String &val)
PixelRangeDialog pixelRangeDialog
ComponentListWrapper skyList
Ui::FindSourcesDialogClass ui
std::string path(const std::string &name)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
void showOverlay(casacore::String, const QString &)
QString getRemoveOverlayPath() const
bool newRegion(int id, 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)
void cutoffModeChanged(bool noise)
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 populateImageBounds()
Written because when a fit of a residual image was being done, the region bounds were larger than the...
void resetCurrentId(int suggestedId)
QMap< int, RegionBox * > regions
casacore::String getScreenedEstimatesFile(const casacore::String &estimatesFileName, bool *errorWritingFile)
Displays a histogram that allows the user to set a include/exclude pixel range for the fit...
ColorComboDelegate * colorDelegate
std::shared_ptr< const casacore::ImageInterface< float > > image
void estimateFileSpecified(const QString &fullPath)
bool updateRegion(int id, viewer::region::RegionChanges changes, const QList< double > &world_x, const QList< double > &world_y, const QList< int > &pixel_x, const QList< int > &pixel_y)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
bool writeEstimateFile(QString &filePath, bool screenEstimates=false, RegionBox *screeningBox=NULL)
void setChannel(int channel)
casacore::Record makeRegion(bool *valid)
double populateCutOff(bool *valid) const
QString getImagePixelBox() const
void setImage(std::shared_ptr< const casacore::ImageInterface< float > > image)
casacore::Vector< int > blcVector
void setImageMode(bool imageMode)