00001 //# ImageRotator.h 00002 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003 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: Image2DConvolver.h 20229 2008-01-29 15:19:06Z gervandiepen $ 00027 00028 #ifndef IMAGES_IMAGEROTATOR_H 00029 #define IMAGES_IMAGEROTATOR_H 00030 00031 #include <imageanalysis/ImageAnalysis/ImageTask.h> 00032 00033 #include <casa/aips.h> 00034 00035 namespace casa { 00036 00037 // <summary> 00038 // This class rotates an image through a specified angle. 00039 // </summary> 00040 00041 // <use visibility=export> 00042 00043 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00044 // </reviewed> 00045 00046 // <prerequisite> 00047 // </prerequisite> 00048 00049 // <etymology> 00050 // This class rotates an image through a specified angle. 00051 // </etymology> 00052 00053 // <synopsis> 00054 // This class rotates an image through a specified angle. 00055 00056 // </synopsis> 00057 00058 // <example> 00059 // <srcBlock> 00060 // </srcBlock> 00061 // </example> 00062 00063 // <motivation> 00064 // users like histograms. 00065 // </motivation> 00066 // <li> 00067 // </todo> 00068 00069 class ImageRotator : public ImageTask<Float> { 00070 public: 00071 00072 const static String CLASS_NAME; 00073 00074 ImageRotator() = delete; 00075 00076 ImageRotator( 00077 const SPCIIF image, const Record *const ®ionPtr, 00078 const String& mask,const String& outname, Bool overwrite 00079 ); 00080 00081 ImageRotator(const ImageRotator &other) = delete; 00082 00083 ~ImageRotator(); 00084 00085 ImageRotator &operator=(const ImageRotator &other) = delete; 00086 00087 String getClass() const { return CLASS_NAME; } 00088 00089 SPIIF rotate(); 00090 00091 // set angle through which to rotate the direction or linear coordinate 00092 void setAngle(const Quantity& angle) { _angle = angle; } 00093 00094 void setDecimate(Int d) { _decimate = d; } 00095 00096 // set the interpolation method 00097 void setInterpolationMethod(const String& method) { 00098 _method = method; 00099 _method.upcase(); 00100 } 00101 00102 void setReplicate(Bool b) { _replicate = b; } 00103 00104 // set shape of output image 00105 void setShape(const IPosition& shape) { _shape = shape; } 00106 00107 00108 protected: 00109 00110 CasacRegionManager::StokesControl _getStokesControl() const { 00111 return CasacRegionManager::USE_ALL_STOKES; 00112 } 00113 00114 vector<Coordinate::Type> _getNecessaryCoordinates() const { 00115 return vector<Coordinate::Type>(); 00116 } 00117 00118 inline Bool _supportsMultipleRegions() const {return False;} 00119 00120 private: 00121 IPosition _shape; 00122 String _method = "cubic"; 00123 Quantity _angle = Quantity(0, "deg"); 00124 Int _decimate = 0; 00125 Bool _replicate = False; 00126 00127 }; 00128 00129 } 00130 #endif