aimsalgo  5.1.2
Neuroimaging image processing
aims::BSpline Class Reference

Centered and scaled B-Spline function, evaluated at run time. More...

#include <aims/math/bspline.h>

Inheritance diagram for aims::BSpline:
Collaboration diagram for aims::BSpline:

Public Member Functions

 BSpline (unsigned order=3, float scale=1., bool shifted=false)
 
 BSpline (const BSpline &other)
 
virtual ~BSpline ()
 
BSplineoperator= (const BSpline &other)
 
virtual void reset (unsigned order=3, float scale=1., bool shifted=false)
 Set parameters &nbsp;{ (Re)set all parameters. More...
 
virtual void setOrder (unsigned order)
 order More...
 
virtual void setScale (float scale)
 scale More...
 
virtual void setShifted (bool shifted)
 shifted More...
 
virtual void setCentered (bool centered)
 centered More...
 
unsigned order () const
 Get parameters &nbsp;{ spline order. More...
 
float scale () const
 spline scale More...
 
bool shifted () const
 is shifted ? More...
 
bool centered () const
 is centered ? More...
 
virtual double operator() (double x) const
 Compute value. More...
 
virtual double at (double x) const
 spline value at point x More...
 
virtual double derivative (double x, unsigned n=1) const
 n-th derivative of the spline at point x More...
 
virtual const Point2ddsupport () const
 Get the inferior and superior boundaries of the function support (i.e. More...
 

Protected Member Functions

double dO () const
 
virtual void setSupport ()
 

Protected Attributes

unsigned _order
 
float _scale
 
bool _shift
 
Point2dd _support
 

Detailed Description

Centered and scaled B-Spline function, evaluated at run time.

Centered B-splines of order n are recursively evaluated following the formula:

\[ \beta^n(x) = \frac{ (\frac{n+1}{2} + x) \beta^{n-1}( x + \frac{1}{2} ) + (\frac{n+1}{2} - x) \beta^{n-1}( x - \frac{1}{2} ) }{n} \]

Let m be the scaling factor, the scaled B-Spline is then equal to $b_m^n(x) = \beta^n( \frac{x}{m} )$

A shifted scaled B-Spline is equal to: $c_m^n(x) = \beta^n( \frac{x}{m} + \frac{1}{2} )$

See Unser, Aldroubi & Eden: "B-Spline Signal Processing: Part I - Theory" in IEEE Transactions on Signal Processing (February 1993).

In this implementation, unshifted centered B-Spline are recursively evaluated at value x/m (+ .5).

Note
This is also a base class for particular spline implementations ( fast, tabular, ... ). Methods are virtual so this class can be used in polymorphic contexts

Definition at line 137 of file bspline.h.

Constructor & Destructor Documentation

◆ BSpline() [1/2]

aims::BSpline::BSpline ( unsigned  order = 3,
float  scale = 1.,
bool  shifted = false 
)

◆ BSpline() [2/2]

aims::BSpline::BSpline ( const BSpline other)

◆ ~BSpline()

virtual aims::BSpline::~BSpline ( )
virtual

Member Function Documentation

◆ at()

virtual double aims::BSpline::at ( double  x) const
virtual

spline value at point x

Reimplemented in aims::TabulBSpline, and aims::FastBSpline.

◆ centered()

bool aims::BSpline::centered ( ) const
inline

is centered ?

Definition at line 192 of file bspline.h.

References _shift.

◆ derivative()

virtual double aims::BSpline::derivative ( double  x,
unsigned  n = 1 
) const
virtual

n-th derivative of the spline at point x

Reimplemented in aims::TabulBSpline, and aims::FastBSpline.

◆ dO()

double aims::BSpline::dO ( ) const
inlineprotected

Definition at line 196 of file bspline.h.

References _order.

◆ operator()()

virtual double aims::BSpline::operator() ( double  x) const
virtual

Compute value.

See also
spline()

◆ operator=()

BSpline& aims::BSpline::operator= ( const BSpline other)

◆ order()

unsigned aims::BSpline::order ( ) const
inline

Get parameters &nbsp;{ spline order.

Definition at line 186 of file bspline.h.

References _order.

◆ reset()

virtual void aims::BSpline::reset ( unsigned  order = 3,
float  scale = 1.,
bool  shifted = false 
)
virtual

Set parameters &nbsp;{ (Re)set all parameters.

Reimplemented in aims::DiscreteBSpline.

◆ scale()

float aims::BSpline::scale ( ) const
inline

spline scale

Definition at line 188 of file bspline.h.

References _scale.

◆ setCentered()

virtual void aims::BSpline::setCentered ( bool  centered)
virtual

centered

Reimplemented in aims::DiscreteBSpline.

◆ setOrder()

virtual void aims::BSpline::setOrder ( unsigned  order)
virtual

order

Reimplemented in aims::DiscreteBSpline, and aims::TabulBSpline.

◆ setScale()

virtual void aims::BSpline::setScale ( float  scale)
virtual

scale

Reimplemented in aims::DiscreteBSpline.

◆ setShifted()

virtual void aims::BSpline::setShifted ( bool  shifted)
virtual

shifted

Reimplemented in aims::DiscreteBSpline.

◆ setSupport()

virtual void aims::BSpline::setSupport ( )
protectedvirtual

Reimplemented in aims::DiscreteBSpline.

◆ shifted()

bool aims::BSpline::shifted ( ) const
inline

is shifted ?

Definition at line 190 of file bspline.h.

References _shift.

◆ support()

virtual const Point2dd& aims::BSpline::support ( ) const
virtual

Get the inferior and superior boundaries of the function support (i.e.

the interval on which it is not null). If the order is not zero, boundaries are not included in the support. Else, they are.

Member Data Documentation

◆ _order

unsigned aims::BSpline::_order
protected

Definition at line 198 of file bspline.h.

Referenced by dO(), and order().

◆ _scale

float aims::BSpline::_scale
protected

Definition at line 199 of file bspline.h.

Referenced by scale().

◆ _shift

bool aims::BSpline::_shift
protected

Definition at line 200 of file bspline.h.

Referenced by centered(), and shifted().

◆ _support

Point2dd aims::BSpline::_support
protected

Definition at line 201 of file bspline.h.


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