aimsalgo  5.1.2
Neuroimaging image processing
masklinresampler.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_MASKLINRESAMPLER_H
36 #define AIMS_RESAMPLING_MASKLINRESAMPLER_H
37 
40 
41 namespace aims
42 {
43 
61 template <class T>
62 class
63 #ifndef AIMS_MASKLINEARRESAMPLER_NO_DEPREC_WARNING
64  __attribute__((__deprecated__))
65 #endif
66  MaskLinearResampler : public Resampler< T >
67 {
68 
69  public:
70 
73 
74  MaskLinearResampler() : Resampler< T >() {
75  // Set background to the same value as the mask (which is hard-coded in
76  // the resampler)
77  setDefaultValue(-32768);
78  };
79  ~MaskLinearResampler() { }
80 
82  void resample( const carto::Volume< T >& input_data,
83  const aims::AffineTransformation3d& transform,
84  const T& background,
85  carto::Volume< T > & output_data,
86  bool verbose = false ) const CARTO_OVERRIDE;
87 
88  protected:
89 
90  static_assert(static_cast<T>(-32768) == -32768,
91  "type T cannot represent the mask value (-32768)");
92 
93  void
94  doResample( const carto::Volume< T > &,
95  const soma::Transformation3d &, const T &,
96  const Point3df &, T &, int ) const CARTO_OVERRIDE;
97 
98  LinearResampler<T> _linearresampler;
99 
100 };
101 
102 } // namespace aims
103 
104 #endif // !defined(AIMS_RESAMPLING_MASKLINRESAMPLER_H)
#define __attribute__(a)
virtual void resample(const carto::Volume< T > &input_data, const aims::AffineTransformation3d &transform, const T &background, carto::Volume< T > &output_data, bool verbose=false) const
Resample a volume into an existing output volume.
Definition: resampler_d.h:179
void setDefaultValue(T val)
Set the background value to be used by the doit() methods.
Definition: resampler.h:320
const T & defaultValue() const
Background value used by the doit() methods.
Definition: resampler.h:323
BucketMap< Void > * mask(const BucketMap< Void > &src, const BucketMap< Void > &m, bool intersect=true)