WCIntersection.h

Go to the documentation of this file.
00001 //# WCIntersection.h: Make the intersection of 2 or more image regions
00002 //# Copyright (C) 1998
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_WCINTERSECTION_H
00029 #define IMAGES_WCINTERSECTION_H
00030 
00031 //# Includes
00032 #include <casacore/casa/aips.h>
00033 #include <casacore/images/Regions/WCCompound.h>
00034 
00035 
00036 namespace casacore { //# NAMESPACE CASACORE - BEGIN
00037 
00038 // <summary>
00039 // Make the intersection of 2 or more image regions.
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="" date="" tests="">
00045 // </reviewed>
00046 
00047 // <prerequisite>
00048 //   <li> <linkto class=WCCompound>WCCompound</linkto>
00049 // </prerequisite>
00050 
00051 // <synopsis> 
00052 // The WCIntersection class is a specialization of class
00053 // <linkto class=WCCompound>WCCompound</linkto>.
00054 // It makes it possible to take the intersection of 2 or more image regions.
00055 // Note that only world coordinate regions can be used in a compound,
00056 // thus an LCSlicer object is not allowed in an intersection.
00057 // <p>
00058 // The intersection of regions is the collection of the pixels
00059 // masked-on in all regions.
00060 // <p>
00061 // The regions in a intersection can have different axes and dimensionalities.
00062 // The axes and dimensionality of a intersection are determined by the
00063 // collection of all different axes in its regions. Each individual region
00064 // will be auto-extended along the axes not being part of the region.
00065 // E.g. one can define a WCBox with axis RA and another WCBox with
00066 // axis DEC. The intersection will be 2-dim with axes RA and DEC. The first
00067 // box will be auto-extended to cover the DEC axis, which results
00068 // in a 2-dim box with its DEC axis the length of the image's DEC axis.
00069 // Similarly the second box will be auto-extended to cover the RA axis.
00070 // </synopsis> 
00071 
00072 // <example>
00073 // <srcblock>
00074 // </srcblock>
00075 // </example>
00076 
00077 //# <todo asof="1997/11/11">
00078 //# <li>
00079 //# </todo>
00080 
00081 
00082 class WCIntersection: public WCCompound
00083 {
00084 public:
00085     // Construct the intersection of one or more image regions.
00086     // The image regions have to contain WCRegion objects, otherwise an
00087     // exception is thrown.
00088     // <group>
00089     WCIntersection (const ImageRegion& region1, const ImageRegion& region2);
00090     WCIntersection (const ImageRegion* region1,
00091                     const ImageRegion* region2 = 0,
00092                     const ImageRegion* region3 = 0,
00093                     const ImageRegion* region4 = 0,
00094                     const ImageRegion* region5 = 0,
00095                     const ImageRegion* region6 = 0,
00096                     const ImageRegion* region7 = 0,
00097                     const ImageRegion* region8 = 0,
00098                     const ImageRegion* region9 = 0,
00099                     const ImageRegion* region10 = 0);
00100     WCIntersection (const PtrBlock<const ImageRegion*>& regions);
00101     // </group>
00102 
00103     // Construct from multiple regions given as a Block.
00104     // When <src>takeOver</src> is True, the destructor will delete the
00105     // given regions. Otherwise a copy of the regions is made.
00106     WCIntersection (Bool takeOver, const PtrBlock<const WCRegion*>& regions);
00107 
00108     // Copy constructor (copy semantics).
00109     WCIntersection (const WCIntersection& other);
00110 
00111     virtual ~WCIntersection();
00112 
00113     // Assignment (copy semantics).
00114     WCIntersection& operator= (const WCIntersection& other);
00115 
00116     // Comparison
00117     virtual Bool operator== (const WCRegion& other) const;
00118 
00119     // Make a copy of the derived object.
00120     virtual WCRegion* cloneRegion() const;
00121 
00122     // Get the class name (to store in the record).
00123     static String className();
00124 
00125     // Get the region type.  Returns className()
00126     virtual String type() const;
00127 
00128     // Convert the (derived) object to a record.
00129     virtual TableRecord toRecord (const String& tableName) const;
00130 
00131     // Convert correct object from a record.
00132     static WCIntersection* fromRecord (const TableRecord&,
00133                                        const String& tableName);
00134 
00135 protected:
00136     // Convert to an LCRegion using the given coordinate system and shape.
00137     // pixelAxesMap(i) gives the pixel axis in cSys of axes <src>i</src>
00138     // in the axesDesc.
00139     virtual LCRegion* doToLCRegion (const CoordinateSystem& cSys,
00140                                     const IPosition& shape,
00141                                     const IPosition& pixelAxesMap,
00142                                     const IPosition& outOrder) const;
00143 };
00144 
00145 
00146 
00147 } //# NAMESPACE CASACORE - END
00148 
00149 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1