casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ImagePadder.h
Go to the documentation of this file.
00001 //# tSubImage.cc: Test program for class SubImage
00002 //# Copyright (C) 1998,1999,2000,2001,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This program is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU General Public License as published by the Free
00007 //# Software Foundation; either version 2 of the License, or (at your option)
00008 //# any later version.
00009 //#
00010 //# This program is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00013 //# more details.
00014 //#
00015 //# You should have received a copy of the GNU General Public License along
00016 //# with this program; if not, write to the Free Software Foundation, Inc.,
00017 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: tSubImage.cc 20567 2009-04-09 23:12:39Z gervandiepen $
00027 
00028 #ifndef IMAGES_IMAGEPADDER_H
00029 #define IMAGES_IMAGEPADDER_H
00030 
00031 #include <imageanalysis/ImageAnalysis/ImageTask.h>
00032 
00033 #include <casa/namespace.h>
00034 
00035 class MDirection;
00036 
00037 namespace casa {
00038 
00039 class ImagePadder : public ImageTask {
00040         // <summary>
00041         // Top level interface for padding an image in direction space.
00042         // </summary>
00043 
00044         // <reviewed reviewer="" date="" tests="" demos="">
00045         // </reviewed>
00046 
00047         // <prerequisite>
00048         // </prerequisite>
00049 
00050         // <etymology>
00051         // Collapses image.
00052         // </etymology>
00053 
00054         // <synopsis>
00055         // High level interface for padding an image.
00056         // </synopsis>
00057 
00058         // <example>
00059         // <srcblock>
00060         // ImagePadder padder();
00061         // padder.pad();
00062         // </srcblock>
00063         // </example>
00064 
00065 public:
00066         // <group>
00067 
00068         ImagePadder(
00069                 const ImageInterface<Float> *const image,
00070                 const Record *const regionRec=0,
00071                 const String& box="", const String& chanInp="",
00072                 const String& stokes="", const String& maskInp="",
00073                 const String& outname="", const Bool overwrite=""
00074         );
00075 
00076         // </group>
00077 
00078         // destructor
00079         ~ImagePadder();
00080 
00081         // perform the padding. If <src>wantReturn</src> is True, return a pointer to the
00082         // padded image. The returned pointer is created via new(); it is the caller's
00083         // responsibility to delete the returned pointer. If <src>wantReturn</src> is False,
00084         // a NULL pointer is returned and pointer deletion is performed internally.
00085         ImageInterface<Float>* pad(const Bool wantReturn) const;
00086 
00087         // set the number of pixels to use for padding and their values and if they should be
00088         // masked on each edge of the direction plane. <src>good</src>=True means the padding
00089         // pixels will not be masked (set to good, mask values = True).
00090         void setPaddingPixels(const uInt nPixels, const Double value=0, const Bool good=False);
00091 
00092         String getClass() const;
00093 
00094 protected:
00095         inline  CasacRegionManager::StokesControl _getStokesControl() const {
00096                 return CasacRegionManager::USE_ALL_STOKES;
00097         }
00098 
00099         inline vector<Coordinate::Type> _getNecessaryCoordinates() const {
00100                 vector<Coordinate::Type> v;
00101                 v.push_back(Coordinate::DIRECTION);
00102                 return v;
00103         }
00104 
00105 private:
00106         uInt _nPixels;
00107         Double _value;
00108         Bool _good;
00109         static const String _class;
00110 
00111         // disallow default constructor
00112         ImagePadder();
00113 };
00114 }
00115 
00116 #endif