ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkPhaseCorrelationOptimizer.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 itkPhaseCorrelationOptimizer_h
19#define itkPhaseCorrelationOptimizer_h
20
21#include "itkImage.h"
22#include "itkNumericTraits.h"
23#include "itkProcessObject.h"
25#include <array>
26#include <vector>
27#include "MontageExport.h"
32
33namespace itk
34{
35
40{
41public:
45 enum class PeakInterpolationMethod : uint8_t
46 {
47 None = 0,
49 Cosine = 2,
51 // PhaseFrequencySlope = 4,
52 };
53
54 // For iteration. Type is spelled out: igenerator emits "?unknown?" for a deduced return.
55 static constexpr std::array<PeakInterpolationMethod, 4>
66};
67
69extern Montage_EXPORT std::ostream &
71
72
118template <typename TRealPixel, unsigned int VImageDimension>
119class ITK_TEMPLATE_EXPORT PhaseCorrelationOptimizer : public ProcessObject
120{
121public:
122 ITK_DISALLOW_COPY_AND_MOVE(PhaseCorrelationOptimizer);
123
128
130 itkNewMacro(Self);
131
133 itkOverrideGetNameOfClassMacro(PhaseCorrelationOptimizer);
134
136 static constexpr unsigned int ImageDimension = VImageDimension;
137
138 using RealPixelType = TRealPixel;
139 using ComplexPixelType = std::complex<RealPixelType>;
142
146 using OffsetScalarType = typename OffsetType::ValueType;
147
153
156
158 using OffsetVector = std::vector<OffsetType>;
159
161 itkGetConstReferenceMacro(Offsets, OffsetVector);
162
164 using ConfidenceVector = std::vector<typename NumericTraits<typename ImageType::PixelType>::ValueType>;
165
167 itkGetConstReferenceMacro(Confidences, ConfidenceVector);
168
170 void
172
174 void
176
178 void
179 SetRealInput(const ImageType * image);
180
182 void
184
186 itkGetConstMacro(PeakInterpolationMethod, PeakInterpolationMethodEnum);
187 void
189
191 const OffsetOutputType *
192 GetOutput(unsigned index) const
193 {
194 return static_cast<const OffsetOutputType *>(this->ProcessObject::GetOutput(index));
195 }
196
200 virtual void
201 SetOffsetCount(unsigned count);
202 virtual unsigned
204 {
205 return m_Offsets.size();
206 }
207
210
212 itkGetConstMacro(MergePeaks, unsigned);
213 itkSetMacro(MergePeaks, unsigned);
214
216 itkGetConstMacro(ZeroSuppression, double);
217 itkSetClampMacro(ZeroSuppression, double, 0.0, 100.0);
218
223 itkGetConstMacro(PixelDistanceTolerance, SizeValueType);
224 itkSetMacro(PixelDistanceTolerance, SizeValueType);
225
227 itkGetConstObjectMacro(AdjustedInput, ImageType);
228
230 itkGetConstReferenceMacro(MaxIndices, IndexContainerType);
231
234 itkGetConstMacro(PhaseInterpolated, unsigned int);
235 itkSetMacro(PhaseInterpolated, unsigned int);
236
237 static_assert(!std::is_same<TRealPixel, bool>::value, "bool is not supported as RealPixelType");
238
239protected:
241 ~PhaseCorrelationOptimizer() override = default;
242 void
243 PrintSelf(std::ostream & os, Indent indent) const override;
244
247 void
248 GenerateData() override;
249
250 void
252
254
259 {
260 return static_cast<DataObject *>(OffsetOutputType::New().GetPointer());
261 }
262
263private:
264 PeakInterpolationMethodEnum m_PeakInterpolationMethod = PeakInterpolationMethodEnum::Parabolic;
265
268
270 unsigned m_MergePeaks = 1;
273
276
279
280 unsigned int m_PhaseInterpolated{ 1 };
281
284
287};
288
289} // end namespace itk
290
291#ifndef ITK_MANUAL_INSTANTIATION
292# include "itkPhaseCorrelationOptimizer.hxx"
293#endif
294
295#endif
Perform a cyclic spatial shift of image intensities on the image grid.
SmartPointer< Self > Pointer
Pad an image to make it suitable for an FFT transformation.
Base class for templated image classes.
Templated n-dimensional image class.
Definition itkImage.h:89
Point< PointValueType, VImageDimension > PointType
Control indentation during Print() invocation.
Definition itkIndent.h:53
static Pointer New()
Computes the N highest and/or lowest intensity values of an image.
static constexpr std::array< PeakInterpolationMethod, 4 > AllPeakInterpolationMethods()
PhaseCorrelationOptimizerEnums::PeakInterpolationMethod PeakInterpolationMethodEnum
~PhaseCorrelationOptimizer() override=default
void SetRealInput(const ImageType *image)
const OffsetOutputType * GetOutput(unsigned index) const
void SetMovingImage(const ImageBase< ImageType::ImageDimension > *image)
void SetComplexInput(const ComplexImageType *image)
void PrintSelf(std::ostream &os, Indent indent) const override
void SetFixedImage(const ImageBase< ImageType::ImageDimension > *image)
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
virtual void SetOffsetCount(unsigned count)
void SetPeakInterpolationMethod(const PeakInterpolationMethodEnum peakInterpolationMethod)
std::vector< typename NumericTraits< typename ImageType::PixelType >::ValueType > ConfidenceVector
RealToHalfHermitianForwardFFTImageFilter< ImageType > FFTFilterType
DataObject * GetOutput(const DataObjectIdentifierType &key)
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Make a DataObject of the correct type to used as the specified output.
Base class for specialized real-to-complex forward Fast Fourier Transform.
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:82
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, AnatomicalOrientation::CoordinateEnum value)
#define itkSetMacro(name, type)