ITK  5.2.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 InputImageType = typename Superclass::InputImageType;
127  using InputImagePointer = typename Superclass::InputImagePointer;
128  using InputRegionType = typename Superclass::InputRegionType;
129  using InputSizeType = typename Superclass::InputSizeType;
130  using InputSizeValueType = typename Superclass::InputSizeValueType;
131  using InputIndexType = typename Superclass::InputIndexType;
132  using InputIndexValueType = typename Superclass::InputIndexValueType;
133  using InputPixelType = typename Superclass::InputPixelType;
134  using InputPointType = typename Superclass::InputPointType;
135  using InputSpacingType = typename Superclass::InputSpacingType;
136  using ValueType = typename InputImageType::ValueType;
137 
138  using FeatureImageType = typename Superclass::FeatureImageType;
139  using FeatureSizeType = typename Superclass::FeatureSizeType;
140  using FeatureImagePointer = typename Superclass::FeatureImagePointer;
141  using FeatureRegionType = typename Superclass::FeatureRegionType;
142  using FeatureSpacingType = typename Superclass::FeatureSpacingType;
143  using FeaturePointType = typename Superclass::FeaturePointType;
144  using FeaturePixelType = typename Superclass::FeaturePixelType;
145 
146  using OutputImageType = typename Superclass::OutputImageType;
147  using OutputImagePointer = typename Superclass::OutputImagePointer;
148  using OutputRegionType = typename Superclass::OutputRegionType;
149  using OutputSizeType = typename Superclass::OutputSizeType;
150  using SizeValueType = typename Superclass::OutputSizeValueType;
151  using OutputIndexType = typename Superclass::OutputIndexType;
152  using OutputIndexValueType = typename Superclass::OutputIndexValueType;
153  using OutputPixelType = typename OutputImageType::PixelType;
154 
155  using IdCellType = typename Superclass::IdCellType;
156 
159 
162 
163  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
164  using FiniteDifferenceFunctionPointer = typename Superclass::FiniteDifferenceFunctionPointer;
165  using NeighborhoodIteratorType = typename FiniteDifferenceFunctionType::NeighborhoodType;
166 
168  using TimeStepType = 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
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FiniteDifferenceFunctionPointer
typename Superclass::FiniteDifferenceFunctionPointer FiniteDifferenceFunctionPointer
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:164
itkNeighborhoodAlgorithm.h
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::InputPointType
typename Superclass::InputPointType InputPointType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:134
itk::MultiphaseDenseFiniteDifferenceImageFilter::MultiphaseDenseFiniteDifferenceImageFilter
MultiphaseDenseFiniteDifferenceImageFilter()
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:188
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::OutputIndexValueType
typename Superclass::OutputIndexValueType OutputIndexValueType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:152
itk::BinaryThresholdImageFilter
Binarize an input image by thresholding.
Definition: itkBinaryThresholdImageFilter.h:139
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::OutputSizeType
typename Superclass::OutputSizeType OutputSizeType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:149
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:153
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::OutputRegionType
typename Superclass::OutputRegionType OutputRegionType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:148
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FeaturePointType
typename Superclass::FeaturePointType FeaturePointType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:143
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::TimeStepType
typename Superclass::TimeStepType TimeStepType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:168
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::InputRegionType
typename Superclass::InputRegionType InputRegionType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:128
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::OutputIndexType
typename Superclass::OutputIndexType OutputIndexType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:151
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FeatureImagePointer
typename Superclass::FeatureImagePointer FeatureImagePointer
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:140
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FeatureRegionType
typename Superclass::FeatureRegionType FeatureRegionType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:141
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FeatureSpacingType
typename Superclass::FeatureSpacingType FeatureSpacingType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:142
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::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::InputSizeType
typename Superclass::InputSizeType InputSizeType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:129
itk::ImageToImageFilter< TFeatureImage, TOutputImage >::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::InputPixelType
typename Superclass::InputPixelType InputPixelType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:133
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FeaturePixelType
typename Superclass::FeaturePixelType FeaturePixelType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:144
itk::ImageToImageFilter< TFeatureImage, TOutputImage >::InputImageType
TFeatureImage InputImageType
Definition: itkImageToImageFilter.h:129
itkSignedMaurerDistanceMapImageFilter.h
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:419
itk::MultiphaseFiniteDifferenceImageFilter
Definition: itkMultiphaseFiniteDifferenceImageFilter.h:165
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::InputSpacingType
typename Superclass::InputSpacingType InputSpacingType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:135
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::IdCellType
typename Superclass::IdCellType IdCellType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:155
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 >::FeatureSizeType
typename Superclass::FeatureSizeType FeatureSizeType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:139
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FeatureImageType
typename Superclass::FeatureImageType FeatureImageType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:138
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::InputIndexType
typename Superclass::InputIndexType InputIndexType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:131
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::MaurerPointer
typename MaurerType::Pointer MaurerPointer
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:161
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::InputIndexValueType
typename Superclass::InputIndexValueType InputIndexValueType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:132
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::InputSizeValueType
typename Superclass::InputSizeValueType InputSizeValueType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:130
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
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::MultiphaseDenseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFunction >::FiniteDifferenceFunctionType
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkMultiphaseDenseFiniteDifferenceImageFilter.h:163