aimsalgo  5.1.2
Neuroimaging image processing
splinesubsampler.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 #ifndef AIMS_PYRAMID_SPLINESUBSAMPLER_H
35 #define AIMS_PYRAMID_SPLINESUBSAMPLER_H
36 
37 //============================================================================
38 //
39 // DIRECT B-SPLINE SUBSAMPLER
40 //
41 //============================================================================
42 
43 //--- aims -------------------------------------------------------------------
44 #include <aims/math/bspline.h> // aims::DiscreteBSpline
45 #include <aims/pyramid/convolutionsubsampler.h> // aims::ConvolutionFilter
46 #include <aims/vector/vector.h> // Point4df
47 //--- cartodata --------------------------------------------------------------
48 #include <cartodata/volume/volume.h> // carto::VolumeRef
49 //----------------------------------------------------------------------------
50 
51 namespace aims {
52 
70  class DirectBSplineSubSampler: public ConvolutionSubSampler<DiscreteBSpline>
71  {
72  public:
73  //------------------------------------------------------------------------
75  //------------------------------------------------------------------------
77  DirectBSplineSubSampler( unsigned factor = 2,
78  bool normalize = false,
79  unsigned spline_order = 3 );
81  bool normalize = false,
82  unsigned spline_order = 3 );
84  virtual ~DirectBSplineSubSampler();
87 
88  //------------------------------------------------------------------------
90  //------------------------------------------------------------------------
93  unsigned order() const;
95  bool normalize() const;
98  void setOrder( unsigned n );
101  void setFactor( unsigned r );
104  void setFactor( const Point4du & r );
106  void setNormalize( bool normalize = true );
108 
109  //------------------------------------------------------------------------
111  //------------------------------------------------------------------------
123  template <typename OUT, typename IN>
125  carto::VolumeRef<OUT> & out ) const;
128 
129  protected:
131  // utility functions
132  void setFunctions( const Point4du & r, unsigned n );
133  // Make some inherited functions private
135  };
136 
137 } // namespace aims
138 
139 #endif // AIMS_PYRAMID_SPLINESUBSAMPLER_H
Class excuting a spline-based subsampling.
void setFactor(unsigned r)
Override ConclutionSubSampler version to update the underlying basis functions.
void setFunctions(const Point4du &r, unsigned n)
carto::VolumeRef< OUT > execute(const carto::VolumeRef< IN > &in, carto::VolumeRef< OUT > &out) const
Execution.
void setNormalize(bool normalize=true)
Set normalization mode.
void setOrder(unsigned n)
Set spline order Updates underlying basis functions.
DirectBSplineSubSampler(unsigned factor=2, bool normalize=false, unsigned spline_order=3)
Constructor / Copy.
bool normalize() const
Get normalization mode.
DirectBSplineSubSampler & operator=(const DirectBSplineSubSampler &other)
unsigned order() const
Parameters.