casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageMaskedPixelReplacer.h
Go to the documentation of this file.
1 #ifndef IMAGEANALYSIS_IMAGEMASKEDPIXELREPLACER_H
2 #define IMAGEANALYSIS_IMAGEMASKEDPIXELREPLACER_H
3 
5 #include <casa/namespace.h>
6 
7 namespace casa {
8 
9 template <class T> class ImageMaskedPixelReplacer : public ImageTask<T> {
10  // <summary>
11  // Top level interface for replacing masked pixel values of an image
12  // </summary>
13 
14  // <reviewed reviewer="" date="" tests="" demos="">
15  // </reviewed>
16 
17  // <prerequisite>
18  // </prerequisite>
19 
20  // <etymology>
21  // Replace masked pixel values of an image
22  // </etymology>
23 
24  // <synopsis>
25  // Top level interface for replacing masked pixel values of an image
26  // </synopsis>
27 
28 public:
29 
30  ImageMaskedPixelReplacer() = delete;
31 
32  // The total pixel mask is calculated by a logical OR of the existing default
33  // image pixel mask when the mask specified by <src>mask</src>. Pixel replacement
34  // is done in place; ie on the image passed to the constructor. No copy of that image
35  // is made.
37  const SPIIT image,
38  const casacore::Record *const &region = nullptr,
39  const casacore::String& maskInp = ""
40  );
41 
43 
44  // Perform the substitution. expr is the LEL expression to use for the new pixel values.
45  // If updateMask is true, the false mask values will be changed to true.
46  void replace(const casacore::String& expr, casacore::Bool updateMask, casacore::Bool verbose);
47 
48  casacore::String getClass() const;
49 
50 protected:
53  }
54 
55  inline std::vector<casacore::Coordinate::Type> _getNecessaryCoordinates() const {
56  return std::vector<casacore::Coordinate::Type>(0);
57  }
58 
59 private:
60  static const casacore::String _class;
61 
62  // This class holds a writable image object to write pixel value
63  // changes to.
64  const SPIIT _image;
65 
66  static void _makeRegionBlock(
68  const casacore::Record& regions
69  );
70 };
71 }
72 
73 #ifndef AIPS_NO_TEMPLATE_SRC
74 #include <imageanalysis/ImageAnalysis/ImageMaskedPixelReplacer.tcc>
75 #endif
76 
77 #endif
casacore::String getClass() const
std::vector< casacore::Coordinate::Type > _getNecessaryCoordinates() const
Represents the minimum set of coordinates necessary for the task to function.
const SPIIT _image
This class holds a writable image object to write pixel value changes to.
static const casacore::String _class
CasacRegionManager::StokesControl _getStokesControl() const
static void _makeRegionBlock(casacore::PtrBlock< const casacore::ImageRegion * > &imageRegions, const casacore::Record &regions)
#define SPIIT
Definition: ImageTypedefs.h:34
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
A drop-in replacement for Block&lt;T*&gt;.
Definition: WProjectFT.h:54
void replace(const casacore::String &expr, casacore::Bool updateMask, casacore::Bool verbose)
Perform the substitution.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
ImageMaskedPixelReplacer()=delete
Top level interface for replacing masked pixel values of an image.