/usr/include/casacore/images/Regions/RegionManager.h is in casacore-dev 2.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | //# RegionManager.h: framework independent class that provides
//# functionality to tool of same name
//# Copyright (C) 2007
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This program is free software; you can redistribute it and/or modify it
//# under the terms of the GNU General Public License as published by the Free
//# Software Foundation; either version 2 of the License, or (at your option)
//# any later version.
//#
//# This program is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
//# more details.
//#
//# You should have received a copy of the GNU General Public License along
//# with this program; if not, write to the Free Software Foundation, Inc.,
//# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id$
#ifndef IMAGES_REGIONMANAGER_H
#define IMAGES_REGIONMANAGER_H
#include <casacore/casa/aips.h>
#include <casacore/casa/Quanta/Quantum.h>
#include <casacore/coordinates/Coordinates/CoordinateSystem.h>
#include <casacore/lattices/LRegions/RegionType.h>
#include <casacore/tables/Tables/Table.h>
namespace casacore {
/**
* image component class
*
* This is a casa based class to provide the funtionality to the
* RegionManager Tool
*
* @author
* @version
**/
class LogIO;
class String;
class Record;
template<class T> class Vector;
class WCRegion;
class WCBox;
template<class T> class PtrBlock;
class ImageRegion;
class RegionManager
{
public:
//blank constructor
RegionManager();
RegionManager(const CoordinateSystem& csys);
virtual ~RegionManager();
String absreltype(const Int absrelval=0);
//Some little but useful tidbits.
static Bool isPixelRegion(const ImageRegion& reg);
static Bool isWorldRegion(const ImageRegion& reg);
void setcoordsys(const CoordinateSystem& csys);
const CoordinateSystem& getcoordsys() const ;
//LCSlicer box
Record* box(const Vector<Double>& blc, const Vector<Double>& trc,
const Vector<Double>& inc, const String& absrel,
const Bool frac, const String& comment="");
//LCBox box
static Record* box(const Vector<Double>& blc, const Vector<Double>& trc,
const Vector<Int>& shape, const String& comment="");
Record* wbox(const Vector<Quantity>& blc,
const Vector<Quantity>& trc,
const Vector<Int>& pixelaxes,
const CoordinateSystem& csys,
const String& absrel, const String& comment);
Record* wbox(const Vector<String>& blc,
const Vector<String>& trc,
const Vector<Int>& pixelaxes,
const CoordinateSystem& csys,
const String& absrel, const String& comment);
Record* wbox(const Vector<Quantity>& blc,
const Vector<Quantity>& trc,
const Vector<Int>& pixelaxes,
const String& absrel, const String& comment);
Record* wbox(const Vector<String>& blc,
const Vector<String>& trc,
const Vector<Int>& pixelaxes,
const String& absrel, const String& comment);
ImageRegion* wbox(const Vector<Quantity>& blc,
const Vector<Quantity>& trc,
const Vector<Int>& pixelaxes,
const CoordinateSystem& csys,
const String& absrel="abs" );
//Wpolygon with coordsys and if pixelaxes[0] is -1 then its assumed
//to be 0,1,...
ImageRegion* wpolygon(const Vector<Quantity>& x,
const Vector<Quantity>& y,
const Vector<Int>& pixelaxes,
const CoordinateSystem& csys,
const String& absrel);
//wpolygon version without csys...throws an exception if
//setcoordsys is not run
ImageRegion* wpolygon(const Vector<Quantity>& x,
const Vector<Quantity>& y,
const Vector<Int>& pixelaxes,
const String& absrel);
static ImageRegion* wellipse(
const Quantity& xc,
const Quantity& yc,
const Quantity& a,
const Quantity& b,
const Quantity& pa,
const uInt pixelAxis0,
const uInt pixelAxis1,
const CoordinateSystem& csys,
const String& absrel
);
//wellipse version without csys...throws an exception if
//setcoordsys is not run
ImageRegion* wellipse(
const Quantity& xc,
const Quantity& yc,
const Quantity& a,
const Quantity& b,
const Quantity& pa,
const uInt pixelAxis0,
const uInt pixelAxis1,
const String& absrel
) const;
static ImageRegion* wsphere(
const Vector<Quantity>& center,
const Quantity& radius,
const Vector<Int>& pixelaxes,
const CoordinateSystem& csys,
const String& absrel
);
//wsphere version without csys...throws an exception if
//setcoordsys is not run
ImageRegion* wsphere(
const Vector<Quantity>& center,
const Quantity& radius,
const Vector<Int>& pixelaxes,
const String& absrel
) const;
static ImageRegion* wellipsoid(
const Vector<Quantity>& center,
const Vector<Quantity>& radii,
const Vector<Int>& pixelaxes,
const CoordinateSystem& csys,
const String& absrel
);
ImageRegion* wellipsoid(
const Vector<Quantity>& center,
const Vector<Quantity>& radii,
const Vector<Int>& pixelaxes,
const String& absrel
) const;
static ImageRegion* wshell(
const Vector<Quantity>& center,
const Vector<Quantity>& innerRadii,
const Vector<Quantity>& outerRadii,
const Vector<Int>& pixelaxes,
const CoordinateSystem& csys,
const String& absrel
);
ImageRegion* wshell(
const Vector<Quantity>& center,
const Vector<Quantity>& innerRadii,
const Vector<Quantity>& outerRadii,
const Vector<Int>& pixelaxes,
const String& absrel
) const;
static ImageRegion* wmask(const String& command);
/**************************************************************
** Routines for combining regions **
** **
** Note: Many of the WCXxx classes which are used to do the **
** work can take multiple regions at once, why not **
** accept a ptr block of Image Regions then? **
**************************************************************/
//Various versions of creating a complement region
ImageRegion* doComplement(const WCRegion& reg1);
ImageRegion* doComplement(const PtrBlock<const WCRegion*>& reg1);
ImageRegion* doComplement(const ImageRegion& reg1);
//Various versions of concatenating a region onto another.
ImageRegion* doConcatenation(const WCRegion& region, const WCBox& box);
ImageRegion* doconcatenation(const PtrBlock<const WCRegion*>& regions, const WCBox& box);
ImageRegion* doConcatenation(const PtrBlock<const ImageRegion*>& regions, const TableRecord& box);
ImageRegion* doConcatenation(const Record& regions, const TableRecord& box);
//Various versions of handling the difference of regions
ImageRegion* doDifference(const WCRegion& reg1, const WCRegion& reg2);
ImageRegion* doDifference(const PtrBlock<const WCRegion*>& reg1);
ImageRegion* doDifference(const ImageRegion& reg1, const ImageRegion& reg2);
//Different versions of intersecting regions
ImageRegion* doIntersection(const WCRegion& reg1, const WCRegion& reg2);
ImageRegion* doIntersection(const PtrBlock<const WCRegion*>& reg1);
ImageRegion* doIntersection(const ImageRegion& reg1, const ImageRegion& reg2);
//Different versions of unioning regions
ImageRegion* doUnion(const WCRegion& reg1, const WCRegion& reg2);
ImageRegion* doUnion(const PtrBlock<const WCRegion*>& reg1);
ImageRegion* doUnion(const ImageRegion& reg1, const ImageRegion& reg2) const;
/**************************************************************
** Routines for reading/writing regions **
**************************************************************/
//Reading of a file containing an ImageRegion in the AipsIO format dump
static Record* readImageFile( String filename, String regionname );
//Writing a file of the AipsIO dump of the record representation of the region
static Bool writeImageFile(const String& file, const String& regionname, const Record& regionRecord);
//save region into a table (image, blank table or any other such)
String imageRegionToTable(const String& tabName,
const ImageRegion& imreg,
const String& regName, Bool asmask=False);
String recordToTable(const String& tabName, const RecordInterface& rec,
const String& regName="", Bool asmask=False);
//recover region from table
Record* tableToRecord(const String& tabName, const String& regname);
//names of regions in table
Vector<String> namesInTable(const String& tabName);
//Remove a region from table...refuse is regionname is ""
Bool removeRegionInTable(const String& tabName, const String& regName);
protected:
inline LogIO* _getLog() const { return itsLog; }
private:
LogIO *itsLog;
CoordinateSystem* itsCSys;
// Function to return the internal Table object to the RegionHandler.
static Table& getTable (void* ptr, Bool writable);
//Convert a string to Quantity
void toQuantity(Quantity& out, const String& in);
Table tab_p;
};
} // casa namespace
#endif
|