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