casacore
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::LCSlicer Class Reference

More...

#include <LCSlicer.h>

Public Member Functions

 LCSlicer ()
 
 LCSlicer (const Vector< Float > &blc, const Vector< Float > &trc, Bool fractionalBlcTrc=False, RegionType::AbsRelType=RegionType::Abs)
 Construct a slicer from the blc, trc, and stride (default 1). More...
 
 LCSlicer (const Vector< Float > &blc, const Vector< Float > &trc, const Vector< Float > &inc, Bool fractionalBlcTrc=False, RegionType::AbsRelType=RegionType::Abs)
 
 LCSlicer (const Vector< Float > &blc, const Vector< Float > &trc, const Vector< Float > &inc, const Vector< Bool > &fractionalBlc, const Vector< Bool > &fractionalTrc, const Vector< Bool > &fractionalInc, const Vector< Int > &absRelBlc, const Vector< Int > &absRelTrc)
 
 LCSlicer (const Vector< Double > &blc, const Vector< Double > &trc, Bool fractionalBlcTrc=False, RegionType::AbsRelType=RegionType::Abs)
 
 LCSlicer (const Vector< Double > &blc, const Vector< Double > &trc, const Vector< Double > &inc, Bool fractionalBlcTrc=False, RegionType::AbsRelType=RegionType::Abs)
 
 LCSlicer (const Vector< Double > &blc, const Vector< Double > &trc, const Vector< Double > &inc, const Vector< Bool > &fractionalBlc, const Vector< Bool > &fractionalTrc, const Vector< Bool > &fractionalInc, const Vector< Int > &absRelBlc, const Vector< Int > &absRelTrc)
 
 LCSlicer (const Slicer &slicer)
 
 LCSlicer (const IPosition &blc, const IPosition &trc, RegionType::AbsRelType=RegionType::Abs)
 
 LCSlicer (const IPosition &blc, const IPosition &trc, const IPosition &inc, RegionType::AbsRelType=RegionType::Abs)
 
 LCSlicer (const IPosition &blc, const IPosition &trc, const IPosition &inc, const Vector< Int > &absRelBlc, const Vector< Int > &absRelTrc)
 
 LCSlicer (const LCSlicer &other)
 Copy constructor (reference semantics). More...
 
 ~LCSlicer ()
 
LCSliceroperator= (const LCSlicer &other)
 Assignment (copy semantics). More...
 
Bool operator== (const LCSlicer &other) const
 Test for equality. More...
 
Bool operator!= (const LCSlicer &other) const
 
Bool isComplete () const
 The region is completely specified if it is absolute, not fractional, and has no unspecified values. More...
 
uInt ndim () const
 Get the dimensionality of the region. More...
 
const Vector< Float > & blc () const
 Simple accessor functions. More...
 
const Vector< Float > & trc () const
 
const Vector< Float > & inc () const
 
Bool isFractional () const
 
Bool isAbsolute () const
 
Bool isUnspecified () const
 
Bool isStrided () const
 
String type () const
 Get the region type. More...
 
const Stringcomment () const
 Get or set the comment. More...
 
void setComment (const String &comment)
 
Slicer toSlicer (const IPosition &referencePixel, const IPosition &latticeShape) const
 Make the region complete using the given reference pixel and shape. More...
 
Slicer toSlicer (const Vector< Double > &referencePixel, const IPosition &latticeShape) const
 
Slicer toSlicer (const Vector< Float > &referencePixel, const IPosition &newLatticeShape) const
 
TableRecord toRecord (const String &tableName) const
 Convert the object to a record. More...
 

Static Public Member Functions

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

Private Member Functions

void fillFlags (Bool fractional, Int absRel, uInt nrblc, uInt nrtrc, uInt nrinc)
 Fill the pixel based flags from the general ones. More...
 
void fillFromDouble (const Vector< Double > &blc, const Vector< Double > &trc, const Vector< Double > &inc)
 Fill the vectors from the values given as doubles. More...
 
