vcsl_scale.h
Go to the documentation of this file.
1 // This is core/vcsl/vcsl_scale.h
2 #ifndef vcsl_scale_h_
3 #define vcsl_scale_h_
4 //:
5 // \file
6 // \brief Scale transformation
7 // \author Francois BERTEL
8 //
9 // \verbatim
10 // Modifications
11 // 2000/07/19 Francois BERTEL Creation.
12 // 2001/04/10 Ian Scott (Manchester) Converted perceps header to doxygen
13 // 2002/01/22 Peter Vanroose - return type of execute() and inverse() changed to non-ptr
14 // 2002/01/28 Peter Vanroose - std::vector member scale_ changed to non-ptr
15 // 2004/09/17 Peter Vanroose - made scale() non-virtual - it just returns a member and should not be overloaded
16 // \endverbatim
17 
19 #include <vcsl/vcsl_scale_sptr.h>
20 
21 //: Scale transformation
24 {
25  public:
26  //***************************************************************************
27  // Constructors/Destructor
28  //***************************************************************************
29 
30  // Default constructor
31  vcsl_scale() = default;
32 
33  // Destructor
34  ~vcsl_scale() override = default;
35 
36  //***************************************************************************
37  // Status report
38  //***************************************************************************
39 
40  //: Is `this' invertible at time `time'?
41  // REQUIRE: valid_time(time)
42  // Pure virtual function of vcsl_spatial_transformation
43  bool is_invertible(double time) const override;
44 
45  //: Is `this' correctly set ?
46  // Virtual function of vcsl_spatial_transformation
47  bool is_valid() const override
49  ((this->duration()==0&&scale_.size()==1) ||
50  this->duration()==scale_.size()); }
51 
52  //***************************************************************************
53  // Transformation parameters
54  //***************************************************************************
55 
56  //: Set the scale value of a static scale
57  void set_static(double new_scale);
58 
59  //: Set the scale variation along the time
60  void set_scale(std::vector<double> const& new_scale) { scale_=new_scale; }
61 
62  //: Return the scale variation along the time
63  std::vector<double> scale() const { return scale_; }
64 
65  //***************************************************************************
66  // Basic operations
67  //***************************************************************************
68 
69  //: Image of `v' by `this'
70  // REQUIRE: is_valid()
71  // Pure virtual function of vcsl_spatial_transformation
73  double time) const override;
74 
75  //: Image of `v' by the inverse of `this'
76  // REQUIRE: is_valid()
77  // REQUIRE: is_invertible(time)
78  // Pure virtual function of vcsl_spatial_transformation
80  double time) const override;
81 
82  protected:
83 
84  //: Compute the value of the parameter at time `time'
85  double scale_value(double time) const;
86 
87  //: Scale variation along the time
88  std::vector<double> scale_;
89 };
90 
91 #endif // vcsl_scale_h_
unsigned int duration() const
Return the time duration.
Transformation between 2 spatial coordinate systems.
Scale transformation.
Definition: vcsl_scale.h:22
vnl_vector< double > inverse(const vnl_vector< double > &v, double time) const override
Image of ‘v’ by the inverse of ‘this’.
Definition: vcsl_scale.cxx:53
bool is_invertible(double time) const override
Is ‘this’ invertible at time ‘time’?.
Definition: vcsl_scale.cxx:12
vcsl_scale()=default
Transformation between 2 spatial coordinate systems.
void set_scale(std::vector< double > const &new_scale)
Set the scale variation along the time.
Definition: vcsl_scale.h:60
double scale_value(double time) const
Compute the value of the parameter at time ‘time’.
Definition: vcsl_scale.cxx:71
std::vector< double > scale_
Scale variation along the time.
Definition: vcsl_scale.h:88
std::vector< double > scale() const
Return the scale variation along the time.
Definition: vcsl_scale.h:63
void set_static()
Empty the time clock and interpolators, thereby making the transf static.
vnl_vector< double > execute(const vnl_vector< double > &v, double time) const override
Image of ‘v’ by ‘this’.
Definition: vcsl_scale.cxx:34
virtual bool is_valid() const
Is ‘this’ correctly set ?.
bool is_valid() const override
Is ‘this’ correctly set ?.
Definition: vcsl_scale.h:47
~vcsl_scale() override=default