casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageCollapser.h
Go to the documentation of this file.
1 #ifndef IMAGES_IMAGECOLLAPSER_H
2 #define IMAGES_IMAGECOLLAPSER_H
3 
5 
7 
8 #include <casa/namespace.h>
9 
10 namespace casacore{
11 
12 template <class T> class TempImage;
13 template <class T> class SubImage;
14 }
15 
16 namespace casa {
17 
18 
19 template <class T> class ImageCollapser : public ImageTask<T> {
20  // <summary>
21  // Top level interface which allows collapsing of images along a single axis. An aggregate method
22  // (average, sum, etc) is applied to the collapsed pixels.
23  // </summary>
24 
25  // <reviewed reviewer="" date="" tests="" demos="">
26  // </reviewed>
27 
28  // <prerequisite>
29  // </prerequisite>
30 
31  // <etymology>
32  // Collapses image.
33  // </etymology>
34 
35  // <synopsis>
36  // High level interface for collapsing an image along a single axis.
37  // </synopsis>
38 
39  // <example>
40  // <srcblock>
41  // ImageCollapser collapser(...);
42  // collapser.collapse();
43  // </srcblock>
44  // </example>
45 
46 public:
47 
48  // if <src>outname</src> is empty, no image will be written
49  // if <src>overwrite</src> is True, if image already exists it will be removed
50  // if <src>overwrite</src> is False, if image already exists exception will be thrown
51  //
52  // <group>
53 
55  const casacore::String& aggString, SPCIIT image,
56  const casacore::Record *const regionRec,
57  const casacore::String& maskInp, const casacore::IPosition& axes,
58  casacore::Bool invertAxesSelection,
59  const casacore::String& outname, casacore::Bool overwrite
60  );
61 
63  const SPCIIT image,
64  const casacore::IPosition& axes, casacore::Bool invertAxesSelection,
65  const ImageCollapserData::AggregateType aggregateType,
66  const casacore::String& outname, casacore::Bool overwrite
67  );
68  // </group>
69 
71 
72  // perform the collapse and return the resulting image.
73  SPIIT collapse() const;
74 
75  casacore::String getClass() const { const static casacore::String name = "ImageCollapser"; return name; }
76 
77 protected:
80  }
81 
82  inline std::vector<casacore::Coordinate::Type> _getNecessaryCoordinates() const {
83  return std::vector<casacore::Coordinate::Type>();
84  }
85 
87 
88 private:
92 
93  // disallow default constructor
95 
96  void _doFluxUnits(
98  const std::shared_ptr<const casacore::SubImage<T>> subImage
99  ) const;
100 
101  void _invert();
102 
103  void _finishConstruction();
104 
105  void _checkFlux(SPCIIT subImage) const;
106 
108  casacore::TempImage<T>& tmpIm, SPCIIT subImage
109  ) const;
110 
111  void _doLowPerf(
112  TempImage<T>& tmpIm, SPCIIT subImage, T npixPerBeam
113  ) const;
114 
115  // necessary to improve performance
116  void _doHighPerf(SPCIIT image, casacore::TempImage<T>& outImage) const;
117 
118  // returns true if miscellaneous info was copied
120  TempImage<T>& tmpIm, SPCIIT subImage, Bool hasDir,
121  const CoordinateSystem& outCoords
122  ) const;
123 
124  void _doOtherStats(TempImage<T>& tmpIm, SPCIIT subImage) const;
125 
127 
128  static void _zeroNegatives(casacore::Array<T>& arr);
129 
130 };
131 }
132 
133 #ifndef AIPS_NO_TEMPLATE_SRC
134 #include <imageanalysis/ImageAnalysis/ImageCollapser.tcc>
135 #endif //# AIPS_NO_TEMPLATE_SRC
136 
137 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
SPIIT collapse() const
perform the collapse and return the resulting image.
Temporary astronomical images.
AggregateType
Non-templated data related bits for ImageCollapser.
std::vector< casacore::Coordinate::Type > _getNecessaryCoordinates() const
Represents the minimum set of coordinates necessary for the task to function.
void _doFluxUnits(casacore::TempImage< T > &tmpIm, const std::shared_ptr< const casacore::SubImage< T >> subImage) const
CasacRegionManager::StokesControl _getStokesControl() const
casacore::String getClass() const
void _doLowPerf(TempImage< T > &tmpIm, SPCIIT subImage, T npixPerBeam) 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 _doHighPerf(SPCIIT image, casacore::TempImage< T > &outImage) const
necessary to improve performance
Bool _doMultipleBeams(TempImage< T > &tmpIm, SPCIIT subImage, Bool hasDir, const CoordinateSystem &outCoords) const
returns true if miscellaneous info was copied
ImageCollapser()
disallow default constructor
void _checkFlux(SPCIIT subImage) const
void _doOtherStats(TempImage< T > &tmpIm, SPCIIT subImage) const
#define SPIIT
Definition: ImageTypedefs.h:34
void _doDegenerateAxesCase(casacore::TempImage< T > &tmpIm, SPCIIT subImage) const
LatticeStatsBase::StatisticsTypes _getStatsType() const
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
StatisticsTypes
This enum StatisticTypes is provided for use with the LatticeStatistics&lt;T&gt;::setPlotting function...
A (masked) subset of an ImageInterface object.
#define SPCIIT
Definition: ImageTypedefs.h:35
template &lt;class T, class U&gt; class vector;
Definition: MSFlagger.h:37
casacore::Bool _invertAxesSelection
ImageCollapserData::AggregateType _aggType
static void _zeroNegatives(casacore::Array< T > &arr)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool _supportsMultipleRegions() const
casacore::IPosition _axes
Interconvert pixel and world coordinates.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42