ITK  5.3.0
Insight Toolkit
itkMultiphaseDenseFiniteDifferenceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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,
101  typename TFeatureImage,
102  typename TOutputImage,
103  typename TFunction,
104  typename TIdCell = unsigned int>
106  : public MultiphaseFiniteDifferenceImageFilter<TInputImage, TFeatureImage, TOutputImage, TFunction, TIdCell>
107 {
108 public:
109  ITK_DISALLOW_COPY_AND_MOVE(MultiphaseDenseFiniteDifferenceImageFilter);
110 
113  using Superclass =
117 
120 
123  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
124 
126  using typename Superclass::InputImageType;
127  using typename Superclass::InputImagePointer;
128  using typename Superclass::InputRegionType;
129  using typename Superclass::InputSizeType;
130  using typename Superclass::InputSizeValueType;
131  using typename Superclass::InputIndexType;
132  using typename Superclass::InputIndexValueType;
133  using typename Superclass::InputPixelType;
134  using typename Superclass::InputPointType;
135  using typename Superclass::InputSpacingType;
136  using ValueType = typename InputImageType::ValueType;
137 
138  using typename Superclass::FeatureImageType;
139  using typename Superclass::FeatureSizeType;
140  using typename Superclass::FeatureImagePointer;
141  using typename Superclass::FeatureRegionType;
142  using typename Superclass::FeatureSpacingType;
143  using typename Superclass::FeaturePointType;
144  using typename Superclass::FeaturePixelType;
145 
146  using typename Superclass::OutputImageType;
147  using typename Superclass::OutputImagePointer;
148  using typename Superclass::OutputRegionType;
149  using typename Superclass::OutputSizeType;
150  using SizeValueType = typename Superclass::OutputSizeValueType;
151  using typename Superclass::OutputIndexType;
152  using typename Superclass::OutputIndexValueType;
153  using OutputPixelType = typename OutputImageType::PixelType;
154 
155  using typename Superclass::IdCellType;
156 
159 
162 
163  using typename Superclass::FiniteDifferenceFunctionType;
164  using typename Superclass::FiniteDifferenceFunctionPointer;
165  using NeighborhoodIteratorType = typename FiniteDifferenceFunctionType::NeighborhoodType;
166 
168  using typename Superclass::TimeStepType;
169 
172 
173  void
174  SetFunctionCount(const IdCellType & n);
175 
176 #ifdef ITK_USE_CONCEPT_CHECKING
177  // Begin concept checking
179  itkConceptMacro(OutputAdditiveOperatorsCheck, (Concept::AdditiveOperators<OutputPixelType>));
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 
195  ~MultiphaseDenseFiniteDifferenceImageFilter() override = default;
196 
197  void
198  PrintSelf(std::ostream &, Indent indent) const override;
199 
203  void
204  CopyInputToOutput() override;
205 
206  void
207  PostProcessOutput() override;
208 
212  void
213  ApplyUpdate(TimeStepType dt) override;
214 
215  unsigned int m_ReinitializeCounter; // FIXME: Should this be a boolean ?
216  // unsigned int m_UpdateCounter; // FIXME: Should this be a boolean ?
217 
218 private:
221  void
222  AllocateUpdateBuffer() override;
223 
228  CalculateChange() override;
229 
231  std::vector<InputImagePointer> m_UpdateBuffers;
232 };
233 } // end namespace itk
234 
235 #ifndef ITK_MANUAL_INSTANTIATION
236 # include "itkMultiphaseDenseFiniteDifferenceImageFilter.hxx"
237 #endif
238 
239 #endif
itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator
Splits an image into a main region and several "face" regions which are used to handle computations o...
Definition: itkNeighborhoodAlgorithm.h:63
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::ThresholdFilterPointer
typename ThresholdFilterType::Pointer ThresholdFilterPointer
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:158
itkMultiphaseFiniteDifferenceImageFilter.h
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::NeighborhoodIteratorType
typename FiniteDifferenceFunctionType::NeighborhoodType NeighborhoodIteratorType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:165
itkNeighborhoodAlgorithm.h
itk::MultiphaseDenseFiniteDifferenceImageFilter::MultiphaseDenseFiniteDifferenceImageFilter
MultiphaseDenseFiniteDifferenceImageFilter()
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:188
itk::BinaryThresholdImageFilter
Binarize an input image by thresholding.
Definition: itkBinaryThresholdImageFilter.h:132
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:153
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MultiphaseDenseFiniteDifferenceImageFilter::m_UpdateBuffers
std::vector< InputImagePointer > m_UpdateBuffers
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:231
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::MultiphaseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction, unsigned int >::TimeStepType
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
Definition: itkMultiphaseFiniteDifferenceImageFilter.h:221
itkSignedMaurerDistanceMapImageFilter.h
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:419
itk::MultiphaseFiniteDifferenceImageFilter
Definition: itkMultiphaseFiniteDifferenceImageFilter.h:165
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::ValueType
typename InputImageType::ValueType ValueType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:136
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FaceListType
typename FaceCalculatorType::FaceListType FaceListType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:171
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:358
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::SizeValueType
typename Superclass::OutputSizeValueType SizeValueType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:150
itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::FaceListType
std::list< RegionType > FaceListType
Definition: itkNeighborhoodAlgorithm.h:69
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::MultiphaseDenseFiniteDifferenceImageFilter::m_ReinitializeCounter
unsigned int m_ReinitializeCounter
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:215
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itkNumericTraits.h
itkBinaryThresholdImageFilter.h
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::MaurerPointer
typename MaurerType::Pointer MaurerPointer
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:161
itk::MultiphaseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction, unsigned int >::IdCellType
unsigned int IdCellType
Definition: itkMultiphaseFiniteDifferenceImageFilter.h:213
itk::SignedMaurerDistanceMapImageFilter
This filter calculates the Euclidean distance transform of a binary image in linear time for arbitrar...
Definition: itkSignedMaurerDistanceMapImageFilter.h:67
itk::MultiphaseDenseFiniteDifferenceImageFilter
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:105