My Project
groundtruthproblem.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef mia_2d_ground_truth_problem_hh
22 #define mia_2d_ground_truth_problem_hh
23 
24 #include <mia/core/minimizer.hh>
26 
27 
29 
43 {
44 public:
45 
57  GroundTruthProblem(double a, double b,
58  const C2DBounds& slice_size,
59  size_t nframes,
60  const CDoubleVector& left_side,
62 
66  void set_alpha_beta(double a, double b);
67 
68 protected:
69 
71  const std::vector<double>& get_spacial_gradient() const;
72 
74  const std::vector<double>& get_time_derivative() const;
75 private:
76  virtual double do_f(const CDoubleVector& x);
77  virtual void do_df(const CDoubleVector& x, CDoubleVector& g);
78  virtual double do_fdf(const CDoubleVector& x, CDoubleVector& g);
79  size_t do_size() const;
80 
81  double evaluate_spacial_gradients(const CDoubleVector& x);
82  double evaluate_time_gradients(const CDoubleVector& x);
83  double evaluate_slice_gradient(CDoubleVector::const_iterator ii, std::vector<double>::iterator iout);
84 
85  std::vector<double> m_spacial_gradient;
86  std::vector<double> m_time_derivative;
87 
88  double m_a;
89  double m_b;
90  const C2DBounds& m_slice_size;
91  size_t m_nframes;
92  size_t m_frame_size;
93  const CDoubleVector& m_left_side;
95 };
96 
98 
99 #endif
Base class for all optimization problems that can be run by CMinimizer.
Definition: minimizer.hh:82
a class for the evaluation of a pseudo ground truth of a perfusion series
const std::vector< double > & get_time_derivative() const
void set_alpha_beta(double a, double b)
const std::vector< double > & get_spacial_gradient() const
GroundTruthProblem(double a, double b, const C2DBounds &slice_size, size_t nframes, const CDoubleVector &left_side, const CCorrelationEvaluator::result_type &corr)
A wrapper around the c-array to provide an STL like interface for iterators.
Definition: core/vector.hh:78
#define EXPORT_2D
Definition: defines2d.hh:37
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36