Tomato
OxImageCalculator.h
Go to the documentation of this file.
1 
7 #ifndef Tomato_OXIMAGECALCULATOR_H
8 #define Tomato_OXIMAGECALCULATOR_H
9 
10 #include "tomatolib_export.h"
11 #include "CmakeConfigForTomato.h"
12 #ifndef TOMATO_USES_CXX_STANDARD_98
13 #include <thread>
14 #endif
15 
16 #include "OxCalculator.h"
17 #include <map>
18 
19 namespace Ox {
20 
21  template<typename MeasureType>
23  public:
24 
26  virtual ~ImageCalculator(){};
27 
28  // setters
29  void setUseThreads(bool useThreads);
30  void setNThreads(int nThreads);
31  void setNCols(int nCols);
32  void setNRows(int nRows);
33  void setNSamples(int nSamples);
34  void setInvTimes(const MeasureType *invTimes);
35  void setEchoTimes(const MeasureType *echoTimes);
36  void setImageMag(const MeasureType *imageMag);
37  void setImagePha(const MeasureType *imagePha);
38  void setImageResultsArray(MeasureType *imageResultsArray);
39  void setImageResultsMap(std::map<std::string, MeasureType *> *imageResultsMap);
40 
41  void setCalculator(Calculator<MeasureType> *calculator);
42 
43  // getters
44  MeasureType *getImageResultsArray() const;
45  std::map<std::string, MeasureType *> *getImageResultsMap() const;
46 
47  bool isUseThreads() const;
48  unsigned getNThreads() const;
49 
50  // calculators
51  virtual int calculate();
52  virtual int calculateOneThread(int posStart, int posStop);
53 
54  protected:
55  // input
56  Calculator<MeasureType> *_calculator;
57 
58  bool _useThreads;
59  unsigned _nThreads;
60  int _nCols;
61  int _nRows;
62  int _nSamples;
63  const MeasureType* _invTimes; // nSamples
64  const MeasureType* _echoTimes; // nSamples
65  const MeasureType* _imageMag; // nCols * nRows * nSamples, address [iCol][iRow][iSam] iSample * (nCols*nRows) + iRow * nCols + iCol
66  const MeasureType* _imagePha; // nCols * nRows * nSamples, address [iCol][iRow][iSam] iSample * (nCols*nRows) + iRow * nCols + iCol
67 
68  // output
69  MeasureType* _imageResultsArray; // nCols * nRows * nDims, address [iCol][iRow][iDim] iDim * (nCols*nRows) + iRow * nCols + iCol
70  std::map<std::string, MeasureType*> * _imageResultsMap; // map of arrays, each size nCols * nRows
71 
72 
73  };
74 
75 } // namespace Ox
76 
77 #ifndef TOMATOLIB_COMPILED
78 #include "OxImageCalculator.hxx"
79 #endif //TOMATOLIB_COMPILED
80 
81 #endif //Tomato_OXIMAGECALCULATOR_H
Definition: OxCalculator.h:28
Definition: OxImageCalculator.h:22
Definition: OxCalculator.h:19