ImageCollapser.h
Go to the documentation of this file.00001 #ifndef IMAGES_IMAGECOLLAPSER_H
00002 #define IMAGES_IMAGECOLLAPSER_H
00003
00004 #include <imageanalysis/ImageAnalysis/ImageTask.h>
00005
00006 #include <imageanalysis/ImageAnalysis/ImageCollapserData.h>
00007
00008 #include <casa/namespace.h>
00009
00010 namespace casa {
00011
00012 template <class T> class TempImage;
00013 template <class T> class SubImage;
00014
00015 template <class T> class ImageCollapser : public ImageTask<T> {
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 public:
00043
00044
00045
00046
00047
00048
00049
00050 ImageCollapser(
00051 const String& aggString, SPCIIT image,
00052 const Record *const regionRec,
00053 const String& maskInp, const IPosition& axes,
00054 Bool invertAxesSelection,
00055 const String& outname, Bool overwrite
00056 );
00057
00058 ImageCollapser(
00059 const SPCIIT image,
00060 const IPosition& axes, Bool invertAxesSelection,
00061 const ImageCollapserData::AggregateType aggregateType,
00062 const String& outname, Bool overwrite
00063 );
00064
00065
00066 ~ImageCollapser() {}
00067
00068
00069 SPIIT collapse() const;
00070
00071 static const map<uInt, T (*)(const Array<T>&)>* funcMap();
00072
00073 String getClass() const { const static String name = "ImageCollapser"; return name; }
00074
00075 protected:
00076 inline CasacRegionManager::StokesControl _getStokesControl() const {
00077 return CasacRegionManager::USE_ALL_STOKES;
00078 }
00079
00080 inline std::vector<Coordinate::Type> _getNecessaryCoordinates() const {
00081 return std::vector<Coordinate::Type>();
00082 }
00083
00084 Bool _supportsMultipleRegions() const {return True;}
00085
00086 private:
00087 Bool _invertAxesSelection;
00088 IPosition _axes;
00089 ImageCollapserData::AggregateType _aggType;
00090
00091 static map<uInt, T (*)(const Array<T>&)> _funcMap;
00092
00093
00094 ImageCollapser();
00095
00096 void _invert();
00097
00098 void _finishConstruction();
00099
00100
00101 void _doMedian(
00102 SPCIIT image,
00103 TempImage<T>& outImage
00104 ) const;
00105
00106 void _attachOutputMask(
00107 TempImage<T>& outImage,
00108 const Array<Bool>& outMask
00109 ) const;
00110
00111 static void _zeroNegatives(Array<T>& arr);
00112
00113 static const map<uInt, T (*)(const Array<T>&)>& _getFuncMap();
00114 };
00115 }
00116
00117 #ifndef AIPS_NO_TEMPLATE_SRC
00118 #include <imageanalysis/ImageAnalysis/ImageCollapser.tcc>
00119 #endif //# AIPS_NO_TEMPLATE_SRC
00120
00121 #endif