ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkOrthogonalSwath2DPathFilter.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 itkOrthogonalSwath2DPathFilter_h
19#define itkOrthogonalSwath2DPathFilter_h
20
23
24#include <memory> // For unique_ptr.
25
26namespace itk
27{
52template <typename TFourierSeriesPath, typename TSwathMeritImage>
53class ITK_TEMPLATE_EXPORT OrthogonalSwath2DPathFilter
54 : public PathAndImageToPathFilter<TFourierSeriesPath, TSwathMeritImage, OrthogonallyCorrected2DParametricPath>
55{
56public:
57 ITK_DISALLOW_COPY_AND_MOVE(OrthogonalSwath2DPathFilter);
58
61 using Superclass =
65
67 itkNewMacro(Self);
68
70 itkOverrideGetNameOfClassMacro(OrthogonalSwath2DPathFilter);
71
73 using InputPathType = TFourierSeriesPath;
74 using InputPathPointer = typename InputPathType::Pointer;
75 using InputPathInputType = typename InputPathType::InputType;
76
77 using ImageType = TSwathMeritImage;
78 using ImageConstPointer = typename ImageType::ConstPointer;
79
85
86 using IndexType = typename InputPathType::IndexType;
87 using OffsetType = typename InputPathType::OffsetType;
88 using SizeType = typename ImageType::SizeType;
89
90protected:
92 ~OrthogonalSwath2DPathFilter() override = default;
93 void
94 PrintSelf(std::ostream & os, Indent indent) const override;
95
96 void
97 GenerateData() override;
98
99private:
100 // Find the "L" for the maximum merit over the range L-1 to L+1 at F & x.
101 // This value is both returned and stored in m_StepValues.
102 // The merits for F & x at L-1 to L+1 must have already been calculated.
103 unsigned int
104 FindAndStoreBestErrorStep(unsigned int x, unsigned int F, unsigned int L);
105
106 // m_StepValues & m_MeritValues are stored as datatype[x][F][L] which requires
107 // cols*rows*rows bytes of storage where rows and cols are the dimensions of
108 // the processed image.
109 //
110 // This ordering of elements is most efficient when L is incremented in the
111 // inner-most loop and x is incremented in the outer-most loop.
112 //
113 // m_StepValues & m_MeritValues should always be accessed using the
114 // StepValue()
115 // and MeritValue() access functions. StepValue() and MeritValue() can each
116 // be
117 // used on both the left and right hand of assignments for reads & writes, ex:
118 // StepValue(1,1,1) = 2+MeritValue(0,0,3);
119 inline int &
120 StepValue(int f, int l, int x)
121 {
122 const int rows = m_SwathSize[1];
123
124 return m_StepValues[(x * rows * rows) + (f * rows) + (l)];
125 }
126
127 inline double &
128 MeritValue(int f, int l, int x)
129 {
130 const int rows = m_SwathSize[1];
131
132 return m_MeritValues[(x * rows * rows) + (f * rows) + (l)];
133 }
134
135 std::unique_ptr<int[]> m_StepValues{ nullptr }; // best y=error coordinate @ x of image for (0,F) ->
136 // (x+1,L)
137 std::unique_ptr<double[]> m_MeritValues{ nullptr };
138
139 std::unique_ptr<int[]> m_OptimumStepsValues{ nullptr }; // best step (e value)
140 // sequence for a
141 // closed path
143
145};
146} // end namespace itk
147
148#ifndef ITK_MANUAL_INSTANTIATION
149# include "itkOrthogonalSwath2DPathFilter.hxx"
150#endif
151
152#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
OutputPathType::OrthogonalCorrectionTableType OrthogonalCorrectionTableType
typename InputPathType::IndexType IndexType
unsigned int FindAndStoreBestErrorStep(unsigned int x, unsigned int F, unsigned int L)
OrthogonalCorrectionTablePointer m_FinalOffsetValues
~OrthogonalSwath2DPathFilter() override=default
OrthogonallyCorrected2DParametricPath OutputPathType
typename ImageType::ConstPointer ImageConstPointer
typename InputPathType::Pointer InputPathPointer
PathAndImageToPathFilter< TFourierSeriesPath, TSwathMeritImage, OrthogonallyCorrected2DParametricPath > Superclass
OutputPathType::OrthogonalCorrectionTablePointer OrthogonalCorrectionTablePointer
typename InputPathType::InputType InputPathInputType
void PrintSelf(std::ostream &os, Indent indent) const override
typename InputPathType::OffsetType OffsetType
Represent an orthogonally corrected 2D parametric path.
OrthogonalCorrectionTableType::Pointer OrthogonalCorrectionTablePointer
VectorContainer< unsigned int, double > OrthogonalCorrectionTableType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....