iRoCS Toolbox  1.1.0
Public Member Functions | Protected Attributes
atb::NearestInterpolator< DataT, Dim > Class Template Reference

The NearestInterpolator class provides sub-pixel access to blitz++ Arrays using the nearest neighbor startegy. More...

#include "libArrayToolbox/Interpolator.hh"

Inheritance diagram for atb::NearestInterpolator< DataT, Dim >:
Collaboration diagram for atb::NearestInterpolator< DataT, Dim >:

Public Member Functions

 NearestInterpolator (BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Constructor. More...
 
 NearestInterpolator (NearestInterpolator< DataT, Dim > const &ip)
 Copy Constructor. More...
 
 ~NearestInterpolator ()
 Destructor. More...
 
BoundaryTreatment< DataT, Dim > const & boundaryTreatment () const
 Get a read-only reference to the Interpolator's boundary treatment object. More...
 
BoundaryTreatment< DataT, Dim > & boundaryTreatment ()
 Get a random-access reference to the Interpolator's boundary treatment object. More...
 
Interpolator< DataT, Dim > * clone () const
 Get a deep copy of this Interpolator object. More...
 
DataT get (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &pos) const
 Get the Array value at the given subpixel position. More...
 
NearestInterpolator< DataT, Dim > & operator= (NearestInterpolator< DataT, Dim > const &ip)
 Copy assignment operator. More...
 
void setBoundaryTreatment (BoundaryTreatmentType bt, DataT const &boundaryValue=traits< DataT >::zero)
 Set the Interpolator's boundary treatment type. More...
 
InterpolationType type () const
 Get the corresponding enumeration value for the interpolation type. More...
 

Protected Attributes

BoundaryTreatment< DataT, Dim > * p_bt
 

Detailed Description

template<typename DataT, int Dim>
class atb::NearestInterpolator< DataT, Dim >

The NearestInterpolator class provides sub-pixel access to blitz++ Arrays using the nearest neighbor startegy.

See also
BoundaryTreatment, ValueBoundaryTreatment, CyclicBoundaryTreatment, RepeatBoundaryTreatment, MirrorBoundaryTreatment, CropBoundaryTreatment

Definition at line 222 of file Interpolator.hh.

Constructor & Destructor Documentation

◆ NearestInterpolator() [1/2]

template<typename DataT, int Dim>
atb::NearestInterpolator< DataT, Dim >::NearestInterpolator ( BoundaryTreatmentType  bt = ValueBT,
DataT const &  boundaryValue = traits< DataT >::zero 
)

Constructor.

Parameters
btThe boundary treatment to apply when out-of-Array positions are requested.
boundaryValueThe default out-of-Array value (for ValueBT)

◆ NearestInterpolator() [2/2]

template<typename DataT, int Dim>
atb::NearestInterpolator< DataT, Dim >::NearestInterpolator ( NearestInterpolator< DataT, Dim > const &  ip)

Copy Constructor.

Parameters
ipThe Interpolator object to copy

◆ ~NearestInterpolator()

template<typename DataT, int Dim>
atb::NearestInterpolator< DataT, Dim >::~NearestInterpolator ( )

Destructor.

Member Function Documentation

◆ operator=()

template<typename DataT, int Dim>
NearestInterpolator<DataT,Dim>& atb::NearestInterpolator< DataT, Dim >::operator= ( NearestInterpolator< DataT, Dim > const &  ip)

Copy assignment operator.

Parameters
ipThe Interpolator object to copy
Returns
A reference to this Interpolator object for operator chaining

◆ clone()

template<typename DataT, int Dim>
Interpolator<DataT,Dim>* atb::NearestInterpolator< DataT, Dim >::clone ( ) const
virtual

Get a deep copy of this Interpolator object.

return A deep copy of this Interpolator object

Implements atb::Interpolator< DataT, Dim >.

◆ type()

template<typename DataT, int Dim>
InterpolationType atb::NearestInterpolator< DataT, Dim >::type ( ) const
virtual

Get the corresponding enumeration value for the interpolation type.

Returns
NearestIP

Implements atb::Interpolator< DataT, Dim >.

◆ get()

template<typename DataT, int Dim>
DataT atb::NearestInterpolator< DataT, Dim >::get ( blitz::Array< DataT, Dim > const &  data,
blitz::TinyVector< double, Dim > const &  pos 
) const
virtual

Get the Array value at the given subpixel position.

With this interpolator the value of the nearest integer position will be returned after application of the boundary treatment given.

Parameters
dataThe Array to get a value from
posThe position
Returns
The value at the position closest to the sub-pixel position given

Implements atb::Interpolator< DataT, Dim >.

◆ boundaryTreatment() [1/2]

template<typename DataT, int Dim>
BoundaryTreatment<DataT,Dim> const& atb::Interpolator< DataT, Dim >::boundaryTreatment ( ) const
inherited

Get a read-only reference to the Interpolator's boundary treatment object.

Returns
A reference to the BoundaryTreatment object associated with this Interpolator

◆ boundaryTreatment() [2/2]

template<typename DataT, int Dim>
BoundaryTreatment<DataT,Dim>& atb::Interpolator< DataT, Dim >::boundaryTreatment ( )
inherited

Get a random-access reference to the Interpolator's boundary treatment object.

Returns
A reference to the BoundaryTreatment object associated with this Interpolator

◆ setBoundaryTreatment()

template<typename DataT, int Dim>
void atb::Interpolator< DataT, Dim >::setBoundaryTreatment ( BoundaryTreatmentType  bt,
DataT const &  boundaryValue = traits< DataT >::zero 
)
inherited

Set the Interpolator's boundary treatment type.

Parameters
btThe new boundary treatment type
boundaryValueThe default out-of-Array value (for ValueBT)

Field Documentation

◆ p_bt

template<typename DataT, int Dim>
BoundaryTreatment<DataT,Dim>* atb::Interpolator< DataT, Dim >::p_bt
protectedinherited

Definition at line 207 of file Interpolator.hh.


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