ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkFastMarchingUpwindGradientImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkFastMarchingUpwindGradientImageFilter_h
19 #define itkFastMarchingUpwindGradientImageFilter_h
20 
22 #include "itkImage.h"
23 
24 namespace itk
25 {
58 template<
59  typename TLevelSet,
60  typename TSpeedImage = Image< float, TLevelSet ::ImageDimension > >
62  public FastMarchingImageFilter< TLevelSet, TSpeedImage >
63 {
64 public:
70 
72  itkNewMacro(Self);
73 
76 
78  typedef typename Superclass::LevelSetType LevelSetType;
84  typedef typename Superclass::PixelType PixelType;
85  typedef typename Superclass::AxisNodeType AxisNodeType;
86  typedef typename Superclass::NodeType NodeType;
89 
90  typedef typename Superclass::IndexType IndexType;
93 
95 
97  itkStaticConstMacro(SetDimension, unsigned int, Superclass::SetDimension);
98 
103  {
104  m_TargetPoints = points;
105  this->Modified();
106  }
108 
111  { return m_TargetPoints; }
112 
115  { return m_ReachedTargetPoints; }
116 
118  typedef CovariantVector< PixelType,
119  itkGetStaticConstMacro(SetDimension) > GradientPixelType;
120 
122  typedef Image< GradientPixelType,
123  itkGetStaticConstMacro(SetDimension) > GradientImageType;
124 
127 
130  { return m_GradientImage; }
131 
134  itkSetMacro(GenerateGradientImage, bool);
135 
137  itkGetConstReferenceMacro(GenerateGradientImage, bool);
138  itkBooleanMacro(GenerateGradientImage);
140 
144  itkSetMacro(TargetOffset, double);
145 
147  itkGetConstReferenceMacro(TargetOffset, double);
148 
152  itkSetMacro(TargetReachedMode, int);
153  itkGetConstReferenceMacro(TargetReachedMode, int);
155  { this->SetTargetReachedMode(NoTargets); }
157  { this->SetTargetReachedMode(OneTarget); }
159  {
161  m_NumberOfTargets = numberOfTargets;
162  }
164 
166  { this->SetTargetReachedMode(AllTargets); }
167 
169  itkGetConstReferenceMacro(NumberOfTargets, SizeValueType);
170 
175  itkGetConstReferenceMacro(TargetValue, double);
176 
177  enum {
182  };
183 
184 #ifdef ITK_USE_CONCEPT_CHECKING
185  // Begin concept checking
186  itkConceptMacro( LevelSetDoubleDivisionOperatorsCheck,
188  itkConceptMacro( LevelSetDoubleDivisionAndAssignOperatorsCheck,
190  // End concept checking
191 #endif
192 
193 protected:
196  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
197 
198  virtual void Initialize(LevelSetImageType *) ITK_OVERRIDE;
199 
200  void GenerateData() ITK_OVERRIDE;
201 
202  virtual void UpdateNeighbors(const IndexType & index,
203  const SpeedImageType *, LevelSetImageType *) ITK_OVERRIDE;
204 
205  virtual void ComputeGradient(const IndexType & index,
206  const LevelSetImageType *output,
207  const LabelImageType *labelImage,
208  GradientImageType *gradientImage);
209 
210 private:
211  FastMarchingUpwindGradientImageFilter(const Self &); //purposely not
212  // implemented
213  void operator=(const Self &); //purposely not
214  // implemented
215 
218 
220 
222 
224 
226 
228 
230 };
231 } // namespace itk
232 
233 #ifndef ITK_MANUAL_INSTANTIATION
234 #include "itkFastMarchingUpwindGradientImageFilter.hxx"
235 #endif
236 
237 #endif
SpeedImageType::ConstPointer SpeedImageConstPointer
FastMarchingImageFilter< TLevelSet, TSpeedImage > Superclass
Light weight base class for most itk classes.
LevelSetImageType::IndexType LevelSetIndexType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
virtual void Initialize(LevelSetImageType *) override
LevelSetImageType::SpacingType OutputSpacingType
Image< GradientPixelType, itkGetStaticConstMacro(SetDimension) > GradientImageType
Image< unsigned char, itkGetStaticConstMacro(SetDimension) > LabelImageType
virtual void ComputeGradient(const IndexType &index, const LevelSetImageType *output, const LabelImageType *labelImage, GradientImageType *gradientImage)
LevelSetTypeDefault< TLevelSet > LevelSetType
LevelSetType::NodeContainer NodeContainer
virtual void Modified() const
Generates the upwind gradient field of fast marching arrival times.
LevelSetType::LevelSetPointer LevelSetPointer
CovariantVector< PixelType, itkGetStaticConstMacro(SetDimension) > GradientPixelType
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
LevelSetType::LevelSetImageType LevelSetImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
LevelSetImageType::PointType OutputPointType
Solve an Eikonal equation using Fast Marching.
virtual void SetTargetReachedMode(int _arg)
#define itkConceptMacro(name, concept)
A templated class holding a n-Dimensional covariant vector.
void PrintSelf(std::ostream &os, Indent indent) const override
static const unsigned int SetDimension
Index< itkGetStaticConstMacro(SetDimension) > IndexType
virtual void UpdateNeighbors(const IndexType &index, const SpeedImageType *, LevelSetImageType *) override
Templated n-dimensional image class.
Definition: itkImage.h:75