00001 //# LCPixelSet.h: Class to define a rectangular set of pixels as a region 00002 //# Copyright (C) 1998,1999 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 LATTICES_LCPIXELSET_H 00029 #define LATTICES_LCPIXELSET_H 00030 00031 //# Includes 00032 #include <casacore/casa/aips.h> 00033 #include <casacore/lattices/LRegions/LCBox.h> 00034 #include <casacore/casa/Arrays/Slicer.h> 00035 00036 00037 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00038 00039 // <summary> 00040 // Class to define a rectangular mask as a region 00041 // </summary> 00042 00043 // <use visibility=export> 00044 00045 // <reviewed reviewer="" date="" tests=""> 00046 // </reviewed> 00047 00048 // <prerequisite> 00049 // <li> <linkto class=LCRegion>LCRegion</linkto> 00050 // </prerequisite> 00051 00052 // <synopsis> 00053 // The LCPixelSet class is a specialization of class 00054 // <linkto class=LCRegion>LCRegion</linkto>. 00055 // It makes it possible to define a rectangular region of interest. 00056 // </synopsis> 00057 00058 // <example> 00059 // <srcblock> 00060 // </srcblock> 00061 // </example> 00062 00063 // <todo asof="1997/11/11"> 00064 // </todo> 00065 00066 class LCPixelSet: public LCRegionFixed 00067 { 00068 public: 00069 LCPixelSet(); 00070 00071 // Construct from the box defining the position of the mask. 00072 // The shape of the region and mask must be the same. 00073 LCPixelSet (const Array<Bool>& mask, const LCBox& region); 00074 00075 // Copy constructor (copy semantics). 00076 LCPixelSet (const LCPixelSet& other); 00077 00078 virtual ~LCPixelSet(); 00079 00080 // Assignment (copy semantics). 00081 LCPixelSet& operator= (const LCPixelSet& other); 00082 00083 // Comparison 00084 virtual Bool operator== (const LCRegion& other) const; 00085 00086 // Make a copy of the derived object. 00087 virtual LCRegion* cloneRegion() const; 00088 00089 // Get the class name (to store in the record). 00090 static String className(); 00091 00092 // Get the region type. Returns className(). 00093 virtual String type() const; 00094 00095 // Convert the (derived) object to a record. 00096 virtual TableRecord toRecord (const String& tableName) const; 00097 00098 // Convert correct object from a record. 00099 static LCPixelSet* fromRecord (const TableRecord&, 00100 const String& tablename); 00101 00102 protected: 00103 // Construct another LCPixelSet (for e.g. another lattice) by moving 00104 // this one. It recalculates the bounding mask. 00105 // A positive translation value indicates "to right". 00106 virtual LCRegion* doTranslate (const Vector<Float>& translateVector, 00107 const IPosition& newLatticeShape) const; 00108 00109 private: 00110 LCBox itsBox; 00111 }; 00112 00113 00114 00115 } //# NAMESPACE CASACORE - END 00116 00117 #endif