casacore::LCEllipsoid Class Reference

Define an N-dimensional ellipsoidal region of interest. More...

#include <LCEllipsoid.h>

Inheritance diagram for casacore::LCEllipsoid:
casacore::LCRegionFixed casacore::LCRegionSingle casacore::LCRegion casacore::Lattice< Bool > casacore::LatticeBase

List of all members.

Public Member Functions

 LCEllipsoid ()
 LCEllipsoid (const IPosition &center, Float radius, const IPosition &latticeShape)
 Construct an N-dimensional sphere with the given center and radius (in pixels).
 LCEllipsoid (const Vector< Float > &center, Float radius, const IPosition &latticeShape)
 Construct an N-dimensional sphere with the given center and radius (in pixels).
 LCEllipsoid (const Vector< Double > &center, Double radius, const IPosition &latticeShape)
 LCEllipsoid (const Vector< Float > &center, const Vector< Float > &radii, const IPosition &latticeShape)
 Construct an N-dimensional ellipsoid with the given center and radii (in pixels).
 LCEllipsoid (const Vector< Double > &center, const Vector< Double > &radii, const IPosition &latticeShape)
 LCEllipsoid (const Float xcenter, const Float ycenter, const Float majorAxis, const Float minorAxis, const Float theta, const IPosition &latticeShape)
 Construct a two dimensional ellipse with theta being the angle from the x-axis to the major axis of the ellipse in radians.
 LCEllipsoid (const LCEllipsoid &other)
 Copy constructor (reference semantics).
virtual ~LCEllipsoid ()
LCEllipsoidoperator= (const LCEllipsoid &other)
 Assignment (copy semantics).
virtual Bool operator== (const LCRegion &other) const
 Comparison.
virtual LCRegioncloneRegion () const
 Make a copy of the derived object.
const Vector< Float > & center () const
 Get the center.
const Vector< Float > & radii () const
 Get the radii.
const Floattheta () const
 Get the angle of the major axis of the ellipse relative to the x-axis 2-D only, throws exception if ellipse is not 2-D.
virtual String type () const
 Get the region type.
virtual TableRecord toRecord (const String &tableName) const
 Convert the (derived) object to a record.

Static Public Member Functions

static String className ()
 Get the class name (to store in the record).
static LCEllipsoidfromRecord (const TableRecord &, const String &tableName)
 Convert correct object from a record.

Protected Member Functions

