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. | |
| 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 |
| Interpolate2D * | itsInterpPtr |
| Method | itsMethod |
| Vector< Float > | itsX |
| Vector< Float > | itsY |
| Vector< Double > | itsPos |
| uInt | itsAxis0 |
| uInt | itsAxis1 |
Extract a 1-D slice from a Lattice.
Public interface
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:
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);
Users often want to see cross-cuts through their data.
Definition at line 94 of file LatticeSlice1D.h.
| enum casacore::LatticeSlice1D::Method |
Interpolation method.
Definition at line 99 of file LatticeSlice1D.h.
| casacore::LatticeSlice1D< T >::LatticeSlice1D | ( | ) |
Default constructor - object useless.
| casacore::LatticeSlice1D< T >::LatticeSlice1D | ( | const MaskedLattice< T > & | lattice, | |
| Method | method = LINEAR | |||
| ) |
Constructor.
| casacore::LatticeSlice1D< T >::LatticeSlice1D | ( | const LatticeSlice1D< T > & | other | ) |
Copy constructor (reference semantics).
| virtual casacore::LatticeSlice1D< T >::~LatticeSlice1D | ( | ) | [virtual] |
Destructor.
| void casacore::LatticeSlice1D< T >::checkCurve | ( | IPosition & | blc, | |
| IPosition & | trc, | |||
| const IPosition & | coord, | |||
| const PixelCurve1D & | curve | |||
| ) | [private] |
Check the suppliec curve is valid.
| 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.
| void casacore::LatticeSlice1D< T >::findPlane | ( | const IPosition & | blc, | |
| const IPosition & | trc | |||
| ) | [private] |
Find the slice plane.
| 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
| 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.
| 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.
| Method casacore::LatticeSlice1D< T >::interpolationMethod | ( | ) | const [inline] |
Recover interpolation method.
Definition at line 135 of file LatticeSlice1D.h.
References casacore::LatticeSlice1D< T >::itsMethod.
| void casacore::LatticeSlice1D< T >::makeInterpolator | ( | Method | method | ) | [private] |
Make Interpolator.
| LatticeSlice1D<T>& casacore::LatticeSlice1D< T >::operator= | ( | const LatticeSlice1D< T > & | other | ) |
Assignment operator (reference semantics).
| static Method casacore::LatticeSlice1D< T >::stringToMethod | ( | const String & | method | ) | [static] |
uInt casacore::LatticeSlice1D< T >::itsAxis0 [private] |
Definition at line 160 of file LatticeSlice1D.h.
uInt casacore::LatticeSlice1D< T >::itsAxis1 [private] |
Definition at line 161 of file LatticeSlice1D.h.
Interpolate2D* casacore::LatticeSlice1D< T >::itsInterpPtr [private] |
Definition at line 155 of file LatticeSlice1D.h.
MaskedLattice<T>* casacore::LatticeSlice1D< T >::itsLatticePtr [private] |
Definition at line 154 of file LatticeSlice1D.h.
Method casacore::LatticeSlice1D< T >::itsMethod [private] |
Definition at line 156 of file LatticeSlice1D.h.
Referenced by casacore::LatticeSlice1D< T >::interpolationMethod().
Vector<Double> casacore::LatticeSlice1D< T >::itsPos [private] |
Definition at line 159 of file LatticeSlice1D.h.
Vector<Float> casacore::LatticeSlice1D< T >::itsX [private] |
Definition at line 157 of file LatticeSlice1D.h.
Vector<Float> casacore::LatticeSlice1D< T >::itsY [private] |
Definition at line 158 of file LatticeSlice1D.h.
1.6.1