ITK  5.0.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  ITK_DISALLOW_COPY_AND_ASSIGN(MultiphaseDenseFiniteDifferenceImageFilter);
108 
112  TFeatureImage, TOutputImage, TFunction, TIdCell >;
115 
118 
121  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
122 
124  using InputImageType = typename Superclass::InputImageType;
125  using InputImagePointer = typename Superclass::InputImagePointer;
126  using InputRegionType = typename Superclass::InputRegionType;
127  using InputSizeType = typename Superclass::InputSizeType;
128  using InputSizeValueType = typename Superclass::InputSizeValueType;
129  using InputIndexType = typename Superclass::InputIndexType;
130  using InputIndexValueType = typename Superclass::InputIndexValueType;
131  using InputPixelType = typename Superclass::InputPixelType;
132  using InputPointType = typename Superclass::InputPointType;
133  using InputSpacingType = typename Superclass::InputSpacingType;
134  using ValueType = typename InputImageType::ValueType;
135 
136  using FeatureImageType = typename Superclass::FeatureImageType;
137  using FeatureSizeType = typename Superclass::FeatureSizeType;
138  using FeatureImagePointer = typename Superclass::FeatureImagePointer;
139  using FeatureRegionType = typename Superclass::FeatureRegionType;
140  using FeatureSpacingType = typename Superclass::FeatureSpacingType;
141  using FeaturePointType = typename Superclass::FeaturePointType;
142  using FeaturePixelType = typename Superclass::FeaturePixelType;
143 
144  using OutputImageType = typename Superclass::OutputImageType;
145  using OutputImagePointer = typename Superclass::OutputImagePointer;
146  using OutputRegionType = typename Superclass::OutputRegionType;
147  using OutputSizeType = typename Superclass::OutputSizeType;
148  using SizeValueType = typename Superclass::OutputSizeValueType;
149  using OutputIndexType = typename Superclass::OutputIndexType;
150  using OutputIndexValueType = typename Superclass::OutputIndexValueType;
151  using OutputPixelType = typename OutputImageType::PixelType;
152 
153  using IdCellType = typename Superclass::IdCellType;
154 
157 
160 
161  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
162  using FiniteDifferenceFunctionPointer = typename Superclass::FiniteDifferenceFunctionPointer;
163  using NeighborhoodIteratorType = typename FiniteDifferenceFunctionType::NeighborhoodType;
164 
166  using TimeStepType = typename Superclass::TimeStepType;
167 
170 
171  void SetFunctionCount(const IdCellType & n);
172 
173 #ifdef ITK_USE_CONCEPT_CHECKING
174  // Begin concept checking
175  itkConceptMacro( OutputTimesDoubleCheck,
177  itkConceptMacro( OutputAdditiveOperatorsCheck,
179  itkConceptMacro( InputConvertibleToOutputCheck,
181  // End concept checking
182 #endif
183 
184  itkSetMacro(ReinitializeCounter, unsigned int);
185  itkGetMacro(ReinitializeCounter, unsigned int);
186 
187 protected:
189  {
190  this->m_ReinitializeCounter = 1;
191  // FIXME: this->m_UpdateCounter really used?
192  // this->m_UpdateCounter = 0; // FIXME: Should this be a bool ?
193  }
194 
196 
197  void PrintSelf(std::ostream &, Indent indent) const override;
198 
202  void CopyInputToOutput() override;
203 
204  void PostProcessOutput() override;
205 
209  void ApplyUpdate(TimeStepType dt) override;
210 
211  unsigned int m_ReinitializeCounter; // FIXME: Should this be a boolean ?
212  // unsigned int m_UpdateCounter; // FIXME: Should this be a boolean ?
213 
214 private:
217  void AllocateUpdateBuffer() override;
218 
222  TimeStepType CalculateChange() override;
223 
225  std::vector< InputImagePointer > m_UpdateBuffers;
226 };
227 } // end namespace itk
228 
229 #ifndef ITK_MANUAL_INSTANTIATION
230 #include "itkMultiphaseDenseFiniteDifferenceImageFilter.hxx"
231 #endif
232 
233 #endif
typename OutputImageType::Pointer OutputImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
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...
TOutputImage OutputImageType
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
#define itkConceptMacro(name, concept)