casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WCComplement.h
Go to the documentation of this file.
1 //# WCComplement.h: Make the complement of an image region
2 //# Copyright (C) 1998,2004
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library 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 Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 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$
27 
28 #ifndef IMAGES_WCCOMPLEMENT_H
29 #define IMAGES_WCCOMPLEMENT_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
34 
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 // <summary>
39 // Make the complement of an image region.
40 // </summary>
41 
42 // <use visibility=export>
43 
44 // <reviewed reviewer="" date="" tests="">
45 // </reviewed>
46 
47 // <prerequisite>
48 // <li> <linkto class=WCCompound>WCCompound</linkto>
49 // </prerequisite>
50 
51 // <synopsis>
52 // The WCComplement class is a specialization of class
53 // <linkto class=WCCompound>WCCompound</linkto>.
54 // It makes it possible to take the complement of the given region
55 // (which can be a simple WCBox, but also a complex compound region).
56 // Note that only world coordinate regions can be used in a compound,
57 // thus an LCSlicer object is not allowed in an intersection.
58 // <p>
59 // Note that a region consists of all its masked-on pixels inside the
60 // bounding box of the region. Thus the complement consists of all
61 // pixels outside the bounding box and all masked-off pixels inside
62 // the bounding box. So the complement of the complement of a region
63 // is the region itself.
64 // </synopsis>
65 
66 // <example>
67 // <srcblock>
68 // </srcblock>
69 // </example>
70 
71 //# <todo asof="1997/11/11">
72 //# <li>
73 //# </todo>
74 
75 
76 class WCComplement: public WCCompound
77 {
78 public:
79  WCComplement();
80 
81  // Construct the complement of the given region.
82  WCComplement (const ImageRegion& region1);
83 
84  // Copy constructor (copy semantics).
85  WCComplement (const WCComplement& other);
86 
87  virtual ~WCComplement();
88 
89  // Assignment (copy semantics).
90  WCComplement& operator= (const WCComplement& other);
91 
92  // Comparison
93  virtual Bool operator== (const WCRegion& other) const;
94 
95  // Make a copy of the derived object.
96  // cloneRegion needs to return a WCRegion * because the
97  // SGI compiler is smart enough to do the right thing.
98  virtual WCRegion* cloneRegion() const;
99 
100  // Get the class name (to store in the record).
101  static String className();
102 
103  // Get the region type. Returns className()
104  virtual String type() const;
105 
106  // Convert the (derived) object to a record.
107  virtual TableRecord toRecord (const String& tableName) const;
108 
109  // Convert correct object from a record.
110  static WCComplement* fromRecord (const TableRecord&,
111  const String& tableName);
112 
113  // Construct from multiple regions.
114  // When <src>takeOver</src> is True, the destructor will delete the
115  // given regions. Otherwise a copy of the regions is made.
116  WCComplement (Bool takeOver,
118 
119 protected:
120  // Convert to an LCRegion using the given coordinate system and shape.
121  // pixelAxesMap(i) gives the pixel axis in cSys of axes <src>i</src>
122  // in the axesDesc.
123  virtual LCRegion* doToLCRegion (const CoordinateSystem& cSys,
124  const IPosition& shape,
125  const IPosition& pixelAxesMap,
126  const IPosition& outOrder) const;
127 };
128 
129 
130 
131 } //# NAMESPACE CASACORE - END
132 
133 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:118
WCComplement & operator=(const WCComplement &other)
Assignment (copy semantics).
Make the complement of an image region.
Definition: WCComplement.h:76
static WCComplement * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
virtual LCRegion * doToLCRegion(const CoordinateSystem &cSys, const IPosition &shape, const IPosition &pixelAxesMap, const IPosition &outOrder) const
Convert to an LCRegion using the given coordinate system and shape.
const PtrBlock< const WCRegion * > & regions() const
Get the contributing regions.
Definition: WCCompound.h:156
virtual String type() const
Get the region type.
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
Base class for compound WCRegion objects.
Definition: WCCompound.h:84
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
A drop-in replacement for Block&lt;T*&gt;.
Definition: Block.h:814
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1987
A hierarchical collection of named fields of various types.
Definition: TableRecord.h:185
Class to hold a region of interest in an image.
Definition: ImageRegion.h:86
virtual Bool operator==(const WCRegion &other) const
Comparison.
static String className()
Get the class name (to store in the record).
Base class to define world coordinate regions of interest in an image.
Definition: WCRegion.h:95
String: the storage and methods of handling collections of characters.
Definition: String.h:225
virtual WCRegion * cloneRegion() const
Make a copy of the derived object.
Interconvert pixel and world coordinates.
Abstract base class to define a region of interest in lattice coordinates.
Definition: LCRegion.h:87