A.I.M.S algorithms


resampler.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 
35 #ifndef AIMS_RESAMPLING_RESAMPLER_H
36 #define AIMS_RESAMPLING_RESAMPLER_H
37 
38 
39 #include <aims/data/data.h>
40 #include <aims/vector/vector.h>
41 #include <aims/resampling/motion.h>
42 
43 
51 template <class T>
52 class Resampler
53 {
54 public:
55 
56  Resampler() : _ref( 0 ), _defval( 0 ) { }
57  virtual ~Resampler() { }
58 
69  virtual void doit( const aims::AffineTransformation3d& transform,
70  AimsData<T>& output_data );
71 
83  virtual AimsData<T> doit( const aims::AffineTransformation3d& transform,
84  int dimX, int dimY,
85  int dimZ, const Point3df& voxel_size );
86 
98  virtual void resample( const AimsData< T >& input_data,
99  const aims::AffineTransformation3d& transform,
100  const T& background,
101  AimsData< T >& output_data,
102  bool verbose = false );
103 
118  virtual void resample( const AimsData< T >& input_data,
119  const aims::AffineTransformation3d& transform,
120  const T& background,
121  const Point3df& output_location,
122  T& output_value, int timestep );
123 
125  void setRef( const AimsData<T>& ref ) { _ref = &ref; }
127  void setDefaultValue( T val ) { _defval = val; }
128 
129 protected:
130 
131  virtual void
132  doResample( const AimsData< T > &inVolume,
133  const aims::AffineTransformation3d &invTransform3d,
134  const T &outBackground, const Point3df &outLocation,
135  T &outValue, int time ) = 0;
136 
138  virtual void updateParameters( const AimsData< T > &inVolume, int time,
139  bool verbose );
140 
143 };
144 
145 
146 
147 #endif
void setDefaultValue(T val)
set the default background value
Definition: resampler.h:127
Resampler resamples an input data to build or fill an output data, using an affine transformation...
Definition: resampler.h:52
Resampler()
Definition: resampler.h:56
void setRef(const AimsData< T > &ref)
set the input data to be resampled
Definition: resampler.h:125
virtual void resample(const AimsData< T > &input_data, const aims::AffineTransformation3d &transform, const T &background, AimsData< T > &output_data, bool verbose=false)
Resample the input data into an existing output data.
Definition: resampler_d.h:45
virtual void doit(const aims::AffineTransformation3d &transform, AimsData< T > &output_data)
Resample the reference input data (set via setRef()) into an existing output data.
Definition: resampler_d.h:169
virtual void updateParameters(const AimsData< T > &inVolume, int time, bool verbose)
called before each time step, used in spline resamplers
Definition: resampler_d.h:162
virtual void doResample(const AimsData< T > &inVolume, const aims::AffineTransformation3d &invTransform3d, const T &outBackground, const Point3df &outLocation, T &outValue, int time)=0
const AimsData< T > * _ref
Definition: resampler.h:141
virtual ~Resampler()
Definition: resampler.h:57