ANIMA  4.0
animaT2RelaxometryEstimationImageFilter.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <itkVectorImage.h>
5 #include <itkImage.h>
6 
7 namespace anima
8 {
9 
10 template <typename TInputImage, typename TOutputImage>
12 public anima::MaskedImageToImageFilter<TInputImage,TOutputImage>
13 {
14 public:
18  typedef itk::SmartPointer<Self> Pointer;
19  typedef itk::SmartPointer<const Self> ConstPointer;
20 
22  itkNewMacro(Self)
23 
24 
26 
27 
28  typedef TInputImage InputImageType;
29  typedef TOutputImage OutputImageType;
30  typedef typename InputImageType::Pointer InputImagePointer;
31  typedef typename OutputImageType::Pointer OutputImagePointer;
32 
34  typedef typename Superclass::MaskImageType MaskImageType;
35  typedef typename Superclass::InputImageRegionType InputImageRegionType;
36  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
37 
39  void SetT1Map(OutputImageType *map) {m_T1Map = map;}
40  itkSetMacro(TRValue, double)
41  itkSetMacro(T2UpperBoundValue, double)
42  itkSetMacro(AverageSignalThreshold, double)
43  itkSetMacro(EchoSpacing, double)
44 
45  itkSetMacro(MaximumOptimizerIterations, unsigned int)
46  itkSetMacro(OptimizerStopCondition, double)
47 
48 protected:
50  : Superclass()
51  {
52  // There are 2 outputs: T2, M0
53  this->SetNumberOfRequiredOutputs(2);
54 
55  for (unsigned int i = 0;i < 2;++i)
56  this->SetNthOutput(i, this->MakeOutput(i));
57 
58  m_AverageSignalThreshold = 0;
59  m_EchoSpacing = 10;
60 
61  m_TRValue = 5000;
62  m_T2UpperBoundValue = 1000;
63 
64  m_MaximumOptimizerIterations = 5000;
65  m_OptimizerStopCondition = 1.0e-4;
66  }
67 
69 
70  void CheckComputationMask() ITK_OVERRIDE;
71 
72  void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE;
73 
74 private:
75  ITK_DISALLOW_COPY_AND_ASSIGN(T2RelaxometryEstimationImageFilter);
76 
77  double m_AverageSignalThreshold;
78 
79  // T1 relaxometry specific values
80  OutputImagePointer m_T1Map;
81 
82  // T2 relaxometry specific values
83  double m_TRValue;
84  double m_EchoSpacing;
85 
86  double m_T2UpperBoundValue;
87 
88  unsigned int m_MaximumOptimizerIterations;
89  double m_OptimizerStopCondition;
90 };
91 
92 }// end namespace anima
93 
anima::MaskedImageToImageFilter< TInputImage, TOutputImage > Superclass
itk::Image< unsigned char, TInputImage::ImageDimension > MaskImageType
Superclass::InputImageRegionType InputImageRegionType
Superclass::OutputImageRegionType OutputImageRegionType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE