ImageReorderer.h

Go to the documentation of this file.
00001 //#ImageReorderer.h
00002 //#
00003 //# Copyright (C) 1998,1999,2000,2001,2003 Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This program is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU General Public License as published by the Free
00007 //# Software Foundation; either version 2 of the License, or (at your option)
00008 //# any later version.
00009 //#
00010 //# This program 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 General Public License for
00013 //# more details.
00014 //#
00015 //# You should have received a copy of the GNU General Public License along
00016 //# with this program; if not, write to the Free Software Foundation, Inc.,
00017 //# 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 //#  Created on: May 7, 2010
00027 //#     Author: dmehring
00028 
00029 #ifndef IMAGEREORDERER_H_
00030 #define IMAGEREORDERER_H_
00031 
00032 #include <images/Images/PagedImage.h>
00033 #include <casa/Logging/LogIO.h>
00034 
00035 namespace casa {
00036 class ImageReorderer {
00037     // <summary>
00038       // Top level interface for reordering image axes
00039       // </summary>
00040 
00041       // <reviewed reviewer="" date="" tests="" demos="">
00042       // </reviewed>
00043 
00044       // <prerequisite>
00045       // </prerequisite>
00046 
00047       // <etymology>
00048       // Reorders images axes.
00049       // </etymology>
00050 
00051       // <synopsis>
00052       // ImageReorderer is the top level interface for reordering image axes.
00053       // </synopsis>
00054 
00055       // <example>
00056       // <srcblock>
00057       // ImageReorderer reorderer(...)
00058       // reorderer.reorder();
00059       // </srcblock>
00060       // </example>
00061 public:
00062         ImageReorderer(const String& imagename, uInt order, const String& outputImage);
00063 
00064         ImageReorderer(const String& imagename, const String& order, const String& outputImage);
00065 
00066         ImageReorderer(const String& imagename, const Vector<String> order, const String& outputImage);
00067 
00068         ImageReorderer(const ImageInterface<Float> * const image, uInt order, const String& outputImage);
00069 
00070         ImageReorderer(const ImageInterface<Float> * const image, const String& order, const String& outputImage);
00071 
00072         ImageReorderer(const ImageInterface<Float> * const image, const Vector<String> order, const String& outputImage);
00073         // destructor
00074         ~ImageReorderer();
00075 
00076         // reorder the axes and write the output image. Returns the associated PagedImage object.
00077         ImageInterface<Float>* reorder() const;
00078 
00079 private:
00080         LogIO *_log;
00081         ImageInterface<Float> *_image;
00082         IPosition _order;
00083         String _outputImage;
00084         // Do not allow use of default constuctor
00085         ImageReorderer();
00086 
00087         void _construct(const String& imagename, const String& outfile);
00088 
00089         IPosition _getOrder(uInt order) const;
00090 
00091         IPosition _getOrder(const String& order) const;
00092 
00093         IPosition _getOrder(Vector<String>& order) const;
00094 
00095         void _downcase(Vector<String>& vec) const;
00096 };
00097 }
00098 
00099 
00100 #endif /* IMAGEREORDERER_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines