ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBlockMatchingBayesianRegularizationDisplacementCalculator.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 itkBlockMatchingBayesianRegularizationDisplacementCalculator_h
19#define itkBlockMatchingBayesianRegularizationDisplacementCalculator_h
20
26
29
30namespace itk
31{
33{
34
61template <typename TMetricImage, typename TDisplacementImage>
63 : public MetricImageToDisplacementCalculator<TMetricImage, TDisplacementImage>
64{
65public:
66 ITK_DISALLOW_COPY_AND_MOVE(BayesianRegularizationDisplacementCalculator);
67
73
75 itkNewMacro(Self);
76
78 static constexpr unsigned int ImageDimension = TDisplacementImage::ImageDimension;
79
81 itkOverrideGetNameOfClassMacro(BayesianRegularizationDisplacementCalculator);
82
85 using MetricImageConstPointerType = typename MetricImageType::ConstPointer;
86
87 using PixelType = typename MetricImageType::PixelType;
88 using SpacingType = typename MetricImageType::SpacingType;
89 using SizeType = typename MetricImageType::SizeType;
90 using RegionType = typename MetricImageType::RegionType;
93
95
97
102
105 using VectorType = typename PointType::VectorType;
106
107 void
108 Compute() override;
109
111 itkSetMacro(MaximumIterations, unsigned int);
112 itkGetConstMacro(MaximumIterations, unsigned int);
113
116 void
117 SetMeanChangeThreshold(const double & threshold)
118 {
120 m_MeanChangeThreshold = threshold;
121 this->Modified();
122 }
123 itkGetConstMacro(MeanChangeThreshold, double);
124
128 itkGetConstMacro(MeanChange, double);
129
131 void
132 SetMetricLowerBound(const double & bound)
133 {
134 this->m_MetricLowerBound = static_cast<PixelType>(bound);
135 this->m_MetricLowerBoundDefined = true;
136 this->Modified();
137 }
138 itkGetConstMacro(MetricLowerBound, PixelType);
139
142 itkGetConstMacro(StrainSigma, SpacingType);
143
147 itkSetMacro(MaximumStrain, SpacingType);
148 itkGetConstMacro(MaximumStrain, SpacingType);
149
151 itkGetConstMacro(CurrentIteration, unsigned int);
152
153 void
155 {
156 region = this->m_DisplacementImage->GetLargestPossibleRegion();
157 }
158
159 void
164
168 itkSetObjectMacro(DisplacementCalculator, Superclass);
169 itkGetConstObjectMacro(DisplacementCalculator, Superclass);
170
171protected:
173
174 void
176
179 virtual void
181
184 void
186
188 void
190 MetricImagePointerType & priorImage,
191 const unsigned int direction,
192 const VectorType & shift);
193 void
195
197
204
206
209
211 using GaussianKernelArrayType = typename std::vector<typename GaussianKernelType::Pointer>;
213 using GaussianKernelRadiusType = typename GaussianKernelType::SizeType;
214 using GaussianKernelRadiusArrayType = typename std::vector<GaussianKernelRadiusType>;
216
219
220 unsigned int m_CurrentIteration;
221
223
226 void
228
230 void
232
235 void
237
239 void
241
242private:
244 std::atomic<double> m_ChangeSum;
245 std::atomic<uint64_t> m_ChangeCount;
246};
247
248} // namespace BlockMatching
249} // namespace itk
250
251#ifndef ITK_MANUAL_INSTANTIATION
252# include "itkBlockMatchingBayesianRegularizationDisplacementCalculator.hxx"
253#endif
254
255#endif
typename itk::ConstantImagePointerBoundaryCondition< MetricImageImageType > ImageImageBoundaryConditionType
void ImpartLikelihood(MetricImagePointerType &postImage, MetricImagePointerType &priorImage, const unsigned int direction, const VectorType &shift)
This boundary condition returns a constant value for out-of-bounds image pixels.
Base class for all data objects in ITK.
virtual void SetRequestedRegionToLargestPossibleRegion()
Read-only ImageRegionIterator: ImageRegionConstIterator<TImage> behaves as ImageRegionIterator<const ...
A multi-dimensional iterator templated over image type that walks a region of pixels.
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
virtual void Modified() const
Implements transparent reference counting.
Increase the image size by padding according to the zero-flux Neumann boundary condition.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)