ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkFiniteDifferenceImageFilter.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 itkFiniteDifferenceImageFilter_h
19#define itkFiniteDifferenceImageFilter_h
20
21#include "itkBooleanStdVector.h"
24
25namespace itk
26{
132template <typename TInputImage, typename TOutputImage>
133class ITK_TEMPLATE_EXPORT FiniteDifferenceImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
134{
135public:
136 ITK_DISALLOW_COPY_AND_MOVE(FiniteDifferenceImageFilter);
137
143
145 itkOverrideGetNameOfClassMacro(FiniteDifferenceImageFilter);
146
148 using InputImageType = TInputImage;
149 using OutputImageType = TOutputImage;
150
152 static constexpr unsigned int ImageDimension = OutputImageType::ImageDimension;
153
155 using OutputPixelType = typename TOutputImage::PixelType;
156 using InputPixelType = typename TInputImage::PixelType;
158
168
171
173 itkGetConstReferenceMacro(ElapsedIterations, IdentifierType);
174
178 itkGetConstReferenceObjectMacro(DifferenceFunction, FiniteDifferenceFunctionType);
179
182 itkSetObjectMacro(DifferenceFunction, FiniteDifferenceFunctionType);
183
185 itkSetMacro(NumberOfIterations, IdentifierType);
186 itkGetConstReferenceMacro(NumberOfIterations, IdentifierType);
188
191 itkSetMacro(UseImageSpacing, bool);
192 itkBooleanMacro(UseImageSpacing);
193 itkGetConstReferenceMacro(UseImageSpacing, bool);
195
198 itkSetMacro(MaximumRMSError, double);
199 itkGetConstReferenceMacro(MaximumRMSError, double);
201
204 itkSetMacro(RMSChange, double);
205 itkGetConstReferenceMacro(RMSChange, double);
207
210 itkSetMacro(ManualReinitialization, bool);
211 itkGetConstReferenceMacro(ManualReinitialization, bool);
212 itkBooleanMacro(ManualReinitialization);
214
215 itkSetMacro(IsInitialized, bool);
216 itkGetMacro(IsInitialized, bool);
217
218 void
220 {
221 this->SetIsInitialized(false);
222 }
223 void
225 {
226 this->SetIsInitialized(true);
227 }
228
229 itkConceptMacro(OutputPixelIsFloatingPointCheck, (Concept::IsFloatingPoint<OutputPixelValueType>));
230
231protected:
233 ~FiniteDifferenceImageFilter() override = default;
234
237
238 void
239 PrintSelf(std::ostream & os, Indent indent) const override;
240
242 virtual void
244
248 virtual void
249 ApplyUpdate(const TimeStepType & dt) = 0;
250
256 virtual TimeStepType
258
262 virtual void
264
268 void
269 GenerateData() override;
270
282 void
284
287 virtual bool
289
299 virtual bool
300 ThreadedHalt(void * itkNotUsed(threadInfo))
301 {
302 return this->Halt();
303 }
304
310 virtual void
312 {}
313
320 virtual void
322 {
323 m_DifferenceFunction->InitializeIteration();
324 }
325
338 virtual TimeStepType
339 ResolveTimeStep(const std::vector<TimeStepType> & timeStepList, const BooleanStdVectorType & valid) const;
340
342 itkSetMacro(ElapsedIterations, IdentifierType);
343
346 virtual void
349
352
356
360
361 double m_RMSChange{};
363
364private:
368 void
370
373 bool m_UseImageSpacing{ true };
374
377};
378} // end namespace itk
379
380#ifndef ITK_MANUAL_INSTANTIATION
381# include "itkFiniteDifferenceImageFilter.hxx"
382#endif
383
384#endif
Vector< PixelRealType, Self::ImageDimension > NeighborhoodScalesType
typename ConstNeighborhoodIterator< TOutputImage >::RadiusType RadiusType
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
virtual void CopyInputToOutput()=0
void PrintSelf(std::ostream &os, Indent indent) const override
typename FiniteDifferenceFunctionType::NeighborhoodScalesType NeighborhoodScalesType
virtual TimeStepType ResolveTimeStep(const std::vector< TimeStepType > &timeStepList, const BooleanStdVectorType &valid) const
InPlaceImageFilter< TInputImage, TOutputImage > Superclass
FiniteDifferenceFunction< TOutputImage > FiniteDifferenceFunctionType
typename NumericTraits< InputPixelType >::ValueType InputPixelValueType
~FiniteDifferenceImageFilter() override=default
void GenerateInputRequestedRegion() override
typename TInputImage::PixelType InputPixelType
virtual void ApplyUpdate(const TimeStepType &dt)=0
typename FiniteDifferenceFunctionType::RadiusType RadiusType
virtual void AllocateUpdateBuffer()=0
virtual TimeStepType CalculateChange()=0
typename TOutputImage::PixelType OutputPixelType
typename NumericTraits< OutputPixelType >::ValueType OutputPixelValueType
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition itkIntTypes.h:90
std::vector< Boolean > BooleanStdVectorType