ITK  5.2.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  * 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 itkDenseFiniteDifferenceImageFilter_h
19 #define itkDenseFiniteDifferenceImageFilter_h
20 
22 #include "itkMultiThreaderBase.h"
23 
24 namespace itk
25 {
68 template <typename TInputImage, typename TOutputImage>
69 class ITK_TEMPLATE_EXPORT DenseFiniteDifferenceImageFilter
70  : public FiniteDifferenceImageFilter<TInputImage, TOutputImage>
71 {
72 public:
73  ITK_DISALLOW_COPY_AND_ASSIGN(DenseFiniteDifferenceImageFilter);
74 
78 
81 
84 
86  using InputImageType = typename Superclass::InputImageType;
87  using OutputImageType = typename Superclass::OutputImageType;
88  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
89 
92  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
93 
96  using PixelType = typename Superclass::PixelType;
97 
99  using TimeStepType = typename Superclass::TimeStepType;
100 
103 
104 #ifdef ITK_USE_CONCEPT_CHECKING
105  // Begin concept checking
107  itkConceptMacro(OutputAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType>));
108  itkConceptMacro(OutputAdditiveAndAssignOperatorsCheck, (Concept::AdditiveAndAssignOperators<PixelType>));
110  // End concept checking
111 #endif
112 
113 protected:
114  DenseFiniteDifferenceImageFilter() { m_UpdateBuffer = UpdateBufferType::New(); }
115  ~DenseFiniteDifferenceImageFilter() override = default;
116  void
117  PrintSelf(std::ostream & os, Indent indent) const override;
118 
122  void
123  CopyInputToOutput() override;
124 
128  void
129  ApplyUpdate(const TimeStepType & dt) override;
130 
133  virtual UpdateBufferType *
135  {
136  return m_UpdateBuffer;
137  }
138 
142  TimeStepType
143  CalculateChange() override;
144 
147  void
148  AllocateUpdateBuffer() override;
149 
152 
157  virtual void
158  ThreadedApplyUpdate(const TimeStepType & dt, const ThreadRegionType & regionToProcess, ThreadIdType threadId);
159 
164  virtual TimeStepType
165  ThreadedCalculateChange(const ThreadRegionType & regionToProcess, ThreadIdType threadId);
166 
167 private:
171  {
174  std::vector<TimeStepType> TimeStepList;
175  std::vector<bool> ValidTimeStepList;
176  };
177 
181  ApplyUpdateThreaderCallback(void * arg);
182 
186  CalculateChangeThreaderCallback(void * arg);
187 
189  typename UpdateBufferType::Pointer m_UpdateBuffer;
190 };
191 } // end namespace itk
192 
193 #ifndef ITK_MANUAL_INSTANTIATION
194 # include "itkDenseFiniteDifferenceImageFilter.hxx"
195 #endif
196 
197 #endif
itkFiniteDifferenceImageFilter.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Concept::AdditiveAndAssignOperators
Definition: itkConceptChecking.h:388
itk::DenseFiniteDifferenceImageFilter
Definition: itkDenseFiniteDifferenceImageFilter.h:69
itk::DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >::UpdateBufferType
OutputImageType UpdateBufferType
Definition: itkDenseFiniteDifferenceImageFilter.h:102
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct::ValidTimeStepList
std::vector< bool > ValidTimeStepList
Definition: itkDenseFiniteDifferenceImageFilter.h:175
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
itk::ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
Definition: itkThreadSupport.h:82
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter< TDisplacementField, TDisplacementField >::InputImageType
TDisplacementField InputImageType
Definition: itkImageToImageFilter.h:129
itk::FiniteDifferenceImageFilter
Definition: itkFiniteDifferenceImageFilter.h:132
itk::DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >::FiniteDifferenceFunctionType
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkDenseFiniteDifferenceImageFilter.h:88
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct::TimeStepList
std::vector< TimeStepType > TimeStepList
Definition: itkDenseFiniteDifferenceImageFilter.h:174
itk::DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >::TimeStepType
typename Superclass::TimeStepType TimeStepType
Definition: itkDenseFiniteDifferenceImageFilter.h:99
itk::DenseFiniteDifferenceImageFilter::GetUpdateBuffer
virtual UpdateBufferType * GetUpdateBuffer()
Definition: itkDenseFiniteDifferenceImageFilter.h:134
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:417
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct::Filter
DenseFiniteDifferenceImageFilter * Filter
Definition: itkDenseFiniteDifferenceImageFilter.h:172
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:356
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk::DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >::ThreadRegionType
typename UpdateBufferType::RegionType ThreadRegionType
Definition: itkDenseFiniteDifferenceImageFilter.h:151
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::DenseFiniteDifferenceImageFilter::m_UpdateBuffer
UpdateBufferType::Pointer m_UpdateBuffer
Definition: itkDenseFiniteDifferenceImageFilter.h:189
itkMultiThreaderBase.h
itk::Concept::Convertible
Definition: itkConceptChecking.h:214
itk::DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >::PixelType
typename Superclass::PixelType PixelType
Definition: itkDenseFiniteDifferenceImageFilter.h:96
itk::DenseFiniteDifferenceImageFilter::DenseFiniteDifferenceImageFilter
DenseFiniteDifferenceImageFilter()
Definition: itkDenseFiniteDifferenceImageFilter.h:114
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct::TimeStep
TimeStepType TimeStep
Definition: itkDenseFiniteDifferenceImageFilter.h:173
itk::ImageSource< TDisplacementField >::OutputImageType
TDisplacementField OutputImageType
Definition: itkImageSource.h:90
itk::DenseFiniteDifferenceImageFilter::DenseFDThreadStruct
Definition: itkDenseFiniteDifferenceImageFilter.h:170