casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
casa::LatticeSlice1D< T > Class Template Reference

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

#include <LatticeSlice1D.h>

List of all members.

Public Types

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

Public Member Functions

 LatticeSlice1D ()
 Default constructor - object useless.
 LatticeSlice1D (const MaskedLattice< T > &lattice, Method method=LINEAR)
 Constructor.
 LatticeSlice1D (const LatticeSlice1D< T > &other)
 Copy constructor (reference semantics)
virtual ~LatticeSlice1D ()
 Destructor.
LatticeSlice1D< T > & operator= (const LatticeSlice1D< T > &other)
 Assignment operator (reference semantics)
void getSlice (Vector< T > &data, Vector< Bool > &mask, const PixelCurve1D &curve, uInt axis0, uInt axis1, const IPosition &coord)
 Get 1-D slice.
void getSlice (Vector< T > &data, Vector< Bool > &mask, const IPosition &blc, const IPosition &trc, uInt nPts=0)
 Get 1-D slice between blc & trc.
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.
Method interpolationMethod () const
 Recover interpolation method.

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.
void findPlane (const IPosition &blc, const IPosition &trc)
 Find the slice plane.
void doGetSlice (Vector< T > &data, Vector< Bool > &mask, const PixelCurve1D &curve, const IPosition &blc, const IPosition &trc)
 Get the interpolated slice.
void makeInterpolator (Method method)
 Make Interpolator.

Private Attributes

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

Detailed Description

template<class T>
class casa::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 casa::LatticeSlice1D::Method

Interpolation method.

Enumerator:
NEAREST 
LINEAR 
CUBIC 
N_TYPES 

Definition at line 99 of file LatticeSlice1D.h.


Constructor & Destructor Documentation

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

Default constructor - object useless.

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

Constructor.

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

Copy constructor (reference semantics)

template<class T>
virtual casa::LatticeSlice1D< T >::~LatticeSlice1D ( ) [virtual]

Destructor.


Member Function Documentation

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

Check the suppliec curve is valid.

template<class T>
void casa::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 casa::LatticeSlice1D< T >::findPlane ( const IPosition blc,
const IPosition trc 
) [private]

Find the slice plane.

template<class T>
void casa::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 casa::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 casa::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 casa::LatticeSlice1D< T >::interpolationMethod ( ) const [inline]

Recover interpolation method.

Definition at line 135 of file LatticeSlice1D.h.

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

template<class T>
void casa::LatticeSlice1D< T >::makeInterpolator ( Method  method) [private]

Make Interpolator.

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

Assignment operator (reference semantics)

template<class T>
static Method casa::LatticeSlice1D< T >::stringToMethod ( const String method) [static]

Member Data Documentation

template<class T>
uInt casa::LatticeSlice1D< T >::itsAxis0 [private]

Definition at line 160 of file LatticeSlice1D.h.

template<class T>
uInt casa::LatticeSlice1D< T >::itsAxis1 [private]

Definition at line 161 of file LatticeSlice1D.h.

template<class T>
Interpolate2D* casa::LatticeSlice1D< T >::itsInterpPtr [private]

Definition at line 155 of file LatticeSlice1D.h.

template<class T>
MaskedLattice<T>* casa::LatticeSlice1D< T >::itsLatticePtr [private]

Definition at line 154 of file LatticeSlice1D.h.

template<class T>
Method casa::LatticeSlice1D< T >::itsMethod [private]

Definition at line 156 of file LatticeSlice1D.h.

Referenced by casa::LatticeSlice1D< T >::interpolationMethod().

template<class T>
Vector<Double> casa::LatticeSlice1D< T >::itsPos [private]

Definition at line 159 of file LatticeSlice1D.h.

template<class T>
Vector<Float> casa::LatticeSlice1D< T >::itsX [private]

Definition at line 157 of file LatticeSlice1D.h.

template<class T>
Vector<Float> casa::LatticeSlice1D< T >::itsY [private]

Definition at line 158 of file LatticeSlice1D.h.


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