casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::LatticeSlice1D< T > Class Template Reference

Extract a 1-D slice from a Lattice. More...

#include <LatticeSlice1D.h>

Public Types

enum  Method {
  NEAREST,
  LINEAR,
  CUBIC,
  N_TYPES
}
 Interpolation method. More...
 

Public Member Functions

 LatticeSlice1D ()
 Default constructor - object useless. More...
 
 LatticeSlice1D (const MaskedLattice< T > &lattice, Method method=LINEAR)
 Constructor. More...
 
 LatticeSlice1D (const LatticeSlice1D< T > &other)
 Copy constructor (reference semantics) More...
 
virtual ~LatticeSlice1D ()
 Destructor. More...
 
LatticeSlice1D< T > & operator= (const LatticeSlice1D< T > &other)
 Assignment operator (reference semantics) More...
 
void getSlice (Vector< T > &data, Vector< Bool > &mask, const PixelCurve1D &curve, uInt axis0, uInt axis1, const IPosition &coord)
 Get 1-D slice. More...
 
void getSlice (Vector< T > &data, Vector< Bool > &mask, const IPosition &blc, const IPosition &trc, uInt nPts=0)
 Get 1-D slice between blc & trc. More...
 
void getPosition (uInt &axis0, uInt &axis1, Vector< Float > &x, Vector< Float > &y, Vector< Float > &distance) const
 Get the (x,y) pixel coordinates from the last slice and the distance along the slice in pixels. More...
 
Method interpolationMethod () const
 Recover interpolation method. More...
 

Static Public Member Functions

static Method stringToMethod (const String &method)
 

Private Member Functions

void checkCurve (IPosition &blc, IPosition &trc, const IPosition &coord, const PixelCurve1D &curve)
 Check the suppliec curve is valid. More...
 
void findPlane (const IPosition &blc, const IPosition &trc)
 Find the slice plane. More...
 
void doGetSlice (Vector< T > &data, Vector< Bool > &mask, const PixelCurve1D &curve, const IPosition &blc, const IPosition &trc)
 Get the interpolated slice. More...
 
void makeInterpolator (Method method)
 Make Interpolator. More...
 

Private Attributes

MaskedLattice< T > * itsLatticePtr
 
Interpolate2DitsInterpPtr
 
Method itsMethod
 
Vector< FloatitsX
 
Vector< FloatitsY
 
Vector< DoubleitsPos
 
uInt itsAxis0
 
uInt itsAxis1
 

Detailed Description

template<class T>
class casacore::LatticeSlice1D< T >

Extract a 1-D slice from a Lattice.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
test/tLatticeSlice1D

Prerequisite

Etymology

Synopsis

This class extracts an interpolated 1-D slice from a Lattice with a range of interpolation schemes available. The slice must lie in the plane of two cardinal axes.


Tip:

Example

IPosition shape(2, 20, 30); // Create MaskedLattice
ArrayLattice<Float> arrLat(shape);
SubLattice<Float> subLat(arrLat);
LatticeSlice1D<Float> slicer(subLat);
IPosition blc(2); blc = 0; // Extract slice between corners
IPosition trc(shape-1);
Vector<Float> data;
Vector<Bool> mask;
slicer.getSlice (data, mask, blc, trc);

Motivation

Users often want to see cross-cuts through their data.

To Do

Definition at line 94 of file LatticeSlice1D.h.

Member Enumeration Documentation

template<class T>
enum casacore::LatticeSlice1D::Method

Interpolation method.

Enumerator
NEAREST 
LINEAR 
CUBIC 
N_TYPES 

Definition at line 99 of file LatticeSlice1D.h.

Constructor & Destructor Documentation

template<class T>
casacore::LatticeSlice1D< T >::LatticeSlice1D ( )

Default constructor - object useless.

template<class T>
casacore::LatticeSlice1D< T >::LatticeSlice1D ( const MaskedLattice< T > &  lattice,
Method  method = LINEAR 
)

