Tomato
TomatoOptions.h
Go to the documentation of this file.
1 
7 #ifndef Tomato_TomatoOPTIONS_H
8 #define Tomato_TomatoOPTIONS_H
9 
10 #include <iostream>
11 #include <vector>
12 #include <string>
13 
14 #include "CmakeConfigForTomato.h"
15 #include "tomatolib_export.h"
16 
17 #include "OxFactoryOfCalculators.h"
18 #include "OxFactoryOfFitters.h"
19 #include "OxFactoryOfModels.h"
22 
23 namespace Ox {
24 
25  template<typename MeasureType>
26  class TomatoOptions {
27 
28  public:
29  // paths for dicom file based calculation
30  std::vector<std::string> files_magnitude;
31  std::vector<std::string> files_phase;
32  std::string dir_magnitude;
33  std::string dir_phase;
34  std::string dir_output_map;
35  std::string dir_output_fitparams;
36  std::string dir_output_magSignRecov;
37 
38  // data for one pixel calculation
39  std::vector <MeasureType> signal_magnitude;
40  std::vector <MeasureType> signal_phase;
41 
42  // calculation types
43  calculatorsType_t parameter_to_map;
44  paramType_t parameter_type;
45  fittersType_t fitting_method;
46  modelType_t model_type;
47  signCalculatorsType_t sign_calc_method;
48  startPointCalculatorsType_t start_point_calc_method;
49 
50  // calculation params
51  MeasureType fTolerance;
52  int max_function_evals;
53  bool use_gradient;
54  std::vector <MeasureType> inversion_times;
55  std::vector <MeasureType> echo_times;
56  std::vector <MeasureType> start_point;
57  std::vector <MeasureType> noise;
58 
59  // image
60  MeasureType mean_cut_off;
61  MeasureType map_scale_factor;
62  bool use_colorbar;
63  int number_of_threads;
64 
65  // export
66  std::string output_map_series_instance_uid;
67  std::string output_fitparams_series_instance_uid;
68  std::string output_magSignRecov_series_instance_uid;
69  int output_map_series_number;
70  int output_fitparams_series_number;
71  int output_magSignRecov_series_number;
72 
73  // output params
74  double calculation_time;
75 
80  void init(){
81  dir_magnitude = "";
82  dir_phase = "";
83  dir_output_map = "";
84  dir_output_fitparams = "";
85  dir_output_magSignRecov = "";
86 
87  parameter_to_map = T1_MOLLI;
88  fitting_method = LevMarVnl;
89  model_type = _ModelT1ThreeParam;
90  sign_calc_method = NoSign;
91  start_point_calc_method = Basic;
92 
93  fTolerance = 1e-12;
94  max_function_evals = 4000;
95  use_gradient = false;
96 
97  // image
98  mean_cut_off = 10.0;
99  map_scale_factor = 1.0;
100  use_colorbar = true;
101  number_of_threads = 0;
102 
103  // export
104  output_map_series_instance_uid = "";
105  output_fitparams_series_instance_uid = "";
106  output_magSignRecov_series_instance_uid = "";
107  output_map_series_number = 0;
108  output_fitparams_series_number = 0;
109  output_magSignRecov_series_number = 0;
110 
111  // output params
112  calculation_time = 0;
113  }
114 
118  TomatoOptions();
119 
124  TomatoOptions(const std::string& filePath);
125 
129  ~TomatoOptions();
130 
135  int exportToYaml();
136 
142  int exportToYaml(std::string filePath);
143 
147  void printCurrent();
148 
156  int findInArray(int size, const char *nameArray[], std::string name);
157 
158  private:
159 
160  void copyStrVectorToMemberVector(std::vector<std::string> strVector, std::vector<MeasureType> &memberVector);
161 
162  };
163 } // namespace Ox
164 
165 #ifndef TOMATOLIB_COMPILED
166 #include "TomatoOptions.hxx"
167 #endif
168 
169 #endif //Tomato_TomatoOPTIONS_H
void init()
Definition: TomatoOptions.h:80
void printCurrent()
Definition: TomatoOptions.hxx:164
int exportToYaml()
Definition: TomatoOptions.hxx:215
int findInArray(int size, const char *nameArray[], std::string name)
Definition: TomatoOptions.hxx:140
TomatoOptions()
Definition: TomatoOptions.hxx:24
Definition: OxCalculator.h:19
~TomatoOptions()
Definition: TomatoOptions.hxx:134