casacore
Loading...
Searching...
No Matches
ImageSummary.h
Go to the documentation of this file.
1//# ImageSummary.h: List descriptive information from an image
2//# Copyright (C) 1996,1997,1998,1999,2000,2001,2002
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_IMAGESUMMARY_H
27#define IMAGES_IMAGESUMMARY_H
28
29
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/measures/Measures/MFrequency.h>
33#include <casacore/measures/Measures/MDirection.h>
34#include <casacore/measures/Measures/MDoppler.h>
35#include <casacore/coordinates/Coordinates/CoordinateSystem.h>
36#include <casacore/coordinates/Coordinates/ObsInfo.h>
37#include <casacore/images/Images/ImageInfo.h>
38#include <casacore/casa/Arrays/ArrayFwd.h>
39
40namespace casacore { //# NAMESPACE CASACORE - BEGIN
41
42//# Forward Declarations
43template <class T> class ImageInterface;
44class IPosition;
45class Unit;
46class LogIO;
47class Coordinate;
48
49
50// <summary>
51// Provides and lists information about the header of an image.
52// </summary>
53
54// <use visibility=export>
55
56// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
57// </reviewed>
58
59// <prerequisite>
60// <li> <linkto class=ImageInterface>ImageInterface</linkto>
61// <li> <linkto module=Coordinates>Coordinates</linkto>
62// </prerequisite>
63
64// <etymology>
65// This class lists the ancilliary descriptive information from an image
66// </etymology>
67
68// <synopsis>
69// Images consist of pixel values and descriptive information.
70// This information describes the coordinate system, the image
71// units etc. This class enables you to
72// retrieve the descriptive information and/or list it.
73// <p>
74// The functions that retrieve specific coordinate information in vectors
75// (e.g. <src>referenceValues</src>) return it in the order of the (pixel) axes of
76// the image. Note that this can be different from the order in which
77// the <linkto class=CoordinateSystem>CoordinateSystem</linkto>
78// functions of similar name might return them. This is because the
79// order of the coordinates in the CoordinateSystem is not necessarily
80// the same order as the pixel axes in the associated image, although
81// of course there is a known association.
82//
83// <note role=tip>
84// This class lists information about the coordinates in the image.
85// The Coordinates classes can maintain the information in a variety
86// of units. For example, angular quantities are by default in radians,
87// but the manipulator of a <linkto class=CoordinateSystem>CoordinateSystem</linkto>
88// may have converted to some other unit such as arcseconds. This
89// means that when this class fetches coordinate information and returns
90// it to you (such as the <src>referenceValues()</src> function,
91// the information is returned to you in whatever units the coordinates
92// are currently in. It does not convert it.
93// </note>
94// </synopsis>
95
96// <example>
97// <srcBlock>
98// PagedImage<Float> inImage(fileName);
99// ImageSummary<Float> summary(inImage);
100// LogOrigin or("myClass", "myFunction(...)", WHERE);
101// LogIO os(or);
102// summary.list(os);
103// </srcBlock>
104// A <src>PagedImage</src> object is constructed and then logged to the
105// supplied <src>LogIO</src> object.
106// </example>
107
108// <motivation>
109// The viewing of the descriptive image information is a basic capability.
110// </motivation>
111
112//# <todo asof="1998/08/31">
113//# None that I know of.
114//# </todo>
115
116
117template <class T> class ImageSummary
118{
119public:
120// Constructor
122
123// Copy constructor
125
126// Destructor
128
129// Assignment operator
131
132// Retrieve number of image dimension
133 Int ndim () const;
134
135// Retrieve image shape
136 IPosition shape () const;
137
138// Retrieve tile shape with which image is stored on disk
140
141// Retrieve axis names in pixel or world axis order.
142 Vector<String> axisNames (Bool pixelOrder=True) const;
143
144// Retrieve reference pixels (0 or 1 rel)
146
147// Retrieve reference values in pixel or world axis order.
149
150// Retrieve axis increments in pixel or world axis order.
152
153// Retrieve axis units in pixel or world axis order.
155
156// Retrieve image units
157 Unit units () const;
158
159// Retrieve image name. Any prepended path is stripped off.
160 String name() const;
161
162// Retrieve observer name
164
165// Return epoch of observation as MEpoch or formatted string
167
168// Return telescope
170
171// Return rest frequency. Returns False if none.
172 Bool restFrequency(String& restFreqString, Quantum<Double>& restFreq) const;
173
174// Return frequency system. Returns False if none.
175 Bool frequencySystem(String& freqTypeString, MFrequency::Types& freqType) const;
176
177// Return direction system. Returns False if none.
178 Bool directionSystem(String& dirTypeString, MDirection::Types& dirType) const;
179
180// Retrieve whether image has mask or not
181 Bool hasAMask () const;
182
183// Retrieve mask names
185
186// Retrieve region names
188
189// Retrieve default mask name. Empty if none
191
192
193// Retrieve image type
195
196// List all header information. By default, the reference
197// values and pixel increments are converted to a "nice" unit before
198// formatting (e.g. RA is shown as HH:MM:SS.S).
199// For spectral axes, both frequency and velocity information is listed. You
200// can specify what velocity definition you want with <src>velocityType</src>
201// If postLocally is True, the formatted strings are returned in the return value
203 LogIO& os, const MDoppler::Types velocityType=MDoppler::RADIO,
204 Bool postLocally=False, const Bool verbose=False
205 );
206
207// Set a new image
209
210
211private:
216
219};
220
221
222} //# NAMESPACE CASACORE - END
223
224#ifndef CASACORE_NO_AUTO_TEMPLATES
225#include <casacore/images/Images/ImageSummary.tcc>
226#endif //# CASACORE_NO_AUTO_TEMPLATES
227#endif
Vector< String > list(LogIO &os, const MDoppler::Types velocityType=MDoppler::RADIO, Bool postLocally=False, const Bool verbose=False)
List all header information.
String telescope() const
Return telescope.
ImageSummary< T > & operator=(const ImageSummary< T > &other)
Assignment operator.
Vector< String > axisUnits(Bool pixelOrder=True) const
Retrieve axis units in pixel or world axis order.
String imageType() const
Retrieve image type.
~ImageSummary()
Destructor.
String obsDate(MEpoch &date) const
Return epoch of observation as MEpoch or formatted string.
Vector< String > maskNames() const
Retrieve mask names.
Bool hasAMask() const
Retrieve whether image has mask or not.
IPosition shape() const
Retrieve image shape.
Int ndim() const
Retrieve number of image dimension.
String defaultMaskName() const
Retrieve default mask name.
ImageSummary(const ImageSummary< T > &other)
Copy constructor.
String observer() const
Retrieve observer name.
String makeMasksString() const
String name() const
Retrieve image name.
Bool directionSystem(String &dirTypeString, MDirection::Types &dirType) const
Return direction system.
Vector< Double > axisIncrements(Bool pixelOrder=True) const
Retrieve axis increments in pixel or world axis order.
Vector< Double > referenceValues(Bool pixelOrder=True) const
Retrieve reference values in pixel or world axis order.
String makeRegionsString() const
Vector< String > regionNames() const
Retrieve region names.
const ImageInterface< T > * pImage_p
IPosition tileShape() const
Retrieve tile shape with which image is stored on disk.
Bool setNewImage(const ImageInterface< T > &image)
Set a new image.
Bool restFrequency(String &restFreqString, Quantum< Double > &restFreq) const
Return rest frequency.
Bool frequencySystem(String &freqTypeString, MFrequency::Types &freqType) const
Return frequency system.
CoordinateSystem cSys_p
Vector< Double > referencePixels(Bool oneRel=True) const
Retrieve reference pixels (0 or 1 rel)
ImageSummary(const ImageInterface< T > &)
Constructor.
Unit units() const
Retrieve image units.
Vector< String > axisNames(Bool pixelOrder=True) const
Retrieve axis names in pixel or world axis order.
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition MDirection.h:185
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition MDoppler.h:146
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition MFrequency.h:173
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
TableExprNode date(const TableExprNode &node)
Definition ExprNode.h:1515
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41