casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageMomentsTask.h
Go to the documentation of this file.
1 #ifndef IMAGEANALYSIS_IMAGEMOMENTSTASK_H
2 #define IMAGEANALYSIS_IMAGEMOMENTSTASK_H
3 
5 
6 #include <casa/namespace.h>
7 
8 namespace casa {
9 
10 class ImageMomentsProgressMonitor;
11 
12 template <class T> class ImageMomentsTask : public ImageTask<T> {
13  // <summary>
14  // Top level interface for creating image moments
15  // </summary>
16 
17  // <reviewed reviewer="" date="" tests="" demos="">
18  // </reviewed>
19 
20  // <prerequisite>
21  // </prerequisite>
22 
23  // <etymology>
24  // Rebins an image to larger pixels.
25  // </etymology>
26 
27  // <synopsis>
28  // Top level interface for rebinning images.
29  // </synopsis>
30 
31 public:
32 
33  ImageMomentsTask() = delete;
34 
35  // overwrite only applies to the smooth image. The moment images should
36  // be removed if they exist.
38  const SPCIIT image, const casacore::Record *const region,
39  const casacore::String& mask, const casacore::String& smoothImageName,
40  casacore::Bool overwrite
41  );
42 
44 
45  casacore::String getClass() const { const static casacore::String s = "ImageMomentsTask"; return s; }
46 
47  // the first requested moments image is returned.
48  SPIIT makeMoments() const;
49 
50  // set moments axis number
51  void setAxis(casacore::Int axis);
52 
53  // set the include or exclude range. An empty vector means no range is set,
54  // a one element vector means -range[0] to range[0] is set. If the vector
55  // contains more than two elements, an exception is thrown. If isInclude is
56  // true, then the range is the range to be included, excluded if false.
57  void setIncludeExcludeRange(const std::vector<T>& range, casacore::Bool isInclude);
58 
59  // Set smoothing kernels
60  void setKernels(const std::vector<casacore::String>& kernels) { _kernels = kernels; }
61 
62  // set smoothing kernel widths
63  void setKernelWidths(const std::vector<casacore::Quantity>& kernelWidths) {
64  _kernelWidths = kernelWidths;
65  }
66 
67  // set moment methods
68  void setMethods(const std::vector<casacore::String>& methods) { _methods = methods; }
69 
70  // set moments to compute
71  void setMoments(const casacore::Vector<casacore::Int>& moments);
72 
74  _imageMomentsProgressMonitor = progressMonitor;
75  }
76 
77  // set the base name for the moment images.
79 
80  // Should the moment axis be removed. These rules will be followed:
81  // If the moment axis is associated with a coordinate with one axis only,
82  // the axis and its coordinate are physically removed from the output image. Otherwise,
83  // if <src>remove=true</src> then the output axis is logically removed from the
84  // the output CoordinateSystem. If <src>remove=false</src> then the axis
85  // is retained with shape=1 and with its original coordinate information (which
86  // is probably meaningless).
87  void setRemoveAxis(casacore::Bool remove) { _removeAxis = remove; }
88 
89  // set smoothing axes
90  void setSmoothAxes(const std::vector<casacore::uInt>& axes);
91 
92  // set desired signal-to-noise. Less than or equal to zero means
93  // use the default value.
94  void setSNR(casacore::Double snr) { _snr = snr; }
95 
96  // set desired standard deviation. Less than or equal to zero means
97  // set to 0.
99 
100  // set the velocity type.
102 
103 protected:
104 
107  }
108 
109  std::vector<casacore::Coordinate::Type> _getNecessaryCoordinates() const {
110  return std::vector<casacore::Coordinate::Type>();
111  }
112 
113  casacore::Bool _supportsMultipleBeams() const {return true;}
114 
116 
117 private:
120  std::vector<casacore::String> _methods, _kernels;
121  std::vector<casacore::uInt> _smoothAxes;
122  std::vector<casacore::Quantity> _kernelWidths;
123  std::vector<T> _range;
128 
129  void _deleteTempImage(const casacore::String& tmpImage) const;
130 
131 };
132 }
133 
134 #ifndef AIPS_NO_TEMPLATE_SRC
135 #include <imageanalysis/ImageAnalysis/ImageMomentsTask.tcc>
136 #endif
137 
138 #endif
void setMoments(const casacore::Vector< casacore::Int > &moments)
set moments to compute
casacore::Bool _isIncludeRange
CasacRegionManager::StokesControl _getStokesControl() const
int Int
Definition: aipstype.h:50
void setIncludeExcludeRange(const std::vector< T > &range, casacore::Bool isInclude)
set the include or exclude range.
std::vector< casacore::Coordinate::Type > _getNecessaryCoordinates() const
Represents the minimum set of coordinates necessary for the task to function.
void setMomentImageName(const casacore::String &name)
set the base name for the moment images.
SPIIT makeMoments() const
the first requested moments image is returned.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
void setKernels(const std::vector< casacore::String > &kernels)
Set smoothing kernels.
virtual Type type()
Return the type enum.
void setVelocityType(const casacore::String &type)
set the velocity type.
ImageMomentsTask()=delete
Top level interface for creating image moments.
void setMethods(const std::vector< casacore::String > &methods)
set moment methods
void _deleteTempImage(const casacore::String &tmpImage) const
void setRemoveAxis(casacore::Bool remove)
Should the moment axis be removed.
std::vector< casacore::String > _kernels
casacore::Vector< casacore::Int > _moments
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
std::vector< casacore::uInt > _smoothAxes
casacore::Bool _supportsMultipleBeams() const
does this task support images with multiple beams? false means it never does.
casacore::Bool _supportsMultipleRegions() const
casacore::String _velocityType
std::vector< casacore::Quantity > _kernelWidths
#define SPIIT
Definition: ImageTypedefs.h:34
double Double
Definition: aipstype.h:55
This is just an interface class for monitoring the progress of collapsing and image through calculati...
casacore::String _momentName
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
void setStdDev(casacore::Double stddev)
set desired standard deviation.
LatticeExprNode stddev(const LatticeExprNode &expr)
ImageMomentsProgressMonitor * _imageMomentsProgressMonitor
casacore::String getClass() const
#define SPCIIT
Definition: ImageTypedefs.h:35
std::vector< casacore::String > _methods
void setSmoothAxes(const std::vector< casacore::uInt > &axes)
set smoothing axes
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setMomentsProgressMonitor(ImageMomentsProgressMonitor *progressMonitor)
std::vector< T > _range
void setKernelWidths(const std::vector< casacore::Quantity > &kernelWidths)
set smoothing kernel widths
casacore::Double _stddev
void setSNR(casacore::Double snr)
set desired signal-to-noise.
casacore::Bool _removeAxis
void setAxis(casacore::Int axis)
set moments axis number