ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkMultiphaseDenseFiniteDifferenceImageFilter.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 __itkMultiphaseDenseFiniteDifferenceImageFilter_h
19 #define __itkMultiphaseDenseFiniteDifferenceImageFilter_h
20 
24 #include "itkNumericTraits.h"
26 
27 #include <list>
28 
29 namespace itk
30 {
100 template< class TInputImage, class TFeatureImage, class TOutputImage, class TFunction,
101  typename TIdCell = unsigned int >
103  public MultiphaseFiniteDifferenceImageFilter< TInputImage, TFeatureImage,
104  TOutputImage, TFunction, TIdCell >
105 {
106 public:
107 
110  typedef MultiphaseFiniteDifferenceImageFilter< TInputImage,
111  TFeatureImage, TOutputImage, TFunction, TIdCell > Superclass;
114 
117 
120  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
121 
123  typedef typename Superclass::InputImageType InputImageType;
124  typedef typename Superclass::InputImagePointer InputImagePointer;
125  typedef typename Superclass::InputRegionType InputRegionType;
126  typedef typename Superclass::InputSizeType InputSizeType;
127  typedef typename Superclass::InputSizeValueType InputSizeValueType;
128  typedef typename Superclass::InputIndexType InputIndexType;
129  typedef typename Superclass::InputIndexValueType InputIndexValueType;
130  typedef typename Superclass::InputPixelType InputPixelType;
131  typedef typename Superclass::InputPointType InputPointType;
132  typedef typename Superclass::InputSpacingType InputSpacingType;
133  typedef typename InputImageType::ValueType ValueType;
134 
135  typedef typename Superclass::FeatureImageType FeatureImageType;
136  typedef typename Superclass::FeatureSizeType FeatureSizeType;
137  typedef typename Superclass::FeatureImagePointer FeatureImagePointer;
138  typedef typename Superclass::FeatureRegionType FeatureRegionType;
139  typedef typename Superclass::FeatureSpacingType FeatureSpacingType;
140  typedef typename Superclass::FeaturePointType FeaturePointType;
141  typedef typename Superclass::FeaturePixelType FeaturePixelType;
142 
143  typedef typename Superclass::OutputImageType OutputImageType;
144  typedef typename Superclass::OutputImagePointer OutputImagePointer;
145  typedef typename Superclass::OutputRegionType OutputRegionType;
146  typedef typename Superclass::OutputSizeType OutputSizeType;
147  typedef typename Superclass::OutputSizeValueType SizeValueType;
148  typedef typename Superclass::OutputIndexType OutputIndexType;
149  typedef typename Superclass::OutputIndexValueType OutputIndexValueType;
150  typedef typename OutputImageType::PixelType OutputPixelType;
151 
152  typedef typename Superclass::IdCellType IdCellType;
153 
156 
159 
160  typedef typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType;
161  typedef typename Superclass::FiniteDifferenceFunctionPointer FiniteDifferenceFunctionPointer;
162  typedef typename FiniteDifferenceFunctionType::NeighborhoodType NeighborhoodIteratorType;
163 
165  typedef typename Superclass::TimeStepType TimeStepType;
166 
169 
170  void SetFunctionCount(const IdCellType & n);
171 
172 #ifdef ITK_USE_CONCEPT_CHECKING
173 
174  itkConceptMacro( OutputTimesDoubleCheck,
176  itkConceptMacro( OutputAdditiveOperatorsCheck,
178  itkConceptMacro( InputConvertibleToOutputCheck,
180 
182 #endif
183 
184  itkSetMacro(ReinitializeCounter, unsigned int);
185  itkGetMacro(ReinitializeCounter, unsigned int);
186 protected:
188  {
189  this->m_ReinitializeCounter = 1;
190  // FIXME: this->m_UpdateCounter really used?
191  // this->m_UpdateCounter = 0; // FIXME: Should this be a bool ?
192  }
193 
195 
196  virtual void PrintSelf(std::ostream &, Indent indent) const;
197 
201  virtual void CopyInputToOutput();
202 
203  virtual void PostProcessOutput();
204 
208  virtual void ApplyUpdate(TimeStepType dt);
209 
210  unsigned int m_ReinitializeCounter; // FIXME: Should this be a boolean ?
211  // unsigned int m_UpdateCounter; // FIXME: Should this be a boolean ?
212 private:
214  void operator=(const Self &); //purposely not implemented
215 
218  virtual void AllocateUpdateBuffer();
219 
223  virtual TimeStepType CalculateChange();
224 
226  std::vector< InputImagePointer > m_UpdateBuffers;
227 };
228 } // end namespace itk
229 
230 #ifndef ITK_MANUAL_INSTANTIATION
231 #include "itkMultiphaseDenseFiniteDifferenceImageFilter.hxx"
232 #endif
233 
234 #endif
235