ITK  4.13.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< typename TInputImage, typename TFeatureImage, typename TOutputImage, typename 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  // Begin concept checking
174  itkConceptMacro( OutputTimesDoubleCheck,
176  itkConceptMacro( OutputAdditiveOperatorsCheck,
178  itkConceptMacro( InputConvertibleToOutputCheck,
180  // End concept checking
181 #endif
182 
183  itkSetMacro(ReinitializeCounter, unsigned int);
184  itkGetMacro(ReinitializeCounter, unsigned int);
185 
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 ITK_OVERRIDE;
197 
201  virtual void CopyInputToOutput() ITK_OVERRIDE;
202 
203  virtual void PostProcessOutput() ITK_OVERRIDE;
204 
208  virtual void ApplyUpdate(TimeStepType dt) ITK_OVERRIDE;
209 
210  unsigned int m_ReinitializeCounter; // FIXME: Should this be a boolean ?
211  // unsigned int m_UpdateCounter; // FIXME: Should this be a boolean ?
212 
213 private:
214  ITK_DISALLOW_COPY_AND_ASSIGN(MultiphaseDenseFiniteDifferenceImageFilter);
215 
218  virtual void AllocateUpdateBuffer() ITK_OVERRIDE;
219 
223  virtual TimeStepType CalculateChange() ITK_OVERRIDE;
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
MultiphaseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction, TIdCell > Superclass
FiniteDifferenceFunctionType::NeighborhoodType NeighborhoodIteratorType
This filter calculates the Euclidean distance transform of a binary image in linear time for arbitrar...
Binarize an input image by thresholding.
Splits an image into a main region and several &quot;face&quot; regions which are used to handle computations o...
SignedMaurerDistanceMapImageFilter< InputImageType, InputImageType > MaurerType
NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< InputImageType > FaceCalculatorType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
BinaryThresholdImageFilter< InputImageType, InputImageType > ThresholdFilterType
#define itkConceptMacro(name, concept)