virtual LCRegiondoTranslate (const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
 Construct another LCBox (for e.g.

Private Member Functions

void fillCenter (const IPosition &center)
 Fill the itsCenter vector from an IPosition.
Slicer makeBox (const Vector< Float > &radii, const IPosition &latticeShape)
 Make the bounding box from center, radii, and shape.
void defineMask ()
 Define the mask to indicate which elements are inside the ellipsoid.
void _defineMask2D ()
 for 2-D ellipse with non-zero theta.
void _doOutside ()
 set the mask in the case the center lies outside the lattice

Private Attributes

Vector< FloatitsCenter
Vector< FloatitsRadii
Vector< Float_epsilon
 small offset to guard against roundoff error
Float _theta
 for 2-D case only
Bool _centerIsInside
 is center inside the lattice?

Detailed Description

Define an N-dimensional ellipsoidal region of interest.

Intended use:

Public interface

Prerequisite

Synopsis

The LCEllipsoid class is a specialization of class LCRegion . It makes it possible to define an N-dimensional ellipsoidal region of interest, which includes the border. A separate constructor exists to define the special case of an N-dimensional sphere.
The center and the radii of the ellipsoid do not need to be pixel aligned. The center of the ellipsoid may be outside the lattice. The current implementation only supports ellipsoids with axes parallel to the lattice axes except in the case of a 2-D ellipse for which a constructor is provided for specifying the angle between the x-axis and major axis of the ellipse.

It can only be used for a lattice of any dimensionality as long as the dimensionality of the (hyper-)ellipsoid matches the dimensionality of the lattice.

Example

To Do

Definition at line 83 of file LCEllipsoid.h.


Constructor & Destructor Documentation

casacore::LCEllipsoid::LCEllipsoid (  ) 
casacore::LCEllipsoid::LCEllipsoid ( const IPosition center,
Float  radius,
const IPosition latticeShape 
)

Construct an N-dimensional sphere with the given center and radius (in pixels).

The center is pixel-aligned.

casacore::LCEllipsoid::LCEllipsoid ( const Vector< Float > &  center,
Float  radius,
const IPosition latticeShape 
)

Construct an N-dimensional sphere with the given center and radius (in pixels).

The center does not need to be pixel-aligned.

casacore::LCEllipsoid::LCEllipsoid ( const Vector< Double > &  center,
Double  radius,
const IPosition latticeShape 
)
casacore::LCEllipsoid::LCEllipsoid ( const Vector< Float > &  center,
const Vector< Float > &  radii,
const IPosition latticeShape 
)

Construct an N-dimensional ellipsoid with the given center and radii (in pixels).

The center does not need to be pixel-aligned. (the radii are half the length of the axes of the ellipsoid).

casacore::LCEllipsoid::LCEllipsoid ( const Vector< Double > &  center,
const Vector< Double > &  radii,
const IPosition latticeShape 
)
casacore::LCEllipsoid::LCEllipsoid ( const Float  xcenter,
const Float  ycenter,
const Float  majorAxis,
const Float  minorAxis,
const Float  theta,
const IPosition latticeShape 
)

Construct a two dimensional ellipse with theta being the angle from the x-axis to the major axis of the ellipse in radians.

casacore::LCEllipsoid::LCEllipsoid ( const LCEllipsoid other  ) 

Copy constructor (reference semantics).

virtual casacore::LCEllipsoid::~LCEllipsoid (  )  [virtual]

Member Function Documentation

void casacore::LCEllipsoid::_defineMask2D (  )  [private]

for 2-D ellipse with non-zero theta.

Works for both cases center inside or outside the lattice.

void casacore::LCEllipsoid::_doOutside (  )  [private]

set the mask in the case the center lies outside the lattice

const Vector< Float > & casacore::LCEllipsoid::center (  )  const [inline]

Get the center.

Definition at line 193 of file LCEllipsoid.h.

References itsCenter.

static String casacore::LCEllipsoid::className (  )  [static]

Get the class name (to store in the record).

virtual LCRegion* casacore::LCEllipsoid::cloneRegion (  )  const [virtual]

Make a copy of the derived object.

Implements casacore::LCRegion.

void casacore::LCEllipsoid::defineMask (  )  [private]

Define the mask to indicate which elements are inside the ellipsoid.

virtual LCRegion* casacore::LCEllipsoid::doTranslate ( const Vector< Float > &  translateVector,
const IPosition newLatticeShape 
) const [protected, virtual]

Construct another LCBox (for e.g.

another lattice) by moving this one. It recalculates the bounding box. A positive translation value indicates "to right".

Implements casacore::LCRegion.

void casacore::LCEllipsoid::fillCenter ( const IPosition center  )  [private]

Fill the itsCenter vector from an IPosition.

static LCEllipsoid* casacore::LCEllipsoid::fromRecord ( const TableRecord ,
const String tableName 
) [static]

Convert correct object from a record.

Reimplemented from casacore::LCRegion.

Slicer casacore::LCEllipsoid::makeBox ( const Vector< Float > &  radii,
const IPosition latticeShape 
) [private]

Make the bounding box from center, radii, and shape.

LCEllipsoid& casacore::LCEllipsoid::operator= ( const LCEllipsoid other  ) 

Assignment (copy semantics).

Reimplemented from casacore::LCRegionFixed.

virtual Bool casacore::LCEllipsoid::operator== ( const LCRegion other  )  const [virtual]

Comparison.

Reimplemented from casacore::LCRegionFixed.

const Vector< Float > & casacore::LCEllipsoid::radii (  )  const [inline]

Get the radii.

Definition at line 197 of file LCEllipsoid.h.

References itsRadii.

const Float& casacore::LCEllipsoid::theta (  )  const

Get the angle of the major axis of the ellipse relative to the x-axis 2-D only, throws exception if ellipse is not 2-D.

virtual TableRecord casacore::LCEllipsoid::toRecord ( const String tableName  )  const [virtual]

Convert the (derived) object to a record.

Implements casacore::LCRegion.

virtual String casacore::LCEllipsoid::type (  )  const [virtual]

Get the region type.

Returns className()

Implements casacore::LCRegion.


Member Data Documentation

is center inside the lattice?

Definition at line 189 of file LCEllipsoid.h.

small offset to guard against roundoff error

Definition at line 185 of file LCEllipsoid.h.

for 2-D case only

Definition at line 187 of file LCEllipsoid.h.

Definition at line 182 of file LCEllipsoid.h.

Referenced by center().

Definition at line 183 of file LCEllipsoid.h.

Referenced by radii().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1