Tomato
itkCalculatorT1ImageFilter.h
Go to the documentation of this file.
1 
7 #ifndef itkCalculatorT1ImageFilter_h
8 #define itkCalculatorT1ImageFilter_h
9 
10 #include "tomatolib_export.h"
11 #include "CmakeConfigForTomato.h"
12 
13 #ifdef USE_ITK
14 
15 #include "itkLogger.h"
16 #include "KWUtil.h"
17 #include "OxModel.h"
18 #include "OxFitter.h"
19 #include "OxCalculator.h"
20 
21 #include "itkDataObject.h"
22 #include "itkImageToImageFilter.h"
23 #include "itkImageRegionSplitterDirection.h"
24 #include "itkImageRegionIterator.h"
25 #include "itkImageLinearIteratorWithIndex.h"
26 
27 namespace itk {
28 
34  template<typename TImageIn, typename TImageOut1, typename TImageOut2 = TImageIn>
35  class CalculatorT1ImageFilter : public ImageToImageFilter<TImageIn, TImageOut1> {
36  public:
38  typedef CalculatorT1ImageFilter Self;
39  typedef ImageToImageFilter<TImageIn, TImageOut1> Superclass;
40  typedef SmartPointer<Self> Pointer;
41 
43  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
44 
46  itkNewMacro(Self);
47 
49  itkTypeMacro(CalculatorT1ImageFilter, ImageToImageFilter);
50 
51  typedef typename TImageIn::PixelType PixelTypeIn;
52  typedef typename TImageOut1::PixelType PixelTypeOut;
53 
54  void SetInputMagImage(const TImageIn *magImage);
55  void SetInputPhaImage(const TImageIn *phaImage);
56 
57  TImageOut2* GetMagSignRecovered();
58 
59  TImageOut1* GetAImage();
60  TImageOut1* GetBImage();
61  TImageOut1* GetT1starImage();
62  TImageOut1* GetT1Image();
63  TImageOut1* GetR2Image();
64  TImageOut1* GetChiSqrtImage();
65  TImageOut1* GetSNRImage();
66  TImageOut1* GetNShmolliSamplesUsedImage();
67  TImageOut1* GetDeltaAImage();
68  TImageOut1* GetDeltaBImage();
69  TImageOut1* GetDeltaT1Image();
70  TImageOut1* GetT2Image();
71  TImageOut1* GetR2AbsImage();
72 
74  void SetCalculator(Ox::Calculator<PixelTypeIn>* calculator){
75  this->m_Calculator = calculator;
76  }
77 
78  Ox::Calculator<PixelTypeIn> *GetCalculator() const{
79  return m_Calculator;
80  }
81 
82 
83  itkSetMacro( LimitOutputIntensity, bool );
84  itkGetMacro( LimitOutputIntensity, bool );
85  itkBooleanMacro(LimitOutputIntensity);
86 
87  itkSetMacro( UpperLimitOutputIntensity, PixelTypeOut );
88  itkGetMacro( UpperLimitOutputIntensity, PixelTypeOut );
89 
90  itkSetMacro( LowerLimitOutputIntensity, PixelTypeOut );
91  itkGetMacro( LowerLimitOutputIntensity, PixelTypeOut );
92 
93  protected:
95  CalculatorT1ImageFilter();
96 
98  ~CalculatorT1ImageFilter() {};
99 
101  virtual void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread, ThreadIdType threadId ) ITK_OVERRIDE;
102 
104  virtual void BeforeThreadedGenerateData() ITK_OVERRIDE;
105 
107  virtual void GenerateOutputInformation() ITK_OVERRIDE;
108 
110  virtual const ImageRegionSplitterBase* GetImageRegionSplitter() const ITK_OVERRIDE{
111  return m_ImageRegionSplitter;
112  };
113 
115  typename ImageRegionSplitterDirection::Pointer m_ImageRegionSplitter;
116 
118  typename TImageOut1::PixelType LimitResult(typename TImageOut1::PixelType result );
119 
120  private:
121  ITK_DISALLOW_COPY_AND_ASSIGN(CalculatorT1ImageFilter); //purposely not implemented
122 
124  Ox::Calculator<PixelTypeIn>* m_Calculator;
125 
126  bool m_LimitOutputIntensity;
127  PixelTypeOut m_UpperLimitOutputIntensity;
128  PixelTypeOut m_LowerLimitOutputIntensity;
129  };
130 } //namespace ITK
131 
132 #ifndef TOMATOLIB_COMPILED
133 #ifndef ITK_MANUAL_INSTANTIATION
135 #endif //ITK_MANUAL_INSTANTIATION
136 #endif //TOMATOLIB_COMPILED
137 
138 #endif // USE_ITK
139 
140 #endif // itkCalculatorT1ImageFilter_h
Definition: itkImageFileReaderKW.h:31
Definition: OxCalculator.h:28