ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkBackwardDifferenceDivergenceImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright RTK 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 * 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
19#ifndef rtkBackwardDifferenceDivergenceImageFilter_h
20#define rtkBackwardDifferenceDivergenceImageFilter_h
21
22#include <itkCastImageFilter.h>
24
25namespace rtk
26{
38
39template <typename TInputImage, typename TOutputImage = itk::Image<float, TInputImage::ImageDimension>>
41 : public itk::ImageToImageFilter<TInputImage, TOutputImage>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(BackwardDifferenceDivergenceImageFilter);
45
47 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
48
50 using InputImageType = TInputImage;
51
57
59 itkNewMacro(Self);
60
62 itkOverrideGetNameOfClassMacro(BackwardDifferenceDivergenceImageFilter);
63
66 void
68 {
69 this->SetUseImageSpacing(true);
70 }
71
74 void
76 {
77 this->SetUseImageSpacing(false);
78 }
79
82 itkSetMacro(UseImageSpacing, bool);
83 itkGetConstMacro(UseImageSpacing, bool);
84
87 void
88 SetDimensionsProcessed(bool * DimensionsProcessed);
89
91 void
93
95 using InputPixelType = typename InputImageType::PixelType;
96 using InputImageRegionType = typename InputImageType::RegionType;
97 using InputSizeType = typename InputImageType::SizeType;
99
100protected:
103
104 void
106
107 void
109
110 void
111 DynamicThreadedGenerateData(const typename InputImageType::RegionType & outputRegionForThread) override;
112
113 void
115
116private:
118 typename TInputImage::SpacingType m_InvSpacingCoeffs;
119
120 // list of the dimensions along which the divergence has
121 // to be computed. The components on other dimensions
122 // are ignored for performance, but the gradient filter
123 // sets them to zero anyway
124 bool m_DimensionsProcessed[TInputImage::ImageDimension];
125
126 // The default is ConstantBoundaryCondition, but this behavior sometimes needs to be overriden
128 // If so, do not perform boundary processing in AfterThreadedGenerateData
130};
131
132} // namespace rtk
133
134#ifndef ITK_MANUAL_INSTANTIATION
135# include "rtkBackwardDifferenceDivergenceImageFilter.hxx"
136#endif
137
138#endif //__rtkBackwardDifferenceDivergenceImageFilter__
A templated class holding a n-Dimensional covariant vector.
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
Base class for filters that take an image as input and produce an image as output.
Implements transparent reference counting.
void OverrideBoundaryCondition(itk::ImageBoundaryCondition< TInputImage > *boundaryCondition)
void SetDimensionsProcessed(bool *DimensionsProcessed)
itk::ImageBoundaryCondition< GradientImageType, GradientImageType > * m_BoundaryCondition
void DynamicThreadedGenerateData(const typename InputImageType::RegionType &outputRegionForThread) override
#define itkSetMacro(name, type)