casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImagePadder.h
Go to the documentation of this file.
1 //# tSubImage.cc: Test program for class SubImage
2 //# Copyright (C) 1998,1999,2000,2001,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This program is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU General Public License as published by the Free
7 //# Software Foundation; either version 2 of the License, or (at your option)
8 //# any later version.
9 //#
10 //# This program is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 //# more details.
14 //#
15 //# You should have received a copy of the GNU General Public License along
16 //# with this program; if not, write to the Free Software Foundation, Inc.,
17 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: tSubImage.cc 20567 2009-04-09 23:12:39Z gervandiepen $
27 
28 #ifndef IMAGES_IMAGEPADDER_H
29 #define IMAGES_IMAGEPADDER_H
30 
32 
33 #include <casa/namespace.h>
34 
35 
36 namespace casacore{
37 
38 class MDirection;
39 }
40 
41 namespace casa {
42 
43 class ImagePadder : public ImageTask<casacore::Float> {
44  // <summary>
45  // Top level interface for padding an image in direction space.
46  // </summary>
47 
48  // <reviewed reviewer="" date="" tests="" demos="">
49  // </reviewed>
50 
51  // <prerequisite>
52  // </prerequisite>
53 
54  // <etymology>
55  // Collapses image.
56  // </etymology>
57 
58  // <synopsis>
59  // High level interface for padding an image.
60  // </synopsis>
61 
62  // <example>
63  // <srcblock>
64  // ImagePadder padder();
65  // padder.pad();
66  // </srcblock>
67  // </example>
68 
69 public:
70  // <group>
71 
73  const SPCIIF image,
74  const casacore::Record *const regionRec=0,
75  const casacore::String& box="", const casacore::String& chanInp="",
76  const casacore::String& stokes="", const casacore::String& maskInp="",
77  const casacore::String& outname="", const casacore::Bool overwrite=""
78  );
79 
80  // </group>
81 
82  // destructor
83  ~ImagePadder();
84 
85  // perform the padding. If <src>wantReturn</src> is true, return a pointer to the
86  // padded image. The returned pointer is created via new(); it is the caller's
87  // responsibility to delete the returned pointer. If <src>wantReturn</src> is false,
88  // a NULL pointer is returned and pointer deletion is performed internally.
89  SPIIF pad(const casacore::Bool wantReturn) const;
90 
91  // set the number of pixels to use for padding and their values and if they should be
92  // masked on each edge of the direction plane. <src>good</src>=true means the padding
93  // pixels will not be masked (set to good, mask values = true).
94  void setPaddingPixels(const casacore::uInt nPixels, const casacore::Double value=0, const casacore::Bool good=false);
95 
96  casacore::String getClass() const;
97 
98 protected:
101  }
102 
103  inline std::vector<casacore::Coordinate::Type> _getNecessaryCoordinates() const {
104  std::vector<casacore::Coordinate::Type> v;
105  v.push_back(casacore::Coordinate::DIRECTION);
106  return v;
107  }
108 
109 private:
113  static const casacore::String _class;
114 
115  // disallow default constructor
116  ImagePadder();
117 };
118 }
119 
120 #endif
A Measure: astronomical direction.
Definition: MDirection.h:174
casacore::Bool _good
Definition: ImagePadder.h:112
ImagePadder()
disallow default constructor
void setPaddingPixels(const casacore::uInt nPixels, const casacore::Double value=0, const casacore::Bool good=false)
set the number of pixels to use for padding and their values and if they should be masked on each edg...
casacore::uInt _nPixels
Definition: ImagePadder.h:110
casacore::String getClass() const
~ImagePadder()
destructor
double Double
Definition: aipstype.h:55
std::shared_ptr< const casacore::ImageInterface< casacore::Float > > SPCIIF
Definition: ImageTypedefs.h:50
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
SPIIF pad(const casacore::Bool wantReturn) const
perform the padding.
std::shared_ptr< casacore::ImageInterface< casacore::Float > > SPIIF
Definition: ImageTypedefs.h:51
CasacRegionManager::StokesControl _getStokesControl() const
Definition: ImagePadder.h:99
String: the storage and methods of handling collections of characters.
Definition: String.h:223
static const casacore::String _class
Definition: ImagePadder.h:113
casacore::Double _value
Definition: ImagePadder.h:111
std::vector< casacore::Coordinate::Type > _getNecessaryCoordinates() const
Represents the minimum set of coordinates necessary for the task to function.
Definition: ImagePadder.h:103
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42