NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkLagrangianInitializedRelaxStreamlinesFilter.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkLagrangianInitializedRelaxStreamlinesFilter_h
16 #define itkLagrangianInitializedRelaxStreamlinesFilter_h
17 
19 #include <itkContinuousIndex.h>
20 
21 namespace itk {
44 template < class TImageType, typename TScalarType, unsigned int NDimensions>
46  public RelaxStreamlinesFilter< TImageType, TScalarType, NDimensions>
47 {
48 public:
49 
53  typedef SmartPointer<Self> Pointer;
54  typedef SmartPointer<const Self> ConstPointer;
55 
57  itkNewMacro(Self);
58 
61 
63  typedef typename Superclass::InputVectorImagePixelType InputVectorImagePixelType;
64  typedef typename Superclass::InputVectorImageType InputVectorImageType;
65  typedef typename Superclass::InputVectorImagePointer InputVectorImagePointer;
66  typedef typename Superclass::InputVectorImageConstPointer InputVectorImageConstPointer;
67  typedef typename Superclass::InputVectorImageIndexType InputVectorImageIndexType;
68  typedef typename Superclass::InputScalarImagePixelType InputScalarImagePixelType;
69  typedef typename Superclass::InputScalarImageType InputScalarImageType;
70  typedef typename Superclass::InputScalarImageSpacingType InputScalarImageSpacingType;
71  typedef typename Superclass::InputScalarImagePointType InputScalarImagePointType;
72  typedef typename Superclass::InputScalarImagePointer InputScalarImagePointer;
73  typedef typename Superclass::InputScalarImageIndexType InputScalarImageIndexType;
74  typedef typename Superclass::InputScalarImageConstPointer InputScalarImageConstPointer;
75  typedef typename Superclass::InputScalarImageRegionType InputScalarImageRegionType;
76  typedef typename Superclass::OutputImageType OutputImageType;
77  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
78  typedef typename Superclass::OutputImagePointer OutputImagePointer;
79  typedef typename Superclass::OutputImageConstPointer OutputImageConstPointer;
80  typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
81  typedef typename Superclass::OutputImageSpacingType OutputImageSpacingType;
82  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
83  typedef typename Superclass::OutputImageSizeType OutputImageSizeType;
84  typedef typename Superclass::VectorInterpolatorType VectorInterpolatorType;
86  typedef typename Superclass::VectorInterpolatorPointType VectorInterpolatorPointType;
87  typedef typename Superclass::ScalarInterpolatorType ScalarInterpolatorType;
89  typedef typename Superclass::ScalarInterpolatorPointType ScalarInterpolatorPointType;
90  typedef ContinuousIndex<TScalarType, NDimensions> ContinuousIndexType;
91 
93  void SetSegmentedImage(const InputScalarImageType *image) {this->SetNthInput(2, const_cast<InputScalarImageType *>(image)); }
94 
96  void SetGMPVMap(const InputScalarImageType *image) {this->SetNthInput(3, const_cast<InputScalarImageType *>(image)); }
97 
99  itkSetObjectMacro(GreyMatterPVInterpolator, ScalarInterpolatorType);
100  itkGetObjectMacro(GreyMatterPVInterpolator, ScalarInterpolatorType);
101 
106  itkSetMacro(StepSizeThreshold, double);
107  itkGetMacro(StepSizeThreshold, double);
108 
114  itkSetMacro(GreyMatterPercentage, double);
115  itkGetMacro(GreyMatterPercentage, double);
116 
126  itkGetMacro(MaximumSearchDistance, double);
128  {
129  m_MaximumSearchDistance = d;
130  m_DefaultMaximumSearchDistance = false;
131  }
132 
134  itkSetMacro(DefaultMaximumSearchDistance, bool);
135  itkGetMacro(DefaultMaximumSearchDistance, bool);
136 
137 protected:
140  void PrintSelf(std::ostream& os, Indent indent) const;
141 
146  virtual void InitializeBoundaries(
147  std::vector<InputScalarImageIndexType>& completeListOfGreyMatterPixels,
148  InputScalarImageType* scalarImage,
149  InputVectorImageType* vectorImage,
150  OutputImageType* L0Image,
151  OutputImageType* L1Image,
152  std::vector<InputScalarImageIndexType>& L0greyList,
153  std::vector<InputScalarImageIndexType>& L1greyList
154  );
155 
157  OutputImagePixelType LagrangianInitialisation(
158  ContinuousIndexType& index,
159  double& direction,
160  double& defaultStepSize,
161  double& minStepSize,
162  InputVectorImageType* vectorImage,
163  InputScalarImageType* greyMatterPVMap);
164 
169  void UpdateGMPVMap(
170  std::vector<InputScalarImageIndexType>& listOfGreyMatterPixels,
171  InputScalarImageType* segmentedImage,
172  InputVectorImageType* vectorImage,
173  InputScalarImageType* gmPVMapImage,
174  InputScalarImageType* editedPVMap);
175 
177  double GetMaxStepSize(InputScalarImageType* image);
178 
179 private:
180 
185  void operator=(const Self&);
186 
188  double m_StepSizeThreshold;
189 
191  double m_GreyMatterPercentage;
192 
194  double m_MaximumSearchDistance;
195 
197  bool m_DefaultMaximumSearchDistance;
198 
200  ScalarInterpolatorPointer m_GreyMatterPVInterpolator;
201 
203  VectorInterpolatorPointer m_NormalsInterpolator;
204 };
205 
206 } // end namespace
207 
208 #ifndef ITK_MANUAL_INSTANTIATION
209 #include "itkLagrangianInitializedRelaxStreamlinesFilter.txx"
210 #endif
211 
212 #endif
Superclass::InputScalarImageType InputScalarImageType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:69
Superclass::InputVectorImageIndexType InputVectorImageIndexType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:67
Superclass::OutputImageType OutputImageType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:76
Superclass::VectorInterpolatorType VectorInterpolatorType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:84
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
Superclass::ScalarInterpolatorPointType ScalarInterpolatorPointType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:89
RelaxStreamlinesFilter< TImageType, TScalarType, NDimensions > Superclass
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:52
Definition: niftkITKAffineResampleImage.cxx:74
Superclass::InputVectorImagePixelType InputVectorImagePixelType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:60
Superclass::OutputImageRegionType OutputImageRegionType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:82
Superclass::OutputImageConstPointer OutputImageConstPointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:79
SmartPointer< const Self > ConstPointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:54
void SetGMPVMap(const InputScalarImageType *image)
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:96
Superclass::InputVectorImageType InputVectorImageType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:64
Superclass::VectorInterpolatorPointType VectorInterpolatorPointType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:86
Superclass::InputScalarImageRegionType InputScalarImageRegionType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:75
Superclass::OutputImageSizeType OutputImageSizeType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:83
Superclass::OutputImageSpacingType OutputImageSpacingType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:81
Superclass::InputVectorImagePointer InputVectorImagePointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:65
LagrangianInitializedRelaxStreamlinesFilter Self
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:51
Implements section 2.3.2 in Bourgeat et. al. ISBI 2008.
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:45
Calculates length between two boundaries, solving PDE by iterative relaxation.
Definition: itkRelaxStreamlinesFilter.h:46
Superclass::InputScalarImagePointer InputScalarImagePointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:72
Superclass::InputScalarImageIndexType InputScalarImageIndexType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:73
VectorInterpolatorType::Pointer VectorInterpolatorPointer
Definition: itkRelaxStreamlinesFilter.h:91
void SetSegmentedImage(const InputScalarImageType *image)
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:93
GLuint index
Definition: glew.h:1798
void SetMaximumSearchDistance(double d)
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:127
ContinuousIndex< TScalarType, NDimensions > ContinuousIndexType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:90
~LagrangianInitializedRelaxStreamlinesFilter()
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:139
Superclass::InputScalarImageConstPointer InputScalarImageConstPointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:74
Superclass::OutputImagePointer OutputImagePointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:78
Superclass::InputScalarImagePixelType InputScalarImagePixelType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:68
Superclass::OutputImagePixelType OutputImagePixelType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:77
Superclass::ScalarInterpolatorType ScalarInterpolatorType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:87
Superclass::InputScalarImagePointType InputScalarImagePointType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:71
Superclass::VectorInterpolatorPointer VectorInterpolatorPointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:85
SmartPointer< Self > Pointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:53
Superclass::OutputImageIndexType OutputImageIndexType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:80
Superclass::InputScalarImageSpacingType InputScalarImageSpacingType
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:70
ScalarInterpolatorType::Pointer ScalarInterpolatorPointer
Definition: itkRelaxStreamlinesFilter.h:95
Superclass::InputVectorImageConstPointer InputVectorImageConstPointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:66
Superclass::ScalarInterpolatorPointer ScalarInterpolatorPointer
Definition: itkLagrangianInitializedRelaxStreamlinesFilter.h:88