ImageExprCalculator.h

Go to the documentation of this file.
00001 #ifndef IMAGEANALYSIS_IMAGEEXPRCALCULATOR_H
00002 #define IMAGEANALYSIS_IMAGEEXPRCALCULATOR_H
00003 
00004 #include <casa/namespace.h>
00005 
00006 namespace casa {
00007 
00008 class String;
00009 
00010 template <class T> class ImageExprCalculator {
00011         // <summary>
00012         // Top level interface for computing the results of an image expression
00013         // </summary>
00014 
00015         // <reviewed reviewer="" date="" tests="" demos="">
00016         // </reviewed>
00017 
00018         // <prerequisite>
00019         // </prerequisite>
00020 
00021         // <etymology>
00022         // </etymology>
00023 
00024         // <synopsis>
00025         // </synopsis>
00026 
00027 public:
00028 
00029     ImageExprCalculator() = delete;
00030 
00031     // expression is the lattice expression to compute
00032         ImageExprCalculator(
00033                 const String& expression, const String& outname, Bool overwrite
00034         );
00035 
00036         ~ImageExprCalculator() {}
00037 
00038         // the image from which to copy metadata, including the coordinate system,
00039         // imageInfo() and miscInfo()
00040         void setCopyMetaDataFromImage(const String& name) { _copyMetaDataFromImage = name; }
00041 
00042         String getClass() const { const static String s = "ImageExprCalculator"; return s; }
00043 
00044         // Compute the expression and return the image.
00045         SPIIT compute() const;
00046 
00047 
00048         // modify image in place
00049     static void compute2(SPIIT image, const String& expr, Bool verbose);
00050 
00051 private:
00052     String _copyMetaDataFromImage = "";
00053     String _expr, _outname;
00054     Bool _overwrite;
00055     mutable LogIO _log;
00056 
00057     SPIIT _imagecalc(
00058         const LatticeExprNode& node, const IPosition& shape,
00059         const CoordinateSystem& csys, const LELImageCoord* const imCoord
00060     ) const;
00061 
00062     static void _makeRegionBlock(
00063         PtrBlock<const ImageRegion*>& regions,
00064         const Record& Regions
00065     );
00066 
00067     void _checkImages() const;
00068 
00069     static void _calc(SPIIT image, const LatticeExprNode& node);
00070 };
00071 }
00072 
00073 #ifndef AIPS_NO_TEMPLATE_SRC
00074 #include <imageanalysis/ImageAnalysis/ImageExprCalculator.tcc>
00075 #endif
00076 
00077 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1