ImageMetaData.h

Go to the documentation of this file.
00001 //# ImageMetaData.h: Meta information for Images
00002 //# Copyright (C) 2009
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 
00028 #ifndef IMAGES_IMAGEMETADATA_H
00029 #define IMAGES_IMAGEMETADATA_H
00030 
00031 #include <imageanalysis/ImageAnalysis/ImageMetaDataBase.h>
00032 
00033 #include <images/Images/ImageInterface.h>
00034 #include <casa/aips.h>
00035 
00036 namespace casa {
00037 
00038 // <summary>
00039 // A class in which to store and allow read-only access to image metadata.
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="" date="" tests="" demos="">
00045 // </reviewed>
00046 
00047 // <prerequisite>
00048 //   <li> <linkto class=ImageInterface>ImageInterface</linkto>
00049 // </prerequisite>
00050 
00051 // <etymology>
00052 // The ImageMetaData class name is derived from its role as holding image metadata.
00053 // </etymology>
00054 
00055 // <synopsis> 
00056 // The ImageMetaData object is meant to allow access to image metadata (eg, shape,
00057 // coordinate system info such as spectral and polarization axes numbers, etc).
00058 // </synopsis>
00059 
00060 // <example>
00061 // Construct an object of this class by passing the associated image to the constructor.
00062 // <srcblock>
00063 // PagedImage<Float> myImage("myImage");
00064 // ImageMetaData<Float> myImageMetaData(myImage);
00065 // </srcblock>
00066 // </example>
00067 
00068 // <motivation> 
00069 // This class is meant to provide an object-oriented interface for accessing
00070 // image metadata without polluting the ImageInterface and CoordinateSystem
00071 // classes with these methods.
00072 // </motivation>
00073 // <todo>
00074 // Merge ImageInfo class into this class.
00075 // </todo>
00076 
00077 class ImageMetaData : public ImageMetaDataBase {
00078 
00079 public:
00080 
00081         ImageMetaData(SPCIIF imagef);
00082         ImageMetaData(SPIIF imagef);
00083 
00084         ImageMetaData(SPCIIC imagec);
00085         ImageMetaData(SPIIC imagec);
00086 
00087         ~ImageMetaData() {}
00088 
00089         Record toRecord(Bool verbose) const;
00090 
00091         // For ia.summary() moved from ImageAnalysis
00092         Record summary(
00093             const String& doppler, const Bool list,
00094             const Bool pixelorder, const Bool verbose
00095         );
00096 
00097 protected:
00098 
00099         SPCIIF _getFloatImage() const { return _floatImage; }
00100 
00101         SPCIIC _getComplexImage() const { return _complexImage; }
00102 
00103         ImageMetaData() : ImageMetaDataBase(), _floatImage(), _complexImage() {}
00104 
00105         const ImageInfo& _getInfo() const { return _info; }
00106 
00107         const CoordinateSystem& _getCoords() const { return _csys; }
00108 
00109         Vector<String> _getAxisNames() const;
00110 
00111         Vector<String> _getAxisUnits() const;
00112 
00113         GaussianBeam _getBeam() const;
00114 
00115         String _getBrightnessUnit() const;
00116 
00117         String _getImType() const;
00118 
00119         vector<Quantity> _getIncrements() const;
00120 
00121         Vector<String> _getMasks() const;
00122 
00123         String _getObject() const;
00124 
00125         String _getEquinox() const;
00126 
00127         MEpoch _getObsDate() const;
00128 
00129         String _getObserver() const;
00130 
00131         String _getProjection() const;
00132 
00133         String _getRefFreqType() const;
00134 
00135         Vector<Double> _getRefPixel() const;
00136 
00137         Vector<Quantity> _getRefValue() const;
00138 
00139         Quantity _getRestFrequency() const;
00140 
00141         Record _getStatistics() const;
00142 
00143         String _getTelescope() const;
00144 
00145         Vector<String> _getStokes() const;
00146 
00147         template <class T> Record _summary(
00148             SPCIIT image, const String& doppler, const Bool list,
00149         const Bool pixelorder, const Bool verbose
00150     );
00151 
00152 private:
00153 
00154         SPCIIF _floatImage;
00155         SPCIIC _complexImage;
00156         const ImageInfo _info;
00157         const CoordinateSystem _csys;
00158 
00159         // These are mutable because they are only to be set once and
00160         // then cached. If this contract is broken, and they are set elsewhere
00161         // defects will likely occur.
00162         mutable Record _header;
00163         mutable String _bunit, _imtype, _object, _equinox,
00164                 _projection, _observer, _telescope, _reffreqtype;
00165         mutable MEpoch _obsdate;
00166         mutable Quantity _restFreq;
00167         mutable GaussianBeam _beam;
00168         mutable Vector<String> _masks, _stokes;
00169         mutable Vector<String> _axisNames, _axisUnits;
00170         mutable Vector<Double> _refPixel;
00171         mutable vector<Quantity> _refVal, _increment;
00172         mutable Record _stats;
00173 };
00174 
00175 }
00176 
00177 #ifndef AIPS_NO_TEMPLATE_SRC
00178 #include <imageanalysis/ImageAnalysis/ImageMetaData.tcc>
00179 #endif //# AIPS_NO_TEMPLATE_SRC
00180 
00181 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1