ImageRegridder.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef IMAGEANALYSIS_IMAGEREGRIDDER_H
00027 #define IMAGEANALYSIS_IMAGEREGRIDDER_H
00028
00029 #include <imageanalysis/ImageAnalysis/ImageRegridderBase.h>
00030
00031 #include <scimath/Mathematics/Interpolate2D.h>
00032 #include <casa/namespace.h>
00033
00034 namespace casa {
00035
00036 template <class T> class SubImage;
00037 template <class T> class TempImage;
00038
00039 class ImageRegridder : public ImageRegridderBase<Float> {
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 public:
00062
00063 ImageRegridder() = delete;
00064
00065
00066
00067
00068
00069
00070 ImageRegridder(
00071 const SPCIIF image,
00072 const Record *const regionRec,
00073 const String& maskInp, const String& outname, Bool overwrite,
00074 const CoordinateSystem& csysTo, const IPosition& axes,
00075 const IPosition& shape
00076 );
00077
00078
00079 ImageRegridder(
00080 const SPCIIF image, const String& outname,
00081 const SPCIIF templateIm, const IPosition& axes=IPosition(),
00082 const Record *const regionRec=0,
00083 const String& maskInp="", Bool overwrite=False,
00084 const IPosition& shape=IPosition()
00085 );
00086
00087
00088
00089 ~ImageRegridder();
00090
00091
00092 SPIIF regrid() const;
00093
00094 inline String getClass() const { return _class; }
00095
00096 void setDebug(Int debug) { _debug = debug; }
00097
00098 private:
00099 mutable SPIIF _subimage;
00100 Int _debug;
00101 static const String _class;
00102
00103 SPIIF _regrid() const;
00104
00105 SPIIF _regridByVelocity() const;
00106
00107 Bool _doImagesOverlap(
00108 SPCIIF image0,
00109 SPCIIF image1
00110 ) const;
00111
00112 static Vector<std::pair<Double, Double> > _getDirectionCorners(
00113 const DirectionCoordinate& dc,
00114 const IPosition& directionShape
00115 );
00116
00117 void _checkOutputShape(
00118 const SubImage<Float>& subImage,
00119 const std::set<Coordinate::Type>& coordsToRegrid
00120 ) const;
00121
00122 SPIIF _decimateStokes(SPIIF workIm) const;
00123
00124 static Bool _doRectanglesIntersect(
00125 const Vector<std::pair<Double, Double> >& corners0,
00126 const Vector<std::pair<Double, Double> >& corners1
00127 );
00128
00129 };
00130 }
00131
00132 #endif