void fillFromIPosition (const IPosition &blc, const IPosition &trc, const IPosition &inc)
 Fill the vectors from the values given as IPositions. More...
 
void fill ()
 Fill the remaining variables. More...
 

Private Attributes

Vector< FloatitsBlc
 
Vector< FloatitsTrc
 
Vector< FloatitsInc
 
Vector< BoolitsFracBlc
 
Vector< BoolitsFracTrc
 
Vector< BoolitsFracInc
 
Vector< IntitsAbsRelBlc
 
Vector< IntitsAbsRelTrc
 
Bool itsIsFractional
 
Bool itsIsAbsolute
 
Bool itsIsUnspecified
 
Bool itsIsStrided
 
String itsComment
 

Detailed Description

Class to define a rectangular box of interest with strides.

Intended use:

Public interface

Prerequisite

Synopsis

The LCSlicer makes it possible to define a rectangular box with strides. Note that this class is not derived from LCRegion, so it cannot be used in a compound region object like LCUnion. The reason is that strides make it impossible to use a region in a compound.
The slicer region can be defined from an Slicer object defining the blc/trc and a vector (of the same length) containing the strides. The LCSlicer can be of any type (thus relative, fractional, unspecified), while the strides can be defined as a number or a fraction.
It is also possible to construct it directly from a Slicer object,

Example

Definition at line 84 of file LCSlicer.h.

Constructor & Destructor Documentation

◆ LCSlicer() [1/12]

casacore::LCSlicer::LCSlicer ( )

◆ LCSlicer() [2/12]

casacore::LCSlicer::LCSlicer ( const Vector< Float > &  blc,
const Vector< Float > &  trc,
Bool  fractionalBlcTrc = False,
RegionType::AbsRelType  = RegionType::Abs 
)

Construct a slicer from the blc, trc, and stride (default 1).

The vectors can be different in lengths. The longest determines the dimensionality of the region. The shorter ones get padded with default values.
For each axis (or all axes) it can be defined if the blc/trc are given as pixel coordinates or as fractional values between 0 and 1. In the latter case the true pixel coordinate is derived from the image shape.
Also the region type can be given, if needed per axis.

◆ LCSlicer() [3/12]

casacore::LCSlicer::LCSlicer ( const Vector< Float > &  blc,
const Vector< Float > &  trc,
const Vector< Float > &  inc,
Bool  fractionalBlcTrc = False,
RegionType::AbsRelType  = RegionType::Abs 
)

◆ LCSlicer() [4/12]

casacore::LCSlicer::LCSlicer ( const Vector< Float > &  blc,
const Vector< Float > &  trc,
const Vector< Float > &  inc,
const Vector< Bool > &  fractionalBlc,
const Vector< Bool > &  fractionalTrc,
const Vector< Bool > &  fractionalInc,
const Vector< Int > &  absRelBlc,
const Vector< Int > &  absRelTrc 
)

◆ LCSlicer() [5/12]

casacore::LCSlicer::LCSlicer ( const Vector< Double > &  blc,
const Vector< Double > &  trc,
Bool  fractionalBlcTrc = False,
RegionType::AbsRelType  = RegionType::Abs 
)

◆ LCSlicer() [6/12]

casacore::LCSlicer::LCSlicer ( const Vector< Double > &  blc,
const Vector< Double > &  trc,
const Vector< Double > &  inc,
Bool  fractionalBlcTrc = False,
RegionType::AbsRelType  = RegionType::Abs 
)

◆ LCSlicer() [7/12]

casacore::LCSlicer::LCSlicer ( const Vector< Double > &  blc,
const Vector< Double > &  trc,
const Vector< Double > &  inc,
const Vector< Bool > &  fractionalBlc,
const Vector< Bool > &  fractionalTrc,
const Vector< Bool > &  fractionalInc,
const Vector< Int > &  absRelBlc,
const Vector< Int > &  absRelTrc 
)

