aimsalgo  5.0.5
Neuroimaging image processing
aims::DirectBSplineSubSampler Class Reference

Class excuting a spline-based subsampling. More...

#include <aims/pyramid/splinesubsampler.h>

Inheritance diagram for aims::DirectBSplineSubSampler:
Collaboration diagram for aims::DirectBSplineSubSampler:

Public Member Functions

 DirectBSplineSubSampler (unsigned factor=2, bool normalize=false, unsigned spline_order=3)
 Constructor / Copy. More...
 
 DirectBSplineSubSampler (const Point4du &factor, bool normalize=false, unsigned spline_order=3)
 
 DirectBSplineSubSampler (const DirectBSplineSubSampler &other)
 
virtual ~DirectBSplineSubSampler ()
 
DirectBSplineSubSampleroperator= (const DirectBSplineSubSampler &other)
 
unsigned order () const
 Parameters. More...
 
bool normalize () const
 Get normalization mode. More...
 
void setOrder (unsigned n)
 Set spline order Updates underlying basis functions. More...
 
void setFactor (unsigned r)
 Override ConclutionSubSampler version to update the underlying basis functions. More...
 
void setFactor (const Point4du &r)
 Override ConclutionSubSampler version to update the underlying basis functions. More...
 
void setNormalize (bool normalize=true)
 Set normalization mode. More...
 
template<typename OUT , typename IN >
carto::VolumeRef< OUT > execute (const carto::VolumeRef< IN > &in, carto::VolumeRef< OUT > &out) const
 Execution. More...
 
- Public Member Functions inherited from aims::ConvolutionSubSampler< DiscreteBSpline >
 ConvolutionSubSampler (unsigned r=2)
 Constructor / Destructor / Copy. More...
 
 ConvolutionSubSampler (const Point4du &r)
 
 ConvolutionSubSampler (const DiscreteBSpline &bfunc, unsigned r)
 
 ConvolutionSubSampler (const std::vector< DiscreteBSpline > &bfunc=std::vector< DiscreteBSpline >(), const Point4du &r=Point4du(2, 2, 2, 2))
 
 ConvolutionSubSampler (const ConvolutionSubSampler &other)
 
virtual ~ConvolutionSubSampler ()
 
ConvolutionSubSampleroperator= (const ConvolutionSubSampler &other)
 
carto::VolumeRef< OUT > execute (const carto::VolumeRef< IN > &in) const
 Execution. More...
 
carto::VolumeRef< OUT > execute (const carto::VolumeRef< IN > &in, carto::VolumeRef< OUT > &out) const
 Write result in an existing volume. More...
 
const std::vector< bool > & directions () const
 Parameters. More...
 
const Point4dufactor () const
 
void setBasisFunction (const DiscreteBSpline &func)
 
void setBasisFunction (const std::vector< DiscreteBSpline > &func)
 
void setFactor (unsigned r)
 
void setFactor (const Point4du &r)
 
void setDirections (const std::vector< bool > &dir)
 
void setDirections (bool dirx, bool diry, bool dirz, bool dirt)
 
void setVerbose (int verbose=1)
 
void setQuiet ()
 

Protected Member Functions

void setFunctions (const Point4du &r, unsigned n)
 

Protected Attributes

bool _normalize
 
- Protected Attributes inherited from aims::ConvolutionSubSampler< DiscreteBSpline >
std::vector< DiscreteBSpline_func
 
int _verbose
 
std::vector< bool > _dir
 
Point4du _factor
 

Detailed Description

Class excuting a spline-based subsampling.

The behaviour is equivalent to:

  1. The image is convoluted with a b-spline of order N, expanded by a factor R.
  2. The image is decimated by a factor R However, for performances, the convolution is only computed in voxels that will be kept after decimation.

Note that in the case of R = 1, the output image will differ from the input image. The behaviour is thus different from a classical "binning" subsampling.

By default, the kernel is normalized (it sums to 1). Normalization can be deactivated. When using spline subsampling in the frame of least square approximation, normalization should be deactivated. (see LeastSquareSpline)

Definition at line 70 of file splinesubsampler.h.

