casacore
Loading...
Searching...
No Matches
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: casa-feedback@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#ifndef IMAGES_WCCOMPLEMENT_H
27#define IMAGES_WCCOMPLEMENT_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/images/Regions/WCCompound.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// <summary>
36// Make the complement of an image region.
37// </summary>
38
39// <use visibility=export>
40
41// <reviewed reviewer="" date="" tests="">
42// </reviewed>
43
44// <prerequisite>
45// <li> <linkto class=WCCompound>WCCompound</linkto>
46// </prerequisite>
47
48// <synopsis>
49// The WCComplement class is a specialization of class
50// <linkto class=WCCompound>WCCompound</linkto>.
51// It makes it possible to take the complement of the given region
52// (which can be a simple WCBox, but also a complex compound region).
53// Note that only world coordinate regions can be used in a compound,
54// thus an LCSlicer object is not allowed in an intersection.
55// <p>
56// Note that a region consists of all its masked-on pixels inside the
57// bounding box of the region. Thus the complement consists of all
58// pixels outside the bounding box and all masked-off pixels inside
59// the bounding box. So the complement of the complement of a region
60// is the region itself.
61// </synopsis>
62
63// <example>
64// <srcblock>
65// </srcblock>
66// </example>
67
68// # <todo asof="1997/11/11">
69// # <li>
70// # </todo>
71
72class WCComplement : public WCCompound {
73 public:
75
76 // Construct the complement of the given region.
77 WCComplement(const ImageRegion& region1);
78
79 // Copy constructor (copy semantics).
81
82 virtual ~WCComplement();
83
84 // Assignment (copy semantics).
86
87 // Comparison
88 virtual Bool operator==(const WCRegion& other) const;
89
90 // Make a copy of the derived object.
91 // cloneRegion needs to return a WCRegion * because the
92 // SGI compiler is smart enough to do the right thing.
93 virtual WCRegion* cloneRegion() const;
94
95 // Get the class name (to store in the record).
96 static String className();
97
98 // Get the region type. Returns className()
99 virtual String type() const;
100
101 // Convert the (derived) object to a record.
102 virtual TableRecord toRecord(const String& tableName) const;
103
104 // Convert correct object from a record.
105 static WCComplement* fromRecord(const TableRecord&, const String& tableName);
106
107 // Construct from multiple regions.
108 // When <src>takeOver</src> is True, the destructor will delete the
109 // given regions. Otherwise a copy of the regions is made.
111
112 protected:
113 // Convert to an LCRegion using the given coordinate system and shape.
114 // pixelAxesMap(i) gives the pixel axis in cSys of axes <src>i</src>
115 // in the axesDesc.
117 const IPosition& pixelAxesMap, const IPosition& outOrder) const;
118};
119
120} // namespace casacore
121
122#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
virtual WCRegion * cloneRegion() const
Make a copy of the derived object.
static String className()
Get the class name (to store in the record).
static WCComplement * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
virtual String type() const
Get the region type.
virtual Bool operator==(const WCRegion &other) const
Comparison.
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.
WCComplement(Bool takeOver, const Block< const WCRegion * > &regions)
Construct from multiple regions.
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
WCComplement & operator=(const WCComplement &other)
Assignment (copy semantics).
WCComplement(const WCComplement &other)
Copy constructor (copy semantics).
WCComplement(const ImageRegion &region1)
Construct the complement of the given region.
const Block< const WCRegion * > & regions() const
Get the contributing regions.
Definition WCCompound.h:141
WCCompound(const ImageRegion &region1, const ImageRegion &region2)
Construct from one or more image regions.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40