◆ LCSlicer() [8/12]

casacore::LCSlicer::LCSlicer ( const Slicer slicer)

◆ LCSlicer() [9/12]

casacore::LCSlicer::LCSlicer ( const IPosition blc,
const IPosition trc,
RegionType::AbsRelType  = RegionType::Abs 
)

◆ LCSlicer() [10/12]

casacore::LCSlicer::LCSlicer ( const IPosition blc,
const IPosition trc,
const IPosition inc,
RegionType::AbsRelType  = RegionType::Abs 
)

◆ LCSlicer() [11/12]

casacore::LCSlicer::LCSlicer ( const IPosition blc,
const IPosition trc,
const IPosition inc,
const Vector< Int > &  absRelBlc,
const Vector< Int > &  absRelTrc 
)

◆ LCSlicer() [12/12]

casacore::LCSlicer::LCSlicer ( const LCSlicer other)

Copy constructor (reference semantics).

◆ ~LCSlicer()

casacore::LCSlicer::~LCSlicer ( )

Member Function Documentation

◆ blc()

const Vector< Float > & casacore::LCSlicer::blc ( ) const
inline

Simple accessor functions.

Definition at line 254 of file LCSlicer.h.

References itsBlc.

◆ className()

static String casacore::LCSlicer::className ( )
static

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

◆ comment()

const String & casacore::LCSlicer::comment ( ) const
inline

Get or set the comment.

Definition at line 282 of file LCSlicer.h.

References itsComment.

Referenced by setComment().

◆ fill()

void casacore::LCSlicer::fill ( )
private

Fill the remaining variables.

It also adjust the lengths of the vectors if they are different. Check if everything is given correctly.

◆ fillFlags()

void casacore::LCSlicer::fillFlags ( Bool  fractional,
Int  absRel,
uInt  nrblc,
uInt  nrtrc,
uInt  nrinc 
)
private

Fill the pixel based flags from the general ones.

◆ fillFromDouble()

void casacore::LCSlicer::fillFromDouble ( const Vector< Double > &  blc,
const Vector< Double > &  trc,
const Vector< Double > &  inc 
)
private

Fill the vectors from the values given as doubles.

◆ fillFromIPosition()

void casacore::LCSlicer::fillFromIPosition ( const IPosition blc,
const IPosition trc,
const IPosition inc 
)
private

Fill the vectors from the values given as IPositions.

◆ fromRecord()

static LCSlicer* casacore::LCSlicer::fromRecord ( const TableRecord ,
const String tablename 
)
static

Convert to correct object from a record.

◆ inc()

const Vector< Float > & casacore::LCSlicer::inc ( ) const
inline

Definition at line 262 of file LCSlicer.h.

References itsInc.

◆ isAbsolute()

Bool casacore::LCSlicer::isAbsolute ( ) const
inline

Definition at line 270 of file LCSlicer.h.

References itsIsAbsolute.

◆ isComplete()

Bool casacore::LCSlicer::isComplete ( ) const

The region is completely specified if it is absolute, not fractional, and has no unspecified values.

◆ isFractional()

Bool casacore::LCSlicer::isFractional ( ) const
inline

Definition at line 266 of file LCSlicer.h.

References itsIsFractional.

◆ isStrided()

Bool casacore::LCSlicer::isStrided ( ) const
inline

Definition at line 278 of file LCSlicer.h.

References itsIsStrided.

◆ isUnspecified()

Bool casacore::LCSlicer::isUnspecified ( ) const
inline

Definition at line 274 of file LCSlicer.h.

References itsIsUnspecified.

◆ ndim()

uInt casacore::LCSlicer::ndim ( ) const
inline

Get the dimensionality of the region.

Definition at line 250 of file LCSlicer.h.

References itsBlc, and casacore::ArrayBase::nelements().

