casacore
Loading...
Searching...
No Matches
WCIntersection.h
Go to the documentation of this file.
1//# WCIntersection.h: Make the intersection 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_WCINTERSECTION_H
27#define IMAGES_WCINTERSECTION_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/images/Regions/WCCompound.h>
32
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Make the intersection of 2 or more image regions.
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="" date="" tests="">
43// </reviewed>
44
45// <prerequisite>
46// <li> <linkto class=WCCompound>WCCompound</linkto>
47// </prerequisite>
48
49// <synopsis>
50// The WCIntersection class is a specialization of class
51// <linkto class=WCCompound>WCCompound</linkto>.
52// It makes it possible to take the intersection of 2 or more image regions.
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// The intersection of regions is the collection of the pixels
57// masked-on in all regions.
58// <p>
59// The regions in a intersection can have different axes and dimensionalities.
60// The axes and dimensionality of a intersection are determined by the
61// collection of all different axes in its regions. Each individual region
62// will be auto-extended along the axes not being part of the region.
63// E.g. one can define a WCBox with axis RA and another WCBox with
64// axis DEC. The intersection will be 2-dim with axes RA and DEC. The first
65// box will be auto-extended to cover the DEC axis, which results
66// in a 2-dim box with its DEC axis the length of the image's DEC axis.
67// Similarly the second box will be auto-extended to cover the RA axis.
68// </synopsis>
69
70// <example>
71// <srcblock>
72// </srcblock>
73// </example>
74
75//# <todo asof="1997/11/11">
76//# <li>
77//# </todo>
78
79
81{
82public:
83 // Construct the intersection of one or more image regions.
84 // The image regions have to contain WCRegion objects, otherwise an
85 // exception is thrown.
86 // <group>
87 WCIntersection (const ImageRegion& region1, const ImageRegion& region2);
88 WCIntersection (const ImageRegion* region1,
89 const ImageRegion* region2 = 0,
90 const ImageRegion* region3 = 0,
91 const ImageRegion* region4 = 0,
92 const ImageRegion* region5 = 0,
93 const ImageRegion* region6 = 0,
94 const ImageRegion* region7 = 0,
95 const ImageRegion* region8 = 0,
96 const ImageRegion* region9 = 0,
97 const ImageRegion* region10 = 0);
99 // </group>
100
101 // Construct from multiple regions given as a Block.
102 // When <src>takeOver</src> is True, the destructor will delete the
103 // given regions. Otherwise a copy of the regions is made.
105
106 // Copy constructor (copy semantics).
108
110
111 // Assignment (copy semantics).
113
114 // Comparison
115 virtual Bool operator== (const WCRegion& other) const;
116
117 // Make a copy of the derived object.
118 virtual WCRegion* cloneRegion() const;
119
120 // Get the class name (to store in the record).
122
123 // Get the region type. Returns className()
124 virtual String type() const;
125
126 // Convert the (derived) object to a record.
127 virtual TableRecord toRecord (const String& tableName) const;
128
129 // Convert correct object from a record.
131 const String& tableName);
132
133protected:
134 // Convert to an LCRegion using the given coordinate system and shape.
135 // pixelAxesMap(i) gives the pixel axis in cSys of axes <src>i</src>
136 // in the axesDesc.
138 const IPosition& shape,
139 const IPosition& pixelAxesMap,
140 const IPosition& outOrder) const;
141};
142
143
144
145} //# NAMESPACE CASACORE - END
146
147#endif
A drop-in replacement for Block<T*>.
Definition Block.h:812
String: the storage and methods of handling collections of characters.
Definition String.h:223
const PtrBlock< const WCRegion * > & regions() const
Get the contributing regions.
Definition WCCompound.h:154
WCIntersection & operator=(const WCIntersection &other)
Assignment (copy semantics).
WCIntersection(const WCIntersection &other)
Copy constructor (copy semantics).
WCIntersection(const ImageRegion &region1, const ImageRegion &region2)
Construct the intersection of one or more image regions.
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
WCIntersection(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)
static String className()
Get the class name (to store in the record).
virtual WCRegion * cloneRegion() const
Make a copy of the derived object.
virtual Bool operator==(const WCRegion &other) const
Comparison.
WCIntersection(const PtrBlock< const ImageRegion * > &regions)
virtual String type() const
Get the region type.
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.
static WCIntersection * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
WCIntersection(Bool takeOver, const PtrBlock< const WCRegion * > &regions)
Construct from multiple regions given as a Block.
this file contains all the compiler specific defines
Definition mainpage.dox:28
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
Definition ExprNode.h:1991
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40