29 #ifndef IMAGES_REGIONMANAGER_H
30 #define IMAGES_REGIONMANAGER_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Quanta/Quantum.h>
34 #include <casacore/coordinates/Coordinates/CoordinateSystem.h>
35 #include <casacore/lattices/LRegions/RegionType.h>
36 #include <casacore/tables/Tables/Table.h>
37 #include <casacore/casa/Arrays/ArrayFwd.h>
55 template<
class T>
class PtrBlock;
105 const String& absrel=
"abs" );
126 const uInt pixelAxis0,
127 const uInt pixelAxis1,
140 const uInt pixelAxis0,
141 const uInt pixelAxis1,
A drop-in replacement for Block<T*>.
std::unique_ptr< CoordinateSystem > itsCSys
ImageRegion * doComplement(const WCRegion ®1)
Various versions of creating a complement region.
ImageRegion * wsphere(const Vector< Quantity > ¢er, const Quantity &radius, const Vector< Int > &pixelaxes, const String &absrel) const
wsphere 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)
wpolygon version without csys...throws an exception if setcoordsys is not run
ImageRegion * doDifference(const WCRegion ®1, const WCRegion ®2)
Various versions of handling the difference of regions.
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
wellipse version without csys...throws an exception if setcoordsys is not run
ImageRegion * doConcatenation(const PtrBlock< const ImageRegion * > ®ions, const TableRecord &box)
static Bool isWorldRegion(const ImageRegion ®)
ImageRegion * doComplement(const PtrBlock< const WCRegion * > ®1)
Record * wbox(const Vector< String > &blc, const Vector< String > &trc, const Vector< Int > &pixelaxes, const String &absrel, const String &comment)
static Bool writeImageFile(const String &file, const String ®ionname, const Record ®ionRecord)
Writing a file of the AipsIO dump of the record representation of the region.
String absreltype(const Int absrelval=0)
ImageRegion * doIntersection(const ImageRegion ®1, const ImageRegion ®2)
ImageRegion * doComplement(const ImageRegion ®1)
void setcoordsys(const CoordinateSystem &csys)
ImageRegion * wbox(const Vector< Quantity > &blc, const Vector< Quantity > &trc, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel="abs")
String imageRegionToTable(const String &tabName, const ImageRegion &imreg, const String ®Name, Bool asmask=False)
save region into a table (image, blank table or any other such)
String recordToTable(const String &tabName, const RecordInterface &rec, const String ®Name="", Bool asmask=False)
Record * box(const Vector< Double > &blc, const Vector< Double > &trc, const Vector< Double > &inc, const String &absrel, const Bool frac, const String &comment="")
LCSlicer box.
Record * wbox(const Vector< Quantity > &blc, const Vector< Quantity > &trc, const Vector< Int > &pixelaxes, const String &absrel, const String &comment)
ImageRegion * doDifference(const PtrBlock< const WCRegion * > ®1)
Record * tableToRecord(const String &tabName, const String ®name)
recover region from table
Record * wbox(const Vector< Quantity > &blc, const Vector< Quantity > &trc, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel, const String &comment)
ImageRegion * doConcatenation(const Record ®ions, const TableRecord &box)
static ImageRegion * wellipsoid(const Vector< Quantity > ¢er, const Vector< Quantity > &radii, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel)
Vector< String > namesInTable(const String &tabName)
names of regions in table
const CoordinateSystem & getcoordsys() const
static Bool isPixelRegion(const ImageRegion ®)
Some little but useful tidbits.
static ImageRegion * wshell(const Vector< Quantity > ¢er, const Vector< Quantity > &innerRadii, const Vector< Quantity > &outerRadii, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel)
ImageRegion * doIntersection(const WCRegion ®1, const WCRegion ®2)
Different versions of intersecting regions.
static ImageRegion * wsphere(const Vector< Quantity > ¢er, const Quantity &radius, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel)
void toQuantity(Quantity &out, const String &in)
Convert a string to Quantity.
static Record * readImageFile(String filename, String regionname)
Reading of a file containing an ImageRegion in the AipsIO format dump.
ImageRegion * wellipsoid(const Vector< Quantity > ¢er, const Vector< Quantity > &radii, const Vector< Int > &pixelaxes, const String &absrel) const
ImageRegion * doConcatenation(const WCRegion ®ion, const WCBox &box)
Various versions of concatenating a region onto another.
ImageRegion * wshell(const Vector< Quantity > ¢er, const Vector< Quantity > &innerRadii, const Vector< Quantity > &outerRadii, const Vector< Int > &pixelaxes, const String &absrel) const
static Table & getTable(void *ptr, Bool writable)
Function to return the internal Table object to the RegionHandler.
static ImageRegion * wmask(const String &command)
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)
RegionManager()
blank constructor
Bool removeRegionInTable(const String &tabName, const String ®Name)
Remove a region from table...refuse is regionname is "".
ImageRegion * doUnion(const ImageRegion ®1, const ImageRegion ®2) const
ImageRegion * doconcatenation(const PtrBlock< const WCRegion * > ®ions, const WCBox &box)
Record * wbox(const Vector< String > &blc, const Vector< String > &trc, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel, const String &comment)
static Record * box(const Vector< Double > &blc, const Vector< Double > &trc, const Vector< Int > &shape, const String &comment="")
LCBox box.
ImageRegion * wpolygon(const Vector< Quantity > &x, const Vector< Quantity > &y, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel)
Wpolygon with coordsys and if pixelaxes[0] is -1 then its assumed to be 0,1,...
ImageRegion * doDifference(const ImageRegion ®1, const ImageRegion ®2)
ImageRegion * doIntersection(const PtrBlock< const WCRegion * > ®1)
RegionManager(const CoordinateSystem &csys)
ImageRegion * doUnion(const WCRegion ®1, const WCRegion ®2)
Different versions of unioning regions.
ImageRegion * doUnion(const PtrBlock< const WCRegion * > ®1)
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
bool Bool
Define the standard types used by Casacore.