ITK  6.0.0
Insight Toolkit
itkDenseFiniteDifferenceImageFilter.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 itkDenseFiniteDifferenceImageFilter_h
19 #define itkDenseFiniteDifferenceImageFilter_h
20 
21 #include "itkBooleanStdVector.h"
23 #include "itkMultiThreaderBase.h"
24 
25 namespace itk
26 {
69 template <typename TInputImage, typename TOutputImage>
70 class ITK_TEMPLATE_EXPORT DenseFiniteDifferenceImageFilter
71  : public FiniteDifferenceImageFilter<TInputImage, TOutputImage>
72 {
73 public:
74  ITK_DISALLOW_COPY_AND_MOVE(DenseFiniteDifferenceImageFilter);
75 
79 
82 
84  itkOverrideGetNameOfClassMacro(DenseFiniteDifferenceImageFilter);
85 
87  using typename Superclass::InputImageType;
88  using typename Superclass::OutputImageType;
89  using typename Superclass::FiniteDifferenceFunctionType;
90 
93  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
94 
97  using typename Superclass::PixelType;
98 
100  using typename Superclass::TimeStepType;
101 
104 
105 #ifdef ITK_USE_CONCEPT_CHECKING
106  // Begin concept checking
108  itkConceptMacro(OutputAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType>));
109  itkConceptMacro(OutputAdditiveAndAssignOperatorsCheck, (Concept::AdditiveAndAssignOperators<PixelType>));
111  // End concept checking
112 #endif
113 
114 protected:
116  ~DenseFiniteDifferenceImageFilter() override = default;
117  void
118  PrintSelf(std::ostream & os, Indent indent) const override;
119 
123  void
124  CopyInputToOutput() override;
125 
129  void
130  ApplyUpdate(const TimeStepType & dt) override;
131 
134  virtual UpdateBufferType *
136  {
137  return m_UpdateBuffer;
138  }
139 
143  TimeStepType
144  CalculateChange() override;
145 
148  void
149  AllocateUpdateBuffer() override;
150 
153 
158  virtual void
159  ThreadedApplyUpdate(const TimeStepType & dt, const ThreadRegionType & regionToProcess, ThreadIdType threadId);
160 
165  virtual TimeStepType
166  ThreadedCalculateChange(const ThreadRegionType & regionToProcess, ThreadIdType threadId);
167 
168 private:
172  {
174  TimeStepType TimeStep;
175  std::vector<TimeStepType> TimeStepList;
176 
178  };
179 
183  ApplyUpdateThreaderCallback(void * arg);
184 
188  CalculateChangeThreaderCallback(void * arg);
189 
191  typename UpdateBufferType::Pointer m_UpdateBuffer{};
192 };
193 } // end namespace itk
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
196 # include "itkDenseFiniteDifferenceImageFilter.hxx"
197 #endif
198 
199 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itkFiniteDifferenceImageFilter.h
itkBooleanStdVector.h
itk::BooleanStdVectorType
std::vector< Boolean > BooleanStdVectorType
Definition: itkBooleanStdVector.h:34
itk::FiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >::TimeStepType
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
Definition: itkFiniteDifferenceImageFilter.h:167
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Concept::AdditiveAndAssignOperators
Definition: itkConceptChecking.h:393
itk::DenseFiniteDifferenceImageFilter
Definition: itkDenseFiniteDifferenceImageFilter.h:70
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct::ValidTimeStepList
BooleanStdVectorType ValidTimeStepList
Definition: itkDenseFiniteDifferenceImageFilter.h:177
itk::DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >::UpdateBufferType
OutputImageType UpdateBufferType
Definition: itkDenseFiniteDifferenceImageFilter.h:103
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
itk::ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
itk::ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
Definition: itkThreadSupport.h:79
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::FiniteDifferenceImageFilter
Definition: itkFiniteDifferenceImageFilter.h:133
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct::TimeStepList
std::vector< TimeStepType > TimeStepList
Definition: itkDenseFiniteDifferenceImageFilter.h:175
itk::DenseFiniteDifferenceImageFilter::GetUpdateBuffer
virtual UpdateBufferType * GetUpdateBuffer()
Definition: itkDenseFiniteDifferenceImageFilter.h:135
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:422
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct::Filter
DenseFiniteDifferenceImageFilter * Filter
Definition: itkDenseFiniteDifferenceImageFilter.h:173
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:361
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >::ThreadRegionType
typename UpdateBufferType::RegionType ThreadRegionType
Definition: itkDenseFiniteDifferenceImageFilter.h:152
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itkMultiThreaderBase.h
itk::Concept::Convertible
Definition: itkConceptChecking.h:217
New
static Pointer New()
itk::DenseFiniteDifferenceImageFilter::DenseFiniteDifferenceImageFilter
DenseFiniteDifferenceImageFilter()
Definition: itkDenseFiniteDifferenceImageFilter.h:115
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct::TimeStep
TimeStepType TimeStep
Definition: itkDenseFiniteDifferenceImageFilter.h:174
itk::ImageSource< TDisplacementField >::OutputImageType
TDisplacementField OutputImageType
Definition: itkImageSource.h:90
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct
Definition: itkDenseFiniteDifferenceImageFilter.h:171