VMTK
Loading...
Searching...
No Matches
itkFastMarchingUpwindGradientImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Insight Segmentation & Registration Toolkit
4
5 Copyright (c) Insight Software Consortium. All rights reserved.
6 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
7
8 This software is distributed WITHOUT ANY WARRANTY; without even
9 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 PURPOSE. See the above copyright notices for more information.
11
12=========================================================================*/
13
14#ifndef __itkFastMarchingUpwindGradientImageFilter_h
15#define __itkFastMarchingUpwindGradientImageFilter_h
16
17#include "itkFastMarchingImageFilter.h"
18#include "itkImage.h"
19
20namespace itk
21{
54template <
55 class TLevelSet,
56 class TSpeedImage = Image<float,TLevelSet::ImageDimension> >
58 public FastMarchingImageFilter<TLevelSet,TSpeedImage>
59{
60
61public:
64 typedef FastMarchingImageFilter<TLevelSet,TSpeedImage> Superclass;
65 typedef SmartPointer<Self> Pointer;
66 typedef SmartPointer<const Self> ConstPointer;
67
70
73
75 typedef typename Superclass::LevelSetType LevelSetType;
76 typedef typename Superclass::SpeedImageType SpeedImageType;
77 typedef typename Superclass::LevelSetImageType LevelSetImageType;
78 typedef typename Superclass::LevelSetPointer LevelSetPointer;
79 typedef typename Superclass::SpeedImageConstPointer SpeedImageConstPointer;
80 typedef typename Superclass::LabelImageType LabelImageType;
81 typedef typename Superclass::PixelType PixelType;
82 typedef typename Superclass::AxisNodeType AxisNodeType;
83 typedef typename Superclass::NodeType NodeType;
84 typedef typename Superclass::NodeContainer NodeContainer;
85 typedef typename Superclass::NodeContainerPointer NodeContainerPointer;
86
87 typedef typename Superclass::IndexType IndexType;
88 typedef typename Superclass::OutputSpacingType OutputSpacingType;
89 typedef typename Superclass::LevelSetIndexType LevelSetIndexType;
90
91 typedef typename Superclass::OutputPointType PointType;
92
93
95 itkStaticConstMacro(SetDimension, unsigned int,Superclass::SetDimension);
96
101 {
102 m_TargetPoints = points;
103 this->Modified();
104 };
105
108 { return m_TargetPoints; }
109
112 { return m_ReachedTargetPoints; }
113
115 typedef CovariantVector<PixelType,
116 itkGetStaticConstMacro(SetDimension)> GradientPixelType;
117
119 typedef Image<GradientPixelType,
120 itkGetStaticConstMacro(SetDimension)> GradientImageType;
121
123 typedef typename GradientImageType::Pointer GradientImagePointer;
124
127 { return m_GradientImage; }
128
131 itkSetMacro( GenerateGradientImage, bool );
132
134 itkGetConstReferenceMacro( GenerateGradientImage, bool );
135 itkBooleanMacro( GenerateGradientImage );
136
140 itkSetMacro( TargetOffset, double );
142 itkGetConstReferenceMacro( TargetOffset, double );
143
147 itkSetMacro( TargetReachedMode, int );
148 itkGetConstReferenceMacro( TargetReachedMode, int );
150 { this->SetTargetReachedMode(NoTargets); }
152 { this->SetTargetReachedMode(OneTarget); }
153 void SetTargetReachedModeToSomeTargets( long numberOfTargets )
154 {
155 this->SetTargetReachedMode(SomeTargets);
156 m_NumberOfTargets = numberOfTargets;
157 }
159 { this->SetTargetReachedMode(AllTargets); }
160
162 itkGetConstReferenceMacro( NumberOfTargets, long );
163
168 itkGetConstReferenceMacro( TargetValue, double );
169
170 enum
171 {
176 };
177
178#ifdef ITK_USE_CONCEPT_CHECKING
180 itkConceptMacro(LevelSetDoubleDivisionOperatorsCheck,
181 (Concept::DivisionOperators<typename TLevelSet::PixelType, double>));
183#endif
184
185protected:
188 void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
189
190 virtual void Initialize( LevelSetImageType * ) ITK_OVERRIDE;
191
192 void GenerateData() ITK_OVERRIDE;
193
194 virtual void UpdateNeighbors( const IndexType& index,
195 const SpeedImageType *, LevelSetImageType * ) ITK_OVERRIDE;
196
197 virtual void ComputeGradient( const IndexType& index ,
198 const LevelSetImageType * output,
199 const LabelImageType * labelImage,
200 GradientImageType * gradientImage);
201
202private:
203 FastMarchingUpwindGradientImageFilter(const Self&); //purposely not implemented
204 void operator=(const Self&); //purposely not implemented
205
206 NodeContainerPointer m_TargetPoints;
207 NodeContainerPointer m_ReachedTargetPoints;
208
209 GradientImagePointer m_GradientImage;
210
211 bool m_GenerateGradientImage;
212
213 double m_TargetOffset;
214
215 int m_TargetReachedMode;
216
217 double m_TargetValue;
218
219 long m_NumberOfTargets;
220
221};
222
223} // namespace itk
224
225
226#ifndef ITK_MANUAL_INSTANTIATION
227#include "itkFastMarchingUpwindGradientImageFilter.txx"
228#endif
229
230#endif
itkGetConstReferenceMacro(TargetValue, double)
virtual void ComputeGradient(const IndexType &index, const LevelSetImageType *output, const LabelImageType *labelImage, GradientImageType *gradientImage)
itkGetConstReferenceMacro(GenerateGradientImage, bool)
itkSetMacro(GenerateGradientImage, bool)
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
itkGetConstReferenceMacro(TargetReachedMode, int)
itkGetConstReferenceMacro(NumberOfTargets, long)
itkGetConstReferenceMacro(TargetOffset, double)
virtual void Initialize(LevelSetImageType *) ITK_OVERRIDE
CovariantVector< PixelType, itkGetStaticConstMacro(SetDimension)> GradientPixelType
itkStaticConstMacro(SetDimension, unsigned int, Superclass::SetDimension)
virtual void UpdateNeighbors(const IndexType &index, const SpeedImageType *, LevelSetImageType *) ITK_OVERRIDE
Image< GradientPixelType, itkGetStaticConstMacro(SetDimension)> GradientImageType
itkTypeMacro(FastMarchingUpwindGradientImageFilter, FastMarchingImageFilter)