aimsalgo 6.0.0
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 @ { (Re)set all parameters.
 
virtual void setOrder (unsigned order)
 order
 
virtual void setScale (float scale)
 scale
 
virtual void setShifted (bool shifted)
 shifted
 
virtual void setCentered (bool centered)
 centered
 
unsigned order () const
 Get parameters @ { spline order.
 
float scale () const
 spline scale
 
bool shifted () const
 is shifted ?
 
bool centered () const
 is centered ?
 
virtual double operator() (double x) const
 Compute value.
 
virtual double at (double x) const
 spline value at point x
 
virtual double derivative (double x, unsigned n=1) const
 n-th derivative of the spline at point x
 
virtual const Point2ddsupport () const
 Get the inferior and superior boundaries of the function support (i.e.
 

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 )

References order(), scale(), and shifted().

Referenced by BSpline(), and operator=().

◆ BSpline() [2/2]

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

References BSpline().

◆ ~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::FastBSpline, and aims::TabulBSpline.

◆ centered()

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

is centered ?

Definition at line 192 of file bspline.h.

References _shift.

Referenced by setCentered(), and aims::DiscreteBSpline::setCentered().

◆ 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::FastBSpline, and aims::TabulBSpline.

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

References BSpline().

◆ order()

◆ reset()

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

Set parameters @ { (Re)set all parameters.

Reimplemented in aims::DiscreteBSpline.

References order(), scale(), and shifted().

◆ scale()

◆ setCentered()

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

centered

Reimplemented in aims::DiscreteBSpline.

References centered().

◆ setOrder()

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

order

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

References order().

◆ setScale()

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

scale

Reimplemented in aims::DiscreteBSpline.

References scale().

◆ setShifted()

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

shifted

Reimplemented in aims::DiscreteBSpline.

References shifted().

◆ setSupport()

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

Reimplemented in aims::DiscreteBSpline.

◆ shifted()

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