casacore
Loading...
Searching...
No Matches
WCExtension.h
Go to the documentation of this file.
1// # WCExtension.h: Make the extension an image region
2// # Copyright (C) 1998,2001
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_WCEXTENSION_H
27#define IMAGES_WCEXTENSION_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/images/Regions/WCCompound.h>
32#include <casacore/casa/Arrays/IPosition.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// # Forward declarations
37class WCBox;
38
39// <summary>
40// Make the extension of an image region.
41// </summary>
42
43// <use visibility=export>
44
45// <reviewed reviewer="" date="" tests="">
46// </reviewed>
47
48// <prerequisite>
49// <li> <linkto class=WCCompound>WCCompound</linkto>
50// </prerequisite>
51
52// <synopsis>
53// The WCExtension class is a specialization of class
54// <linkto class=WCCompound>WCCompound</linkto>.
55// It makes it possible to extend a region along straight lines to
56// other dimensions. It is also possible to extend existing axes with
57// length 1, i.e. to stretch such axes.
58// E.g. a circle in the RA,DEC plane can be extended to
59// a cylinder in a RA,DEC,FREQ cube. It is possible to extend over
60// more than one dimension. One can also limit the extension range
61// E.g. in the forementioned example the circle can be extended
62// for a given range of frequencies only.
63// <br>The extension axes and ranges have to be given as a
64// <linkto class=WCBox>WCBox</linkto> object. The axes which are part
65// of the box and the region are the axes to be stretched. Box axes
66// which are not part of the region are the extension axes.
67// <p>
68// Note that regions get automatically extended when a region is used
69// for a higher dimensioned image. The extension is done for all
70// unknown axes (for their entire length).
71// </synopsis>
72
73// <example>
74// <srcblock>
75// </srcblock>
76// </example>
77
78// # <todo asof="1997/11/11">
79// # <li>
80// # </todo>
81
82class WCExtension : public WCCompound {
83 public:
84 // Construct the extension of an image region using the axes
85 // and blc,trc given in the extendBox.
86 // The axes in region and box have to be disjoint.
87 WCExtension(const ImageRegion& region, const WCBox& extendBox);
88
89 // Copy constructor (copy semantics).
90 WCExtension(const WCExtension& other);
91
92 virtual ~WCExtension();
93
94 // Assignment (copy semantics).
96
97 // Comparison
98 virtual Bool operator==(const WCRegion& other) const;
99
100 // Make a copy of the derived object.
101 virtual WCRegion* cloneRegion() const;
102
103 // Get the class name (to store in the record).
105
106 // Get the region type. Returns className()
107 virtual String type() const;
108
109 // Convert the (derived) object to a record.
110 virtual TableRecord toRecord(const String& tableName) const;
111
112 // Convert correct object from a record.
113 static WCExtension* fromRecord(const TableRecord&, const String& tableName);
114
115 protected:
116 // WCExtension can extend a region if WCBox can do so.
117 virtual Bool canExtend() const;
118
119 // Convert to an LCRegion using the given coordinate system and shape.
120 // pixelAxesMap(i) gives the pixel axis in cSys of axes <src>i</src>
121 // in the axesDesc.
123 const IPosition& pixelAxesMap, const IPosition& outOrder) const;
124
125 private:
126 // Construct from multiple regions given as a Block.
127 // When <src>takeOver</src> is True, the destructor will delete the
128 // given regions. Otherwise a copy of the regions is made.
130
131 // Find the axes to be extended and stretched.
132 // The extend axes are the axis numbers in the box.
133 // For the stretch axes both box and region axes are returned.
134 void findAxes(IPosition& extendBoxAxes, IPosition& stretchBoxAxes,
135 IPosition& stretchRegionAxes) const;
136};
137
138} // namespace casacore
139
140#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.
virtual Bool canExtend() const
WCExtension can extend a region if WCBox can do so.
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
void findAxes(IPosition &extendBoxAxes, IPosition &stretchBoxAxes, IPosition &stretchRegionAxes) const
Find the axes to be extended and stretched.
WCExtension & operator=(const WCExtension &other)
Assignment (copy semantics).
virtual WCRegion * cloneRegion() const
Make a copy of the derived object.
static WCExtension * 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.
static String className()
Get the class name (to store in the record).
WCExtension(const ImageRegion &region, const WCBox &extendBox)
Construct the extension of an image region using the axes and blc,trc given in the extendBox.
WCExtension(Bool takeOver, const Block< const WCRegion * > &regions)
Construct from multiple regions given as a Block.
virtual Bool operator==(const WCRegion &other) const
Comparison.
virtual String type() const
Get the region type.
WCExtension(const WCExtension &other)
Copy constructor (copy semantics).
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