Constructor.

template<class T>
casacore::LatticeSlice1D< T >::LatticeSlice1D ( const LatticeSlice1D< T > &  other)

Copy constructor (reference semantics)

template<class T>
virtual casacore::LatticeSlice1D< T >::~LatticeSlice1D ( )
virtual

Destructor.

Member Function Documentation

template<class T>
void casacore::LatticeSlice1D< T >::checkCurve ( IPosition blc,
IPosition trc,
const IPosition coord,
const PixelCurve1D curve 
)
private

Check the suppliec curve is valid.

template<class T>
void casacore::LatticeSlice1D< T >::doGetSlice ( Vector< T > &  data,
Vector< Bool > &  mask,
const PixelCurve1D curve,
const IPosition blc,
const IPosition trc 
)
private

Get the interpolated slice.

template<class T>
void casacore::LatticeSlice1D< T >::findPlane ( const IPosition blc,
const IPosition trc 
)
private

Find the slice plane.

template<class T>
void casacore::LatticeSlice1D< T >::getPosition ( uInt axis0,
uInt axis1,
Vector< Float > &  x,
Vector< Float > &  y,
Vector< Float > &  distance 
) const

Get the (x,y) pixel coordinates from the last slice and the distance along the slice in pixels.

. Also recover the axes of the slice plane

template<class T>
void casacore::LatticeSlice1D< T >::getSlice ( Vector< T > &  data,
Vector< Bool > &  mask,
const PixelCurve1D curve,
uInt  axis0,
uInt  axis1,
const IPosition coord 
)

Get 1-D slice.

PixelCurve1D supplies the locus of the slice in the plane specified by axis0 and axis1. The pixel coordinate for the rest of the lattice is specified in coord.

template<class T>
void casacore::LatticeSlice1D< T >::getSlice ( Vector< T > &  data,
Vector< Bool > &  mask,
const IPosition blc,
const IPosition trc,
uInt  nPts = 0 
)

Get 1-D slice between blc & trc.

These start and end points must be in a cardinal plane of the lattice. If nPts is 0 it is set automatically to the length of the slice.

template<class T>
Method casacore::LatticeSlice1D< T >::interpolationMethod ( ) const
inline

Recover interpolation method.

Definition at line 135 of file LatticeSlice1D.h.

References casacore::LatticeSlice1D< T >::itsMethod.

template<class T>
void casacore::LatticeSlice1D< T >::makeInterpolator ( Method  method)
private

Make Interpolator.

template<class T>
LatticeSlice1D<T>& casacore::LatticeSlice1D< T >::operator= ( const LatticeSlice1D< T > &  other)

Assignment operator (reference semantics)

template<class T>
static Method casacore::LatticeSlice1D< T >::stringToMethod ( const String method)
static

Member Data Documentation

template<class T>
uInt casacore::LatticeSlice1D< T >::itsAxis0
private

Definition at line 160 of file LatticeSlice1D.h.

template<class T>
uInt casacore::LatticeSlice1D< T >::itsAxis1
private

Definition at line 161 of file LatticeSlice1D.h.

template<class T>
Interpolate2D* casacore::LatticeSlice1D< T >::itsInterpPtr
private

Definition at line 155 of file LatticeSlice1D.h.

template<class T>
MaskedLattice<T>* casacore::LatticeSlice1D< T >::itsLatticePtr
private

Definition at line 154 of file LatticeSlice1D.h.

template<class T>
Method casacore::LatticeSlice1D< T >::itsMethod
private
template<class T>
Vector<Double> casacore::LatticeSlice1D< T >::itsPos
private

Definition at line 159 of file LatticeSlice1D.h.

template<class T>
Vector<Float> casacore::LatticeSlice1D< T >::itsX
private

Definition at line 157 of file LatticeSlice1D.h.

template<class T>
Vector<Float> casacore::LatticeSlice1D< T >::itsY
private

Definition at line 158 of file LatticeSlice1D.h.


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