casacore
Loading...
Searching...
No Matches
WCUnion.h
Go to the documentation of this file.
1// # WCUnion.h: Make the union of 2 or more image regions
2// # Copyright (C) 1998
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_WCUNION_H
27#define IMAGES_WCUNION_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 union of 2 or more image regions.
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 WCUnion class is a specialization of class
50// <linkto class=WCCompound>WCCompound</linkto>.
51// It makes it possible to take the union of 2 or more image regions.
52// Note that only world coordinate regions can be used in a compound,
53// thus an LCSlicer object is not allowed in a union.
54// <p>
55// The union of regions is the collection of the pixels masked-on
56// in any region.
57// Note that the bounding box of a union is determined by the outermost
58// pixels. It means that if regions are very far apart, the bounding
59// box of the union is very large and therefore inefficient.
60// <p>
61// The regions in a union can have different axes and dimensionalities.
62// The axes and dimensionality of a union are determined by the
63// collection of all different axes in its regions. Each individual region
64// will be auto-extended along the axes not being part of the region.
65// E.g. one can define a WCBox with axis RA and another WCBox with
66// axis DEC. The union will be 2-dim with axes RA and DEC. The first
67// box will be auto-extended to cover the DEC axis, which results
68// in a 2-dim box with its DEC axis the length of the image's DEC axis.
69// Similarly the second box will be auto-extended to cover the RA axis.
70// </synopsis>
71
72// <example>
73// <srcblock>
74// </srcblock>
75// </example>
76
77// # <todo asof="1997/11/11">
78// # <li>
79// # </todo>
80
81class WCUnion : public WCCompound {
82 public:
83 // Construct the union of one or more image regions.
84 // The image regions have to contain WCRegion objects, otherwise an
85 // exception is thrown.
86 // <group>
87 WCUnion(const ImageRegion& region1, const ImageRegion& region2);
88 WCUnion(const ImageRegion* region1, const ImageRegion* region2 = 0,
89 const ImageRegion* region3 = 0, const ImageRegion* region4 = 0,
90 const ImageRegion* region5 = 0, const ImageRegion* region6 = 0,
91 const ImageRegion* region7 = 0, const ImageRegion* region8 = 0,
92 const ImageRegion* region9 = 0, const ImageRegion* region10 = 0);
94 // </group>
95
96 // Construct from multiple regions given as a Block.
97 // When <src>takeOver</src> is True, the destructor will delete the
98 // given regions. Otherwise a copy of the regions is made.
100
101 // Copy constructor (copy semantics).
102 WCUnion(const WCUnion& other);
103
104 virtual ~WCUnion();
105
106 // Assignment (copy semantics).
107 WCUnion& operator=(const WCUnion& other);
108
109 // Comparison
110 virtual Bool operator==(const WCRegion& other) const;
111
112 // Make a copy of the derived object.
113 virtual WCRegion* cloneRegion() const;
114
115 // Get the class name (to store in the record).
117
118 // Get the region type. Returns className()
119 virtual String type() const;
120
121 // Convert the (derived) object to a record.
122 virtual TableRecord toRecord(const String& tableName) const;
123
124 // Convert correct object from a record.
125 static WCUnion* fromRecord(const TableRecord&, const String& tableName);
126
127 protected:
128 // Convert to an LCRegion using the given coordinate system and shape.
129 // pixelAxesMap(i) gives the pixel axis in cSys of axes <src>i</src>
130 // in the axesDesc.
132 const IPosition& pixelAxesMap, const IPosition& outOrder) const;
133};
134
135} // namespace casacore
136
137#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
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.
WCUnion(const Block< const ImageRegion * > &regions)
WCUnion & operator=(const WCUnion &other)
Assignment (copy semantics).
virtual WCRegion * cloneRegion() const
Make a copy of the derived object.
virtual String type() const
Get the region type.
static WCUnion * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
static String className()
Get the class name (to store in the record).
WCUnion(const WCUnion &other)
Copy constructor (copy semantics).
WCUnion(const ImageRegion &region1, const ImageRegion &region2)
Construct the union of one or more image regions.
WCUnion(const ImageRegion *region1, const ImageRegion *region2=0, const ImageRegion *region3=0, const ImageRegion *region4=0, const ImageRegion *region5=0, const ImageRegion *region6=0, const ImageRegion *region7=0, const ImageRegion *region8=0, const ImageRegion *region9=0, const ImageRegion *region10=0)
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
virtual Bool operator==(const WCRegion &other) const
Comparison.
virtual ~WCUnion()
WCUnion(Bool takeOver, const Block< const WCRegion * > &regions)
Construct from multiple regions given as a Block.
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.
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