casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageCropper.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 IMAGEANALYSIS_IMAGECROPPER_H
29 #define IMAGEANALYSIS_IMAGECROPPER_H
30 
32 #include <casa/namespace.h>
33 
34 namespace casa {
35 
36 template <class T> class ImageCropper : public ImageTask<T> {
37  // <summary>
38  // Top level interface for cropping masked edges of an image
39  // </summary>
40 
41  // <reviewed reviewer="" date="" tests="" demos="">
42  // </reviewed>
43 
44  // <prerequisite>
45  // </prerequisite>
46 
47  // <etymology>
48  // Crop an image
49  // </etymology>
50 
51  // <synopsis>
52  // High level interface for cropping images.
53  // </synopsis>
54 
55  // <example>
56  // <srcblock>
57  // ImageCropper cropper();
58  // cropper.crop();
59  // </srcblock>
60  // </example>
61 
62 public:
63 
64  // At most one of <src>regionRec</src>
65  // or <src>box/chanInp/stokes</src> should be supplied. If specifying <src>regionRec</src> that should
66  // be a non-null pointer and box, chanInp and stokes should all be empty strings. If specifying either or
67  // both of chanInp and/or stokes, the one(s) being specified should be non-empty strings corresponding
68  // to correct syntax for that particular parameter, and regionRec should be null.
69  // If you specify <src>regionRec</src>=0
70  // and <src>box</src>="", <src>stokes</src>="", and <src>chanInp</src>="", that implies you want to use all
71  // of the input image.
73  const std::shared_ptr<const casacore::ImageInterface<T> > image,
74  const casacore::Record *const &regionRec, const casacore::String& box, const casacore::String& chanInp,
75  const casacore::String& stokes, const casacore::String& maskInp,
76  const casacore::String& outname, const casacore::Bool overwrite
77  );
78 
79  // destructor
80  ~ImageCropper();
81 
82  // Perform the cropping. If <src>wantReturn</src> is true, a shared_ptr which
83  // wraps the cropped image is returned. If false, an empty shared_ptr is returned.
84  std::shared_ptr<casacore::ImageInterface<T> > crop(const casacore::Bool wantReturn) const;
85 
86  // Set the axes along which to do the cropping. An empty set means
87  // crop all axes.
88  void setAxes(const std::set<casacore::uInt>& axes);
89 
90  casacore::String getClass() const;
91 
92 protected:
95  }
96 
97  inline std::vector<casacore::Coordinate::Type> _getNecessaryCoordinates() const {
98  return std::vector<casacore::Coordinate::Type>(0);
99  }
100 
101 private:
102  std::set<casacore::uInt> _axes;
103  static const casacore::String _class;
104 
105 
106  // disallow default constructor
107  ImageCropper();
108 
109 };
110 }
111 
112 #ifndef AIPS_NO_TEMPLATE_SRC
113 #include <imageanalysis/ImageAnalysis/ImageCropper.tcc>
114 #endif //# AIPS_NO_TEMPLATE_SRC
115 
116 #endif
ImageCropper()
disallow default constructor
std::set< casacore::uInt > _axes
Definition: ImageCropper.h:102
CasacRegionManager::StokesControl _getStokesControl() const
Definition: ImageCropper.h:93
A base class for astronomical images.
casacore::String getClass() const
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
std::shared_ptr< casacore::ImageInterface< T > > crop(const casacore::Bool wantReturn) const
Perform the cropping.
~ImageCropper()
destructor
static const casacore::String _class
Definition: ImageCropper.h:103
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setAxes(const std::set< casacore::uInt > &axes)
Set the axes along which to do the cropping.
std::vector< casacore::Coordinate::Type > _getNecessaryCoordinates() const
Represents the minimum set of coordinates necessary for the task to function.
Definition: ImageCropper.h:97