ImageMaskHandler.h

Go to the documentation of this file.
00001 #ifndef IMAGEANALYSIS_IMAGEMASKHANDLER_H
00002 #define IMAGEANALYSIS_IMAGEMASKHANDLER_H
00003 
00004 #include <casa/BasicSL/String.h>
00005 #include <casa/Arrays/Vector.h>
00006 
00007 #include <imageanalysis/ImageTypedefs.h>
00008 
00009 // #include <lattices/Lattices/LatticeExprNode.h>
00010 
00011 #include <set>
00012 
00013 namespace casa {
00014 
00015 class ImageRegion;
00016 class LatticeExprNode;
00017 template <class T> class  MaskedLattice;
00018 
00019 template <class T> class ImageMaskHandler {
00020 
00021     // <summary>
00022     // Perform various image mask operations
00023     // </summary>
00024 
00025     // <reviewed reviewer="" date="" tests="" demos="">
00026     // </reviewed>
00027 
00028     // <prerequisite>
00029     // </prerequisite>
00030 
00031     // <etymology>
00032     // </etymology>
00033 
00034     // <synopsis>
00035     // </synopsis>
00036 
00037 public:
00038         ImageMaskHandler(SPIIT);
00039 
00040     ~ImageMaskHandler();
00041 
00042     // set default mask. Empty string means unset default mask.
00043     void set(const String& name);
00044 
00045     // return the default mask name
00046     String defaultMask() const;
00047 
00048     // delete specified masks
00049     void deleteMasks(const std::set<String>& masks);
00050 
00051     // rename a mask
00052     void rename(const String& oldName, const String& newName);
00053 
00054     // get all mask names
00055     Vector<String> get() const;
00056 
00057     // copy mask
00058     void copy(const String& currentName, const String& newName);
00059 
00060     void calcmask(
00061         const String& mask, Record& regions,
00062                 const String& name, Bool asdefault=True
00063     );
00064 
00065     // copy the mask from the specified lattice to the image's (default) mask. The mask
00066     // and the image must have the same shape.
00067     template <class U> void copy(const MaskedLattice<U>& mask);
00068 
00069 private:
00070     const SPIIT _image;
00071 
00072     void _calcmask(
00073         const LatticeExprNode& node,
00074                 const String& name, const Bool makedefault
00075     );
00076 
00077     // Make a block of regions from a Record
00078     static void _makeRegionBlock(
00079         PtrBlock<const ImageRegion*>& regions,
00080         const Record& Regions
00081     );
00082 };
00083 
00084 }
00085 
00086 #ifndef AIPS_NO_TEMPLATE_SRC
00087 #include <imageanalysis/ImageAnalysis/ImageMaskHandler.tcc>
00088 #endif
00089 
00090 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1