20 #ifndef MIRTK_Mapping_H 21 #define MIRTK_Mapping_H 23 #include "mirtk/Object.h" 25 #include "mirtk/Point.h" 26 #include "mirtk/Cfstream.h" 27 #include "mirtk/ImageAttributes.h" 29 #include "vtkSmartPointer.h" 30 #include "vtkPointSet.h" 37 template <
class TVoxel>
class GenericImage;
66 mirtkPublicAttributeMacro(
double, OutsideValue);
69 void CopyAttributes(
const Mapping &);
112 double &x2,
double &y2)
const;
122 virtual void BoundingBox(
double &x1,
double &y1,
double &z1,
123 double &x2,
double &y2,
double &z2)
const = 0;
168 virtual bool Evaluate(
double *v,
double x,
double y,
double z = 0)
const = 0;
176 bool Evaluate(
double *v,
const double p[3])
const;
195 virtual double Evaluate(
double x,
double y,
double z = 0,
int l = 0)
const;
204 double Evaluate(
const double p[3],
int l = 0)
const;
241 virtual bool Read(
const char *);
244 virtual bool Write(
const char *)
const;
267 double x1, y1, z1, x2, y2, z2;
269 return (z1 == z2 ? ((y1 == y2) ? 1 : 2) : 3);
283 bounds[1], bounds[3], bounds[5]);
299 return this->
Evaluate(v, p[0], p[1], p[2]);
313 const double s = v[l];
321 return this->
Evaluate(p[0], p[1], p[2], l);
333 #endif // MIRTK_Mapping_H void BoundingBox(double &x1, double &y1, double &x2, double &y2) const
virtual int NumberOfArguments() const
Dimension of map domain.
virtual void WriteMap(Cofstream &) const
Write map attributes and parameters to file stream.
virtual int NumberOfComponents() const =0
Dimension of codomain, i.e., number of output values.
virtual bool Evaluate(double *v, double x, double y, double z=0) const =0
static Mapping * New(const char *)
Read mapping from file.
double _x
x coordinate of Point
ImageAttributes Attributes(int nx, int ny=0, int nz=0) const
virtual Mapping * NewCopy() const =0
Make deep copy of this map.
Mapping & operator=(const Mapping &)
Assignment operator.
Mapping()
Default constructor.
virtual bool Read(const char *)
Read map from file.
virtual bool Write(const char *) const
Write map to file.
virtual void ReadMap(Cifstream &)
Read map attributes and parameters from file stream.
double _z
z coordinate of Point
virtual void Initialize()
Initialize map after inputs and parameters are set.
double _y
y coordinate of Point
virtual ~Mapping()
Destructor.