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

The LinearInterpolator class provides sub-pixel access to blitz++ Arrays using linear interpolation. More...

#include "libArrayToolbox/Interpolator.hh"

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

Public Member Functions

 LinearInterpolator (BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Constructor. More...
 
 LinearInterpolator (LinearInterpolator< DataT, Dim > const &ip)
 Copy Constructor. More...
 
 ~LinearInterpolator ()
 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...
 
LinearInterpolator< DataT, Dim > & operator= (LinearInterpolator< 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::LinearInterpolator< DataT, Dim >

The LinearInterpolator class provides sub-pixel access to blitz++ Arrays using linear interpolation.

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

Definition at line 315 of file Interpolator.hh.

Constructor & Destructor Documentation

◆ LinearInterpolator() [1/2]

template<typename DataT, int Dim>
atb::LinearInterpolator< DataT, Dim >::LinearInterpolator ( 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)

◆ LinearInterpolator() [2/2]

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

Copy Constructor.

Parameters
ipThe Interpolator object to copy

◆ ~LinearInterpolator()

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

Destructor.

Member Function Documentation

◆ operator=()

template<typename DataT, int Dim>
LinearInterpolator<DataT,Dim>& atb::LinearInterpolator< DataT, Dim >::operator= ( LinearInterpolator< 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::LinearInterpolator< 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::LinearInterpolator< DataT, Dim >::type ( ) const
virtual

Get the corresponding enumeration value for the interpolation type.

Returns
LinearIP

Implements atb::Interpolator< DataT, Dim >.

◆ get()

template<typename DataT, int Dim>
DataT atb::LinearInterpolator< 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 will be a linear combination of the values at the surrounding integer positions after application of the boundary treatment given.

Parameters
dataThe Array to get a value from
posThe position
Returns
The linearly interpolated Array value at the given position

Implements atb::Interpolator< DataT, Dim >.

Referenced by segmentation::edgeFilter(), and segmentation::ProfileSampler< T, Dim >::sample().

◆ 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: