ITK  5.2.0
Insight Toolkit
itkFastMarchingUpwindGradientImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
60 template <typename TLevelSet, typename TSpeedImage = Image<float, TLevelSet ::ImageDimension>>
61 class ITK_TEMPLATE_EXPORT FastMarchingUpwindGradientImageFilter : public FastMarchingImageFilter<TLevelSet, TSpeedImage>
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_ASSIGN(FastMarchingUpwindGradientImageFilter);
65 
71 
73  itkNewMacro(Self);
74 
77 
79  using LevelSetType = typename Superclass::LevelSetType;
80  using SpeedImageType = typename Superclass::SpeedImageType;
81  using LevelSetImageType = typename Superclass::LevelSetImageType;
82  using LevelSetPointer = typename Superclass::LevelSetPointer;
83  using SpeedImageConstPointer = typename Superclass::SpeedImageConstPointer;
84  using LabelImageType = typename Superclass::LabelImageType;
85  using PixelType = typename Superclass::PixelType;
86  using AxisNodeType = typename Superclass::AxisNodeType;
87  using NodeType = typename Superclass::NodeType;
88  using NodeContainer = typename Superclass::NodeContainer;
90 
91  using IndexType = typename Superclass::IndexType;
92  using OutputSpacingType = typename Superclass::OutputSpacingType;
93  using LevelSetIndexType = typename Superclass::LevelSetIndexType;
94 
95  using PointType = typename Superclass::OutputPointType;
96 
98  static constexpr unsigned int SetDimension = Superclass::SetDimension;
99 
103  void
105  {
106  m_TargetPoints = points;
107  this->Modified();
108  }
110 
112  NodeContainerPointer
114  {
115  return m_TargetPoints;
116  }
117 
119  NodeContainerPointer
121  {
122  return m_ReachedTargetPoints;
123  }
124 
127 
130 
133 
137  {
138  return m_GradientImage;
139  }
140 
143  itkSetMacro(GenerateGradientImage, bool);
144 
146  itkGetConstReferenceMacro(GenerateGradientImage, bool);
147  itkBooleanMacro(GenerateGradientImage);
149 
153  itkSetMacro(TargetOffset, double);
154 
156  itkGetConstReferenceMacro(TargetOffset, double);
157 
161  itkSetMacro(TargetReachedMode, int);
162  itkGetConstReferenceMacro(TargetReachedMode, int);
163  void
165  {
166  this->SetTargetReachedMode(NoTargets);
167  }
168  void
170  {
171  this->SetTargetReachedMode(OneTarget);
172  }
173  void
175  {
176  this->SetTargetReachedMode(SomeTargets);
177  m_NumberOfTargets = numberOfTargets;
178  }
180 
181  void
183  {
184  this->SetTargetReachedMode(AllTargets);
185  }
186 
188  itkGetConstReferenceMacro(NumberOfTargets, SizeValueType);
189 
194  itkGetConstReferenceMacro(TargetValue, double);
195 
196  enum
197  {
201  AllTargets
202  };
203 
204 #ifdef ITK_USE_CONCEPT_CHECKING
205  // Begin concept checking
206  itkConceptMacro(LevelSetDoubleDivisionOperatorsCheck,
208  itkConceptMacro(LevelSetDoubleDivisionAndAssignOperatorsCheck,
210  // End concept checking
211 #endif
212 
213 protected:
215  ~FastMarchingUpwindGradientImageFilter() override = default;
216  void
217  PrintSelf(std::ostream & os, Indent indent) const override;
218 
219  void
220  Initialize(LevelSetImageType *) override;
221 
222  void
223  GenerateData() override;
224 
225  void
226  UpdateNeighbors(const IndexType & index, const SpeedImageType *, LevelSetImageType *) override;
227 
228  virtual void
229  ComputeGradient(const IndexType & index,
230  const LevelSetImageType * output,
231  const LabelImageType * labelImage,
232  GradientImageType * gradientImage);
233 
234 private:
237 
239 
241 
243 
245 
247 
249 };
250 } // namespace itk
251 
252 #ifndef ITK_MANUAL_INSTANTIATION
253 # include "itkFastMarchingUpwindGradientImageFilter.hxx"
254 #endif
255 
256 #endif
itk::FastMarchingUpwindGradientImageFilter::OneTarget
Definition: itkFastMarchingUpwindGradientImageFilter.h:199
itk::FastMarchingImageFilter::PixelType
typename LevelSetType::PixelType PixelType
Definition: itkFastMarchingImageFilter.h:157
itk::LevelSetTypeDefault
Level set type information.
Definition: itkLevelSet.h:40
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
itk::FastMarchingUpwindGradientImageFilter::m_TargetReachedMode
int m_TargetReachedMode
Definition: itkFastMarchingUpwindGradientImageFilter.h:244
itk::FastMarchingUpwindGradientImageFilter::SetTargetReachedModeToAllTargets
void SetTargetReachedModeToAllTargets()
Definition: itkFastMarchingUpwindGradientImageFilter.h:182
itk::FastMarchingUpwindGradientImageFilter::m_GenerateGradientImage
bool m_GenerateGradientImage
Definition: itkFastMarchingUpwindGradientImageFilter.h:240
itk::FastMarchingImageFilter::LevelSetPointer
typename LevelSetType::LevelSetPointer LevelSetPointer
Definition: itkFastMarchingImageFilter.h:156
itk::FastMarchingUpwindGradientImageFilter::m_GradientImage
GradientImagePointer m_GradientImage
Definition: itkFastMarchingUpwindGradientImageFilter.h:238
itk::FastMarchingUpwindGradientImageFilter::NoTargets
Definition: itkFastMarchingUpwindGradientImageFilter.h:198
itk::FastMarchingImageFilter::OutputSpacingType
typename LevelSetImageType::SpacingType OutputSpacingType
Definition: itkFastMarchingImageFilter.h:164
itkImage.h
itk::FastMarchingUpwindGradientImageFilter::m_ReachedTargetPoints
NodeContainerPointer m_ReachedTargetPoints
Definition: itkFastMarchingUpwindGradientImageFilter.h:236
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::FastMarchingUpwindGradientImageFilter::GetReachedTargetPoints
NodeContainerPointer GetReachedTargetPoints()
Definition: itkFastMarchingUpwindGradientImageFilter.h:120
itk::FastMarchingUpwindGradientImageFilter
Generates the upwind gradient field of fast marching arrival times.
Definition: itkFastMarchingUpwindGradientImageFilter.h:61
itk::Concept::DivisionAndAssignOperators
Definition: itkConceptChecking.h:500
itk::FastMarchingUpwindGradientImageFilter::GetTargetPoints
NodeContainerPointer GetTargetPoints()
Definition: itkFastMarchingUpwindGradientImageFilter.h:113
itk::FastMarchingUpwindGradientImageFilter::m_NumberOfTargets
SizeValueType m_NumberOfTargets
Definition: itkFastMarchingUpwindGradientImageFilter.h:248
itk::FastMarchingImageFilter::LevelSetIndexType
typename LevelSetImageType::IndexType LevelSetIndexType
Definition: itkFastMarchingImageFilter.h:432
itk::FastMarchingUpwindGradientImageFilter::SetTargetReachedModeToNoTargets
void SetTargetReachedModeToNoTargets()
Definition: itkFastMarchingUpwindGradientImageFilter.h:164
itkFastMarchingImageFilter.h
itk::FastMarchingImageFilter::NodeType
typename LevelSetType::NodeType NodeType
Definition: itkFastMarchingImageFilter.h:158
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::FastMarchingUpwindGradientImageFilter::GetGradientImage
GradientImagePointer GetGradientImage() const
Definition: itkFastMarchingUpwindGradientImageFilter.h:136
itk::FastMarchingUpwindGradientImageFilter::SetTargetPoints
void SetTargetPoints(NodeContainer *points)
Definition: itkFastMarchingUpwindGradientImageFilter.h:104
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::FastMarchingImageFilter
Solve an Eikonal equation using Fast Marching.
Definition: itkFastMarchingImageFilter.h:136
itk::FastMarchingImageFilter::SpeedImageType
TSpeedImage SpeedImageType
Definition: itkFastMarchingImageFilter.h:194
itk::FastMarchingUpwindGradientImageFilter::SetTargetReachedModeToSomeTargets
void SetTargetReachedModeToSomeTargets(SizeValueType numberOfTargets)
Definition: itkFastMarchingUpwindGradientImageFilter.h:174
itk::FastMarchingUpwindGradientImageFilter::m_TargetValue
double m_TargetValue
Definition: itkFastMarchingUpwindGradientImageFilter.h:246
itk::Concept::DivisionOperators
Definition: itkConceptChecking.h:471
itk::FastMarchingUpwindGradientImageFilter::SomeTargets
Definition: itkFastMarchingUpwindGradientImageFilter.h:200
itk::FastMarchingUpwindGradientImageFilter::PointType
typename Superclass::OutputPointType PointType
Definition: itkFastMarchingUpwindGradientImageFilter.h:95
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk::FastMarchingUpwindGradientImageFilter::SetTargetReachedModeToOneTarget
void SetTargetReachedModeToOneTarget()
Definition: itkFastMarchingUpwindGradientImageFilter.h:169
itk::FastMarchingUpwindGradientImageFilter::GradientImagePointer
typename GradientImageType::Pointer GradientImagePointer
Definition: itkFastMarchingUpwindGradientImageFilter.h:132
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::FastMarchingImageFilter::NodeContainer
typename LevelSetType::NodeContainer NodeContainer
Definition: itkFastMarchingImageFilter.h:160
itk::FastMarchingImageFilter::NodeContainerPointer
typename LevelSetType::NodeContainerPointer NodeContainerPointer
Definition: itkFastMarchingImageFilter.h:161
itk::FastMarchingImageFilter::LevelSetImageType
typename LevelSetType::LevelSetImageType LevelSetImageType
Definition: itkFastMarchingImageFilter.h:155
itk::FastMarchingUpwindGradientImageFilter::m_TargetPoints
NodeContainerPointer m_TargetPoints
Definition: itkFastMarchingUpwindGradientImageFilter.h:235
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::FastMarchingImageFilter::SpeedImageConstPointer
typename SpeedImageType::ConstPointer SpeedImageConstPointer
Definition: itkFastMarchingImageFilter.h:198
itk::FastMarchingUpwindGradientImageFilter::AxisNodeType
typename Superclass::AxisNodeType AxisNodeType
Definition: itkFastMarchingUpwindGradientImageFilter.h:86
itk::FastMarchingUpwindGradientImageFilter::m_TargetOffset
double m_TargetOffset
Definition: itkFastMarchingUpwindGradientImageFilter.h:242
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83