ITK  6.0.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  * https://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 {
97 template <typename TInputImage,
98  typename TFeatureImage,
99  typename TOutputImage,
100  typename TFunction,
101  typename TIdCell = unsigned int>
103  : public MultiphaseFiniteDifferenceImageFilter<TInputImage, TFeatureImage, TOutputImage, TFunction, TIdCell>
104 {
105 public:
106  ITK_DISALLOW_COPY_AND_MOVE(MultiphaseDenseFiniteDifferenceImageFilter);
107 
110  using Superclass =
114 
116  itkOverrideGetNameOfClassMacro(MultiphaseDenseFiniteDifferenceImageFilter);
117 
120  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
121 
123  using typename Superclass::InputImageType;
124  using typename Superclass::InputImagePointer;
125  using typename Superclass::InputRegionType;
126  using typename Superclass::InputSizeType;
127  using typename Superclass::InputSizeValueType;
128  using typename Superclass::InputIndexType;
129  using typename Superclass::InputIndexValueType;
130  using typename Superclass::InputPixelType;
131  using typename Superclass::InputPointType;
132  using typename Superclass::InputSpacingType;
133  using ValueType = typename InputImageType::ValueType;
134 
135  using typename Superclass::FeatureImageType;
136  using typename Superclass::FeatureSizeType;
137  using typename Superclass::FeatureImagePointer;
138  using typename Superclass::FeatureRegionType;
139  using typename Superclass::FeatureSpacingType;
140  using typename Superclass::FeaturePointType;
141  using typename Superclass::FeaturePixelType;
142 
143  using typename Superclass::OutputImageType;
144  using typename Superclass::OutputImagePointer;
145  using typename Superclass::OutputRegionType;
146  using typename Superclass::OutputSizeType;
147  using SizeValueType = typename Superclass::OutputSizeValueType;
148  using typename Superclass::OutputIndexType;
149  using typename Superclass::OutputIndexValueType;
150  using OutputPixelType = typename OutputImageType::PixelType;
151 
152  using typename Superclass::IdCellType;
153 
156 
159 
160  using typename Superclass::FiniteDifferenceFunctionType;
161  using typename Superclass::FiniteDifferenceFunctionPointer;
162  using NeighborhoodIteratorType = typename FiniteDifferenceFunctionType::NeighborhoodType;
163 
165  using typename Superclass::TimeStepType;
166 
169 
170  void
171  SetFunctionCount(const IdCellType & n);
172 
173 #ifdef ITK_USE_CONCEPT_CHECKING
174  // Begin concept checking
176  itkConceptMacro(OutputAdditiveOperatorsCheck, (Concept::AdditiveOperators<OutputPixelType>));
178  // End concept checking
179 #endif
180 
181  itkSetMacro(ReinitializeCounter, unsigned int);
182  itkGetMacro(ReinitializeCounter, unsigned int);
183 
184 protected:
186  {
187  this->m_ReinitializeCounter = 1;
188  // FIXME: this->m_UpdateCounter really used?
189  // this->m_UpdateCounter = 0; // FIXME: Should this be a bool ?
190  }
191 
192  ~MultiphaseDenseFiniteDifferenceImageFilter() override = default;
193 
194  void
195  PrintSelf(std::ostream &, Indent indent) const override;
196 
200  void
201  CopyInputToOutput() override;
202 
203  void
204  PostProcessOutput() override;
205 
209  void
210  ApplyUpdate(TimeStepType dt) override;
211 
212  unsigned int m_ReinitializeCounter{}; // FIXME: Should this be a boolean ?
213  // unsigned int m_UpdateCounter; // FIXME: Should this be a boolean ?
214 
215 private:
218  void
219  AllocateUpdateBuffer() override;
220 
224  TimeStepType
225  CalculateChange() override;
226 
228  std::vector<InputImagePointer> m_UpdateBuffers{};
229 };
230 } // end namespace itk
231 
232 #ifndef ITK_MANUAL_INSTANTIATION
233 # include "itkMultiphaseDenseFiniteDifferenceImageFilter.hxx"
234 #endif
235 
236 #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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::ThresholdFilterPointer
typename ThresholdFilterType::Pointer ThresholdFilterPointer
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:155
itkMultiphaseFiniteDifferenceImageFilter.h
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::NeighborhoodIteratorType
typename FiniteDifferenceFunctionType::NeighborhoodType NeighborhoodIteratorType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:162
itkNeighborhoodAlgorithm.h
itk::MultiphaseDenseFiniteDifferenceImageFilter::MultiphaseDenseFiniteDifferenceImageFilter
MultiphaseDenseFiniteDifferenceImageFilter()
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:185
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:150
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itkSignedMaurerDistanceMapImageFilter.h
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:422
itk::MultiphaseFiniteDifferenceImageFilter
Definition: itkMultiphaseFiniteDifferenceImageFilter.h:162
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::ValueType
typename InputImageType::ValueType ValueType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:133
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FaceListType
typename FaceCalculatorType::FaceListType FaceListType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:168
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:361
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::SizeValueType
typename Superclass::OutputSizeValueType SizeValueType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:147
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: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Concept::Convertible
Definition: itkConceptChecking.h:217
itkNumericTraits.h
itkBinaryThresholdImageFilter.h
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::MaurerPointer
typename MaurerType::Pointer MaurerPointer
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:158
itk::MultiphaseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction, unsigned int >::IdCellType
unsigned int IdCellType
Definition: itkMultiphaseFiniteDifferenceImageFilter.h:214
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:102