◆ operator!=()

Bool casacore::LCSlicer::operator!= ( const LCSlicer other) const
inline

Definition at line 246 of file LCSlicer.h.

◆ operator=()

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

Assignment (copy semantics).

◆ operator==()

Bool casacore::LCSlicer::operator== ( const LCSlicer other) const

Test for equality.

True is returned when the given region is a slicer with exactly the same specification as this slicer. It does not compare the comment.

◆ setComment()

void casacore::LCSlicer::setComment ( const String comment)
inline

Definition at line 286 of file LCSlicer.h.

References comment(), and itsComment.

◆ toRecord()

TableRecord casacore::LCSlicer::toRecord ( const String tableName) const

Convert the object to a record.

◆ toSlicer() [1/3]

Slicer casacore::LCSlicer::toSlicer ( const IPosition referencePixel,
const IPosition latticeShape 
) const

Make the region complete using the given reference pixel and shape.

It returns a new region where the relative regions are made absolute by translating them with respect to the reference pixel. Furthermore unspecified values are filled in and fractional values are turned into absolute ones.

◆ toSlicer() [2/3]

Slicer casacore::LCSlicer::toSlicer ( const Vector< Double > &  referencePixel,
const IPosition latticeShape 
) const

◆ toSlicer() [3/3]

Slicer casacore::LCSlicer::toSlicer ( const Vector< Float > &  referencePixel,
const IPosition newLatticeShape 
) const

◆ trc()

const Vector< Float > & casacore::LCSlicer::trc ( ) const
inline

Definition at line 258 of file LCSlicer.h.

References itsTrc.

◆ type()

String casacore::LCSlicer::type ( ) const

Get the region type.

Returns className().

Member Data Documentation

◆ itsAbsRelBlc

Vector<Int> casacore::LCSlicer::itsAbsRelBlc
private

Definition at line 236 of file LCSlicer.h.

◆ itsAbsRelTrc

Vector<Int> casacore::LCSlicer::itsAbsRelTrc
private

Definition at line 237 of file LCSlicer.h.

◆ itsBlc

Vector<Float> casacore::LCSlicer::itsBlc
private

Definition at line 230 of file LCSlicer.h.

Referenced by blc(), and ndim().

◆ itsComment

String casacore::LCSlicer::itsComment
private

Definition at line 242 of file LCSlicer.h.

Referenced by comment(), and setComment().

◆ itsFracBlc

Vector<Bool> casacore::LCSlicer::itsFracBlc
private

Definition at line 233 of file LCSlicer.h.

◆ itsFracInc

Vector<Bool> casacore::LCSlicer::itsFracInc
private

Definition at line 235 of file LCSlicer.h.

◆ itsFracTrc

Vector<Bool> casacore::LCSlicer::itsFracTrc
private

Definition at line 234 of file LCSlicer.h.

◆ itsInc

Vector<Float> casacore::LCSlicer::itsInc
private

Definition at line 232 of file LCSlicer.h.

Referenced by inc().

◆ itsIsAbsolute

Bool casacore::LCSlicer::itsIsAbsolute
private

Definition at line 239 of file LCSlicer.h.

Referenced by isAbsolute().

◆ itsIsFractional

Bool casacore::LCSlicer::itsIsFractional
private

Definition at line 238 of file LCSlicer.h.

Referenced by isFractional().

◆ itsIsStrided

Bool casacore::LCSlicer::itsIsStrided
private

Definition at line 241 of file LCSlicer.h.

Referenced by isStrided().

◆ itsIsUnspecified

Bool casacore::LCSlicer::itsIsUnspecified
private

Definition at line 240 of file LCSlicer.h.

Referenced by isUnspecified().

◆ itsTrc

Vector<Float> casacore::LCSlicer::itsTrc
private

Definition at line 231 of file LCSlicer.h.

Referenced by trc().


The documentation for this class was generated from the following file: