00001 //# Copyright (C) 2005 00002 //# Associated Universities, Inc. Washington DC, USA. 00003 //# 00004 //# This library is free software; you can redistribute it and/or modify it 00005 //# under the terms of the GNU Library General Public License as published by 00006 //# the Free Software Foundation; either version 2 of the License, or (at your 00007 //# option) any later version. 00008 //# 00009 //# This library is distributed in the hope that it will be useful, but WITHOUT 00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 //# License for more details. 00013 //# 00014 //# You should have received a copy of the GNU Library General Public License 00015 //# along with this library; if not, write to the Free Software Foundation, 00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00017 //# 00018 //# Correspondence concerning AIPS++ should be addressed as follows: 00019 //# Internet email: aips2-request@nrao.edu. 00020 //# Postal address: AIPS++ Project Office 00021 //# National Radio Astronomy Observatory 00022 //# 520 Edgemont Road 00023 //# Charlottesville, VA 22903-2475 USA 00024 //# 00025 00026 00027 #ifndef FEATHERMANAGER_H_ 00028 #define FEATHERMANAGER_H_ 00029 #include <synthesis/MeasurementEquations/Feather.h> 00030 #include <guitools/Feather/FeatheredData.h> 00031 #include <guitools/Feather/FeatherThread.h> 00032 #include <QObject> 00033 namespace casa { 00034 00035 //FeatherWorker1 (SD, INT) 00036 //- SD //getFTCutSDImage 00037 //- SD weighted and scaled //getFeatheredCutSD 00038 //- INT //getFTCutIntImage 00039 //- INT weighted and scaled //getFeatheredCutInt 00040 00041 //FeatherWorker2 (SD, DIRTY) 00042 // - DIRTY //getFtCutIntImage 00043 // - DIRTY, weighted and scaled //getFeatheredCutInt 00044 00045 //FeatherWorker3 ( SD convolved with Int synthesized beam, INT ) 00046 //- SD convolved with INT synthesized beam //getFTCutSDImage 00047 //- SD convolved with INT synthesized beam; weighted and scaled //getFeatheredCutSD 00048 00049 //FeatherWorker4 ( SD convolved with DIRTY beam, DIRTY ) 00050 //- SD convolved with DIRTY beam //getFTCutSDImage 00051 //- SD convolved with DIRTY beam, weighted and scaled //getFeatheredCutSD 00052 00053 //FeatherWorker5 ( SD, INT Convolved with SD resolution (beam) ) 00054 //- INT convolved with SD resolution (beam) //getFTCutIntImage 00055 //- INT convolved with SD resolution (beam), weighted and scaled //getFeatheredCutInt 00056 00057 //FeatherWorker6 (SD, DIRTY ) 00058 //- DIRTY (or other image) //getFTCutIntImage 00059 //- DIRTY (or other image), weighted and scaled //getFeatheredCutInt 00060 00061 //FeatherWorker7( SD, DIRTY Convolved with SD resolution (beam) ) 00062 //- DIRTY convolved with SD resolution (beam) //getFTCutIntImage 00063 //- DIRTY convolved with SD resolution (beam), weighted and scaled //getFeatheredCutInt 00064 00065 00066 00067 template <class T> class ImageInterface; 00068 class LogIO; 00069 00075 class FeatherManager : public QObject { 00076 Q_OBJECT 00077 public: 00078 FeatherManager(); 00079 bool isReady() const ; 00080 bool isSuccess() const; 00081 bool loadImages( const QString& lowImagePath, const QString& highImagePath, LogIO* logger ); 00082 bool loadDirtyImage( const QString& dirtyImagePath); 00083 void applyFeather( bool saveOutput, const QString& outputImagePath ); 00084 void getEffectiveDishDiameter( Float& xDiam, Float& yDiam ); 00085 bool setEffectiveDishDiameter( float xDiam, float yDiam ); 00086 void setSDScale( float scale ); 00087 void setRadial( bool radialPlot ); 00088 void setChannelsAveraged( bool averaged ); 00089 void setChannelIndex( int index ); 00090 bool isRadial() const; 00091 int getPlaneCount() const; 00092 int getChannelIndex() const; 00093 QString getError() const; 00094 bool isFileSaved() const; 00095 bool isChannelsAveraged() const; 00096 00097 //Data 00098 FeatheredData getSDOrig(); 00099 FeatheredData getIntOrig(); 00100 FeatheredData getDirtyOrig(); 00101 00102 FeatheredData getSDWeight() const; 00103 FeatheredData getIntWeight() const; 00104 00105 FeatheredData getSDCut() const; 00106 FeatheredData getIntCut() const; 00107 FeatheredData getDirtyCut() const; 00108 00109 FeatheredData getIntConvolvedSDOrig(); 00110 FeatheredData getIntConvolvedSDCut() const; 00111 FeatheredData getDirtyConvolvedSDOrig(); 00112 FeatheredData getDirtyConvolvedSDCut() const; 00113 00114 FeatheredData getSDConvolvedIntOrig(); 00115 FeatheredData getSDConvolvedIntCut() const; 00116 //FeatheredData getSDConvolvedDirtyOrig(); 00117 //FeatheredData getSDConvolvedDirtyCut() const; 00118 virtual ~FeatherManager(); 00119 signals: 00120 void featheringDone(); 00121 private slots: 00122 void featherDone(); 00123 private: 00124 FeatherManager( const FeatherManager& other ); 00125 FeatherManager operator=( const FeatherManager& other ); 00126 FeatheredData getConvolvedOrig( ImageInterface<float>* image ) const; 00127 bool generateInputImage( QString highResImagePath, QString lowResImagePath); 00128 bool generateDirtyImage( QString dirtyImagePath); 00129 int getPlaneCount( ImageInterface<float>* image ) const; 00130 ImageInterface<Float>* getSinglePlaneImage( ImageInterface<float>* image ) const; 00131 void resetBasicFeedImages(); 00132 void resetDirtyFeedImage(); 00133 ImageInterface<Float>* lowResImage; 00134 ImageInterface<Float>* highResImage; 00135 ImageInterface<Float>* dirtyImage; 00136 ImageInterface<Float>* highResFeedImage; 00137 ImageInterface<Float>* dirtyFeedImage; 00138 ImageInterface<Float>* lowResFeedImage; 00139 Feather* featherWorker; 00140 FeatherThread* thread; 00141 QString errorMessage; 00142 LogIO* logger; 00143 bool radialAxis; 00144 bool channelsAveraged; 00145 bool success; 00146 int channelIndex; 00147 }; 00148 00149 } /* namespace casa */ 00150 #endif /* FEATHERMANAGER_H_ */