ITK  4.9.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 >
70  public FiniteDifferenceImageFilter< TInputImage, TOutputImage >
71 {
72 public:
73 
77  TInputImage, TOutputImage > Superclass;
78 
81 
84 
90 
93  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
94 
97  typedef typename Superclass::PixelType PixelType;
98 
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 
137  { return m_UpdateBuffer; }
138 
142  virtual TimeStepType CalculateChange() ITK_OVERRIDE;
143 
146  virtual void AllocateUpdateBuffer() ITK_OVERRIDE;
147 
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  DenseFiniteDifferenceImageFilter(const Self &) ITK_DELETE_FUNCTION;
170  void operator=(const Self &) ITK_DELETE_FUNCTION;
171 
177  std::vector< TimeStepType > TimeStepList;
178  std::vector< bool > ValidTimeStepList;
179  };
180 
184 
188 
190  typename UpdateBufferType::Pointer m_UpdateBuffer;
191 };
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkDenseFiniteDifferenceImageFilter.hxx"
196 #endif
197 
198 #endif
static ITK_THREAD_RETURN_TYPE CalculateChangeThreaderCallback(void *arg)
static ITK_THREAD_RETURN_TYPE ApplyUpdateThreaderCallback(void *arg)
FiniteDifferenceImageFilter< TInputImage, TOutputImage > Superclass
Light weight base class for most itk classes.
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
virtual void CopyInputToOutput() override
#define ITK_THREAD_RETURN_TYPE
virtual void AllocateUpdateBuffer() override
virtual TimeStepType CalculateChange() override
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
FiniteDifferenceFunctionType::TimeStepType TimeStepType
virtual void ApplyUpdate(const TimeStepType &dt) override
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
virtual void ThreadedApplyUpdate(const TimeStepType &dt, const ThreadRegionType &regionToProcess, ThreadIdType threadId)
FiniteDifferenceFunction< TOutputImage > FiniteDifferenceFunctionType
virtual TimeStepType ThreadedCalculateChange(const ThreadRegionType &regionToProcess, ThreadIdType threadId)
#define itkConceptMacro(name, concept)
void PrintSelf(std::ostream &os, Indent indent) const override
typedef(Concept::MultiplyOperator< PixelType, double >) OutputTimesDoubleCheck