highres-cortex 6.0.4
field.hh
Go to the documentation of this file.
1/*
2Copyright CEA (2014, 2017).
3Copyright Université Paris XI (2014).
4
5Contributor: Yann Leprince <yann.leprince@ylep.fr>.
6Contributor: Denis Rivière <denis.riviere@cea.fr>.
7
8This file is part of highres-cortex, a collection of software designed
9to process high-resolution magnetic resonance images of the cerebral
10cortex.
11
12This software is governed by the CeCILL licence under French law and
13abiding by the rules of distribution of free software. You can use,
14modify and/or redistribute the software under the terms of the CeCILL
15licence as circulated by CEA, CNRS and INRIA at the following URL:
16<http://www.cecill.info/>.
17
18As a counterpart to the access to the source code and rights to copy,
19modify and redistribute granted by the licence, users are provided only
20with a limited warranty and the software's author, the holder of the
21economic rights, and the successive licensors have only limited
22liability.
23
24In this respect, the user's attention is drawn to the risks associated
25with loading, using, modifying and/or developing or reproducing the
26software by the user in light of its specific status of scientific
27software, that may mean that it is complicated to manipulate, and that
28also therefore means that it is reserved for developers and experienced
29professionals having in-depth computer knowledge. Users are therefore
30encouraged to load and test the software's suitability as regards their
31requirements in conditions enabling the security of their systems and/or
32data to be ensured and, more generally, to use and operate it in the
33same conditions as regards security.
34
35The fact that you are presently reading this means that you have had
36knowledge of the CeCILL licence and that you accept its terms.
37*/
38
39#ifndef YL_FIELD_HH_INCLUDED
40#define YL_FIELD_HH_INCLUDED
41
42#include <aims/vector/vector.h>
43#include <aims/resampling/linearInterpolator.h>
44
45namespace yl
46{
47
49class Field
50{
51public:
54 {
55 };
56};
57
59class VectorField3d : public Field
60{
61public:
62 // A virtual destructor is needed because this is a polymorphic class
64
70 Point3df evaluate(const Point3df& pos) const
71 {
72 Point3df ret;
73 evaluate(pos, ret);
74 return ret;
75 };
76
82 virtual void evaluate(const Point3df& pos, Point3df& output) const = 0;
83};
84
86class ScalarField : public Field
87{
88public:
89 // A virtual destructor is needed because this is a polymorphic class
91
97 virtual float evaluate(const Point3df& pos) const = 0;
98
99};
100
106{
107public:
109 const carto::VolumeRef<float>& fieldy,
110 const carto::VolumeRef<float>& fieldz);
111
112 virtual void evaluate(const Point3df& pos, Point3df& output) const;
113private:
114 aims::LinearInterpolator<float> m_interp_fieldx;
115 aims::LinearInterpolator<float> m_interp_fieldy;
116 aims::LinearInterpolator<float> m_interp_fieldz;
117};
118
120{
121public:
123 const carto::VolumeRef<float>& scalar_field);
124 virtual void evaluate(const Point3df& pos, Point3df& output) const;
125private:
129 float m_xoffset, m_yoffset, m_zoffset;
130};
131
137{
138public:
140
141 virtual float evaluate(const Point3df& pos) const;
142private:
143 aims::LinearInterpolator<float> m_interp_field;
144};
145
152{
153public:
154 explicit BooleanScalarField(const carto::VolumeRef<int16_t>& field_volume);
155
156 virtual float evaluate(const Point3df& pos) const;
157private:
158 const carto::VolumeRef<int16_t>& m_field;
159 Point3df m_voxel_size;
160};
161
162} // namespace yl
163
164#endif // !defined(YL_FIELD_HH_INCLUDED)
virtual float evaluate(const Point3df &pos) const
Evaluate the field's value at possibly non-integer coordinates.
BooleanScalarField(const carto::VolumeRef< int16_t > &field_volume)
Exception thrown when the field has no defined value.
Definition field.hh:54
Store and access a field (scalar or vector) defined over a 3D domain.
Definition field.hh:50
virtual void evaluate(const Point3df &pos, Point3df &output) const
Evaluate the field's value at possibly non-integer coordinates.
LinearlyInterpolatedScalarFieldGradient(const carto::VolumeRef< float > &scalar_field)
virtual float evaluate(const Point3df &pos) const
Evaluate the field's value at possibly non-integer coordinates.
LinearlyInterpolatedScalarField(const carto::VolumeRef< float > &field_volume)
virtual void evaluate(const Point3df &pos, Point3df &output) const
Evaluate the field's value at possibly non-integer coordinates.
LinearlyInterpolatedVectorField3d(const carto::VolumeRef< float > &fieldx, const carto::VolumeRef< float > &fieldy, const carto::VolumeRef< float > &fieldz)
Store a scalar field and access it at any coordinates.
Definition field.hh:87
virtual float evaluate(const Point3df &pos) const =0
Evaluate the field's value at possibly non-integer coordinates.
Store a vector field and access it at any coordinates.
Definition field.hh:60
virtual void evaluate(const Point3df &pos, Point3df &output) const =0
Evaluate the field's value at possibly non-integer coordinates.
Point3df evaluate(const Point3df &pos) const
Evaluate the field's value at possibly non-integer coordinates.
Definition field.hh:70
Definition cortex.hh:41