Orfeo Toolbox  3.16
itkFiniteDifferenceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkFiniteDifferenceImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-10-19 14:26:45 $
7  Version: $Revision: 1.42 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkFiniteDifferenceImageFilter_h
18 #define __itkFiniteDifferenceImageFilter_h
19 
20 #include "itkInPlaceImageFilter.h"
22 
23 namespace itk {
24 
121 template <class TInputImage, class TOutputImage>
123  : public InPlaceImageFilter<TInputImage, TOutputImage>
124 {
125 public:
131 
134 
136  typedef TInputImage InputImageType;
137  typedef TOutputImage OutputImageType;
138 
140  itkStaticConstMacro(ImageDimension, unsigned int, OutputImageType::ImageDimension);
141 
143  typedef typename TOutputImage::PixelType OutputPixelType;
144  typedef typename TInputImage::PixelType InputPixelType;
146 
148  typedef typename NumericTraits< OutputPixelType >::ValueType OutputPixelValueType;
149  typedef typename NumericTraits< InputPixelType >::ValueType InputPixelValueType;
150 
156 
159 
160  typedef enum { UNINITIALIZED = 0, INITIALIZED = 1 } FilterStateType;
161 
163  itkGetConstReferenceMacro(ElapsedIterations, unsigned int);
164 
168  itkGetConstReferenceObjectMacro(DifferenceFunction,
169  FiniteDifferenceFunctionType );
170 
174  itkSetObjectMacro(DifferenceFunction, FiniteDifferenceFunctionType );
175 
176 
178  itkSetMacro(NumberOfIterations, unsigned int);
179  itkGetConstReferenceMacro(NumberOfIterations, unsigned int);
180 
183  itkSetMacro(UseImageSpacing,bool);
184  itkBooleanMacro(UseImageSpacing);
185  itkGetConstReferenceMacro(UseImageSpacing, bool);
186 
189  itkSetMacro(MaximumRMSError, double);
190  itkGetConstReferenceMacro(MaximumRMSError, double);
191 
194  itkSetMacro(RMSChange, double);
195  itkGetConstReferenceMacro(RMSChange, double);
196 
198  void SetStateToInitialized()
199  {
200  this->SetState(INITIALIZED);
201  }
202 
204  void SetStateToUninitialized()
205  {
206  this->SetState(UNINITIALIZED);
207  }
208 
210 #if !defined(CABLE_CONFIGURATION)
211  itkSetMacro(State, FilterStateType);
212  itkGetConstReferenceMacro(State, FilterStateType);
213 #endif
214 
217  itkSetMacro(ManualReinitialization, bool);
218  itkGetConstReferenceMacro(ManualReinitialization, bool);
219  itkBooleanMacro(ManualReinitialization);
220 
221 #ifdef ITK_USE_STRICT_CONCEPT_CHECKING
222 
223  itkConceptMacro(OutputPixelIsFloatingPointCheck,
226 #endif
227 
228 protected:
231  void PrintSelf(std::ostream& os, Indent indent) const;
232 
234  virtual void AllocateUpdateBuffer() = 0;
235 
239  virtual void ApplyUpdate(TimeStepType dt) = 0;
240 
246  virtual TimeStepType CalculateChange() = 0;
247 
251  virtual void CopyInputToOutput() = 0;
252 
256  virtual void GenerateData();
257 
269  virtual void GenerateInputRequestedRegion();
270 
273  virtual bool Halt();
274 
284  virtual bool ThreadedHalt(void *itkNotUsed(threadInfo)) { return this->Halt(); }
285 
291  virtual void Initialize() { };
292 
299  virtual void InitializeIteration()
300  { m_DifferenceFunction->InitializeIteration(); }
301 
315  virtual TimeStepType ResolveTimeStep(const TimeStepType* timeStepList,
316  const bool* valid,int size);
317 
319  itkSetMacro(ElapsedIterations, unsigned int);
320 
323  virtual void PostProcessOutput() {}
324 
326  unsigned int m_NumberOfIterations;
327 
330  unsigned int m_ElapsedIterations;
331 
335 
336  double m_RMSChange;
338 
339 private:
340  FiniteDifferenceImageFilter(const Self&); //purposely not implemented
341  void operator=(const Self&); //purposely not implemented
342 
346  void InitializeFunctionCoefficients();
347 
351 
354 
357 };
358 
359 }// end namespace itk
360 
361 // Define instantiation macro for this template.
362 #define ITK_TEMPLATE_FiniteDifferenceImageFilter(_, EXPORT, x, y) namespace itk { \
363  _(2(class EXPORT FiniteDifferenceImageFilter< ITK_TEMPLATE_2 x >)) \
364  namespace Templates { typedef FiniteDifferenceImageFilter< ITK_TEMPLATE_2 x > \
365  FiniteDifferenceImageFilter##y; } \
366  }
367 
368 #if ITK_TEMPLATE_EXPLICIT
369 # include "Templates/itkFiniteDifferenceImageFilter+-.h"
370 #endif
371 
372 #if ITK_TEMPLATE_TXX
374 #endif
375 
376 #endif

Generated at Sat Feb 2 2013 23:37:54 for Orfeo Toolbox with doxygen 1.8.1.1