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