ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkDenseFiniteDifferenceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 "itkMultiThreader.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 
77  TInputImage, TOutputImage > Superclass;
78 
81 
84 
86  typedef typename Superclass::InputImageType InputImageType;
87  typedef typename Superclass::OutputImageType OutputImageType;
88  typedef typename Superclass::FiniteDifferenceFunctionType
90 
93  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
94 
97  typedef typename Superclass::PixelType PixelType;
98 
100  typedef typename Superclass::TimeStepType TimeStepType;
101 
104 
105 #ifdef ITK_USE_CONCEPT_CHECKING
106  // Begin concept checking
107  itkConceptMacro( OutputTimesDoubleCheck,
109  itkConceptMacro( OutputAdditiveOperatorsCheck,
111  itkConceptMacro( OutputAdditiveAndAssignOperatorsCheck,
113  itkConceptMacro( InputConvertibleToOutputCheck,
115  // End concept checking
116 #endif
117 
118 protected:
120  { m_UpdateBuffer = UpdateBufferType::New(); }
122  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
123 
127  virtual void CopyInputToOutput() ITK_OVERRIDE;
128 
132  virtual void ApplyUpdate(const TimeStepType& dt) ITK_OVERRIDE;
133 
136  virtual UpdateBufferType * GetUpdateBuffer()
137  { return m_UpdateBuffer; }
138 
142  virtual TimeStepType CalculateChange() ITK_OVERRIDE;
143 
146  virtual void AllocateUpdateBuffer() ITK_OVERRIDE;
147 
149  typedef typename UpdateBufferType::RegionType ThreadRegionType;
150 
155  virtual
156  void ThreadedApplyUpdate(const TimeStepType& dt,
157  const ThreadRegionType & regionToProcess,
158  ThreadIdType threadId);
159 
164  virtual
165  TimeStepType ThreadedCalculateChange(const ThreadRegionType & regionToProcess,
166  ThreadIdType threadId);
167 
168 private:
169  ITK_DISALLOW_COPY_AND_ASSIGN(DenseFiniteDifferenceImageFilter);
170 
174  DenseFiniteDifferenceImageFilter *Filter;
176  std::vector< TimeStepType > TimeStepList;
177  std::vector< bool > ValidTimeStepList;
178  };
179 
182  static ITK_THREAD_RETURN_TYPE ApplyUpdateThreaderCallback(void *arg);
183 
186  static ITK_THREAD_RETURN_TYPE 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
FiniteDifferenceImageFilter< TInputImage, TOutputImage > Superclass
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
#define ITK_THREAD_RETURN_TYPE
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)