Constructor & Destructor Documentation

◆ DirectBSplineSubSampler() [1/3]

aims::DirectBSplineSubSampler::DirectBSplineSubSampler ( unsigned  factor = 2,
bool  normalize = false,
unsigned  spline_order = 3 
)

Constructor / Copy.

Definition at line 57 of file splinesubsampler_d.h.

References setFunctions().

◆ DirectBSplineSubSampler() [2/3]

aims::DirectBSplineSubSampler::DirectBSplineSubSampler ( const Point4du factor,
bool  normalize = false,
unsigned  spline_order = 3 
)

Definition at line 66 of file splinesubsampler_d.h.

References setFunctions().

◆ DirectBSplineSubSampler() [3/3]

aims::DirectBSplineSubSampler::DirectBSplineSubSampler ( const DirectBSplineSubSampler other)

Definition at line 78 of file splinesubsampler_d.h.

◆ ~DirectBSplineSubSampler()

aims::DirectBSplineSubSampler::~DirectBSplineSubSampler ( )
virtual

Definition at line 75 of file splinesubsampler_d.h.

Member Function Documentation

◆ execute()

template<typename OUT , typename IN >
carto::VolumeRef< OUT > aims::DirectBSplineSubSampler::execute ( const carto::VolumeRef< IN > &  in,
carto::VolumeRef< OUT > &  out 
) const

Execution.

Function-like operator that filters a given volume

Write result in an existing volume. If the allocated size differs from the needed resulting size, the volume is reallocated.

DirectBSplineSubSampler overrides the inherited version to add normalization.

Note
1 copy
Warning
This call risks causing additional precision errors

Definition at line 157 of file splinesubsampler_d.h.

References aims::ConvolutionSubSampler< DiscreteBSpline >::_dir, aims::ConvolutionSubSampler< DiscreteBSpline >::_func, aims::ConvolutionSubSampler< BasisFunction >::execute(), and carto::VolumeRef< T >::getSize().

◆ normalize()

bool aims::DirectBSplineSubSampler::normalize ( ) const

Get normalization mode.

Definition at line 103 of file splinesubsampler_d.h.

References _normalize.

Referenced by setNormalize().

◆ operator=()

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

◆ order()

unsigned aims::DirectBSplineSubSampler::order ( ) const

Parameters.

Get spline order

Definition at line 98 of file splinesubsampler_d.h.

References aims::ConvolutionSubSampler< DiscreteBSpline >::_func.

◆ setFactor() [1/2]

void aims::DirectBSplineSubSampler::setFactor ( unsigned  r)

Override ConclutionSubSampler version to update the underlying basis functions.

Definition at line 120 of file splinesubsampler_d.h.

References aims::ConvolutionSubSampler< DiscreteBSpline >::_func, and aims::ConvolutionSubSampler< BasisFunction >::setFactor().

◆ setFactor() [2/2]

void aims::DirectBSplineSubSampler::setFactor ( const Point4du r)

Override ConclutionSubSampler version to update the underlying basis functions.

Definition at line 128 of file splinesubsampler_d.h.

References aims::ConvolutionSubSampler< DiscreteBSpline >::_func, and aims::ConvolutionSubSampler< BasisFunction >::setFactor().

◆ setFunctions()

void aims::DirectBSplineSubSampler::setFunctions ( const Point4du r,
unsigned  n 
)
protected

◆ setNormalize()

void aims::DirectBSplineSubSampler::setNormalize ( bool  normalize = true)

Set normalization mode.

Definition at line 115 of file splinesubsampler_d.h.

References _normalize, and normalize().

◆ setOrder()

void aims::DirectBSplineSubSampler::setOrder ( unsigned  n)

Set spline order Updates underlying basis functions.

Definition at line 108 of file splinesubsampler_d.h.

References aims::ConvolutionSubSampler< DiscreteBSpline >::_func.

Member Data Documentation

◆ _normalize

bool aims::DirectBSplineSubSampler::_normalize
protected

Definition at line 130 of file splinesubsampler.h.

Referenced by normalize(), operator=(), and setNormalize().


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