Tomato
Tomato.h
Go to the documentation of this file.
1 
7 #ifndef Tomato_Tomato_H
8 #define Tomato_Tomato_H
9 
10 #include "CmakeConfigForTomato.h"
11 #include "tomatolib_export.h"
12 #ifdef USE_ITK
13 
14 #include "TomatoOptions.h"
15 #include "TomatoColormap.h"
16 
17 #include "itkReadFileListFilter.h"
18 #include "itkSortInvTimesImageFilter.h"
20 #include "itkColorbar2DImageFilter.h"
21 #include "itkNShmolliSamplesUsedTo123ImageFilter.h"
22 
23 #include "itkTimeProbe.h"
24 
25 namespace Ox {
26 
31  template< typename MeasureType >
32  class Tomato {
33 
34  public:
35  // typedefs primitive data types
36  typedef MeasureType InputPixelType;
37  typedef int16_t OutputPixelType; // int does not work with some dicom viewers, be sure to use short (int16)
38 
39  // typedefs image data types
40  typedef itk::Image<InputPixelType, 3> ImageType3D;
41  typedef itk::Image<InputPixelType, 2> ImageType2D;
42  typedef itk::Image<OutputPixelType, 2> OutputImageType;
43  typedef itk::ReadFileListFilter<ImageType3D> ReadFileListFilterType;
44  typedef itk::SortInvTimesImageFilter<ImageType3D, ImageType3D> SortInvTimesImageFilterType;
45  typedef itk::CalculatorT1ImageFilter<ImageType3D, ImageType2D> CalculatorT1ImageFilterType;
46  typedef itk::MetaDataDictionary DictionaryType;
47 
48  // member variables
49  TomatoOptions<InputPixelType> *_opts;
50  InputPixelType *_invTimes;
51  InputPixelType *_echoTimes;
52  int _nSamples;
53  typename ImageType3D::Pointer _imageMag;
54  typename ImageType3D::Pointer _imagePha;
55 
56  typename CalculatorT1ImageFilterType::Pointer _imageCalculatorItk;
57  //SortInvTimesImageFilterType::Pointer _sorterMag;
58  //SortInvTimesImageFilterType::Pointer _sorterPha;
59 
60  DictionaryType _dictionaryInput;
61 
66  int readAndSort();
67 
72  int calculate();
73 
78  int exportToDicom();
79 
84  Tomato(std::string inputFileName);
85 
90  virtual ~Tomato();
91 
92  private:
97  Tomato(){};
98 
103  int exportT1ToDicom();
104 
109  int exportT1MagSignRecovToDicom();
110 
115  int exportT2ToDicom();
116 
117  };
118 
119 } // namespace Ox
120 
121 #ifndef TOMATOLIB_COMPILED
122 #include "Tomato.hxx"
123 #include "Tomato_exportT1.hxx"
124 #include "Tomato_exportT1_magSignRecov.hxx"
125 #include "Tomato_exportT2.hxx"
126 #endif // TOMATOLIB_COMPILED
127 
128 #endif // USE_ITK
129 
130 #endif // Tomato_Tomato_H
Definition: OxCalculator.h:19