Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/ImageMetaData_8h_source.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 21:27:48 2011 Кодировка: Поисковые слова: п п п п п п п п п п п п п п |
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: ImageMetaData.h 20739 2009-09-29 01:15:15Z Malte.Marquarding $ 00027 00028 #ifndef IMAGES_IMAGEMETADATA_H 00029 #define IMAGES_IMAGEMETADATA_H 00030 00031 #include <images/Images/ImageInterface.h> 00032 #include <casa/aips.h> 00033 00034 namespace casa { //# NAMESPACE CASA - BEGIN 00035 00036 // <summary> 00037 // A class in which to store and allow read-only access to image metadata. 00038 // </summary> 00039 00040 // <use visibility=export> 00041 00042 // <reviewed reviewer="" date="" tests="" demos=""> 00043 // </reviewed> 00044 00045 // <prerequisite> 00046 // <li> <linkto class=ImageInterface>ImageInterface</linkto> 00047 // </prerequisite> 00048 00049 // <etymology> 00050 // The ImageMetaData class name is derived from its role as holding image metadata. 00051 // </etymology> 00052 00053 // <synopsis> 00054 // The ImageMetaData object is meant to allow access to image metadata (eg, shape, 00055 // coordinate system info such as spectral and polarization axes numbers, etc). 00056 // </synopsis> 00057 00058 // <example> 00059 // Construct an object of this class by passing the associated image to the constructor. 00060 // <srcblock> 00061 // PagedImage<Float> myImage("myImage"); 00062 // ImageMetaData<Float> myImageMetaData(myImage); 00063 // </srcblock> 00064 // </example> 00065 00066 // <motivation> 00067 // This class is meant to provide an object-oriented interface for accessing 00068 // image metadata without polluting the ImageInterface and CoordinateSystem 00069 // classes with these methods. 00070 // </motivation> 00071 00072 00073 class ImageMetaData { 00074 00075 public: 00076 template <class T> ImageMetaData(const ImageInterface<T>& image) : 00077 itsCoordinates (image.coordinates()), itsShape(image.shape()) {}; 00078 00079 // Get the axis number of the spectral axis of this image (0-based). 00080 Int spectralAxisNumber() const; 00081 00082 // Get the number of channels in this image. 00083 uInt nChannels() const; 00084 00085 // Is the specified channel number valid for this image? 00086 Bool isChannelNumberValid(const uInt chan) const; 00087 00088 // Get the coordinate number of the spectral axis of this image (0-based). This 00089 // is generally not the same as the axis number because the direction (eg RA, Dec) 00090 // coordinate counts as only one coordinate, not two. Yes I know its confusing. 00091 // Here's an example, say you have an image with axes, RA, Dec, Stokes, Frequency. 00092 // The spectral coordinate number would be 2 since RA, Dec make up a single 00093 // direction coordinate. But, the spectral axis number would be 3, because RA 00094 // and Dec are counted seperately in this case. Its important (and very confusing) 00095 // to be clear about this difference or things will break. 00096 Int spectralCoordinateNumber() const; 00097 00098 // Does this image have a spectral (frequency) axis? 00099 Bool hasSpectralAxis() const; 00100 00101 // Get the coordinate number of the polarization axis of this image (0-based). This 00102 // is generally not the same as the axis number because the direction (eg RA, Dec) 00103 // coordinate counts as only one coordinate, not two. Yes I know its confusing. 00104 // Here's an example, say you have an image with axes, RA, Dec, Stokes, Frequency. 00105 // The polarization coordinate number would be 1 since RA, Dec make up a single 00106 // direction coordinate. But, the polarization axis number would be 2, because RA 00107 // and Dec are counted seperately in this case. Its important (and very confusing) 00108 // to be clear about this difference or things will break. Return -1 00109 // if this image does not have a polarization axis. 00110 00111 Int polarizationCoordinateNumber() const; 00112 00113 // Get the axis number of the polarization axis of this image (0-based). Return -1 00114 // if this image does not have a polarization axis. 00115 Int polarizationAxisNumber() const; 00116 00117 // Does this image have a polarization axis? 00118 Bool hasPolarizationAxis() const; 00119 00120 // Get the pixel number on the polarization axis of the specified stokes parameter. 00121 // If the specified stokes parameter does not exist in the image, the value returned 00122 // is not gauranteed to be anything other than outside the range of 0 to nStokes-1 00123 // inclusive. Return -1 if the specified stokes parameter is not present or 00124 // if this image does not have a polarization axis. 00125 00126 Int stokesPixelNumber(const String& stokesString) const; 00127 00128 // Get the number of stokes parameters in this image. 00129 uInt nStokes() const; 00130 00131 // is the specified stokes parameter present in the image? 00132 Bool isStokesValid(const String& stokesString) const; 00133 00134 // Get the zero based direction coordinate number. 00135 Int directionCoordinateNumber() const; 00136 00137 // does this image have a direction coordinate? 00138 Bool hasDirectionCoordinate() const; 00139 00140 // Get the direction axes numbers for this image. Returns a two element 00141 // Vector if there is a direction coordinate, if not returns a zero element 00142 // vector. 00143 Vector<Int> directionAxesNumbers() const; 00144 00145 // Get the shape of the direction axes. Returns a two element 00146 // Vector if there is a direction coordinate, if not returns a zero element 00147 // vector. 00148 00149 Vector<Int> directionShape() const; 00150 00151 // if the specified stokes parameter is valid. A message suitable for 00152 // error notification is returned in the form of an in-out parameter 00153 //if one or both of these is invalid. 00154 Bool areChannelAndStokesValid( 00155 String& message, const uInt chan, const String& stokesString 00156 ) const; 00157 00158 private: 00159 const CoordinateSystem& itsCoordinates; 00160 IPosition itsShape; 00161 }; 00162 00163 } //# NAMESPACE CASA - END 00164 #endif 00165