ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkOrthogonalSwath2DPathFilter.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 itkOrthogonalSwath2DPathFilter_h
19 #define itkOrthogonalSwath2DPathFilter_h
20 
23 
24 namespace itk
25 {
50 template< typename TFourierSeriesPath, typename TSwathMeritImage >
51 class ITK_TEMPLATE_EXPORT OrthogonalSwath2DPathFilter:public
52  PathAndImageToPathFilter< TFourierSeriesPath, TSwathMeritImage,
53  OrthogonallyCorrected2DParametricPath >
54 {
55 public:
58  typedef PathAndImageToPathFilter< TFourierSeriesPath, TSwathMeritImage,
62 
64  itkNewMacro(Self);
65 
68 
70  typedef TFourierSeriesPath InputPathType;
71  typedef typename InputPathType::Pointer InputPathPointer;
72  typedef typename InputPathType::InputType InputPathInputType;
73 
74  typedef TSwathMeritImage ImageType;
75  typedef typename ImageType::ConstPointer ImageConstPointer;
76 
84 
86  typedef typename InputPathType::OffsetType OffsetType;
87  typedef typename ImageType::SizeType SizeType;
88 
89 protected:
91  virtual ~OrthogonalSwath2DPathFilter() ITK_OVERRIDE;
92  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
93 
94  void GenerateData(void) ITK_OVERRIDE;
95 
96 private:
97  ITK_DISALLOW_COPY_AND_ASSIGN(OrthogonalSwath2DPathFilter);
98 
99  // Find the "L" for the maximum merit over the range L-1 to L+1 at F & x.
100  // This value is both returned and stored in m_StepValues.
101  // The merits for F & x at L-1 to L+1 must have already been calculated.
102  unsigned int FindAndStoreBestErrorStep(unsigned int x, unsigned int F,
103  unsigned int L);
104 
105  // m_StepValues & m_MeritValues are stored as datatype[x][F][L] which requres
106  // cols*rows*rows bytes of storage where rows and cols are the dimensions of
107  // the processed image.
108  //
109  // This ordering of elements is most efficient when L is incremented in the
110  // inner-most loop and x is incremented in the outer-most loop.
111  //
112  // m_StepValues & m_MeritValues should always be accessed using the
113  // StepValue()
114  // and MeritValue() access functions. StepValue() and MeritValue() can each
115  // be
116  // used on both the left and right hand of assignments for reads & writes, ex:
117  // StepValue(1,1,1) = 2+MeritValue(0,0,3);
118  inline int & StepValue(int f, int l, int x)
119  {
120  int rows = m_SwathSize[1];
121 
122  return m_StepValues[( x * rows * rows ) + ( f * rows ) + ( l )];
123  }
124 
125  inline double & MeritValue(int f, int l, int x)
126  {
127  int rows = m_SwathSize[1];
128 
129  return m_MeritValues[( x * rows * rows ) + ( f * rows ) + ( l )];
130  }
131 
132  int * m_StepValues; // best y=error coordinate @ x of image for (0,F) ->
133  // (x+1,L)
134  double *m_MeritValues;
135 
136  int * m_OptimumStepsValues; // best step (e value)
137  // sequence for a
138  // closed path
140 
142 };
143 } // end namespace itk
144 
145 #ifndef ITK_MANUAL_INSTANTIATION
146 #include "itkOrthogonalSwath2DPathFilter.hxx"
147 #endif
148 
149 #endif
Light weight base class for most itk classes.
Filter that optimizes a 2D path relative to an image.
OrthogonalCorrectionTablePointer m_FinalOffsetValues
OrthogonallyCorrected2DParametricPath OutputPathType
Base class for filters that take both a path and an image as input and produce a path as output...
PathAndImageToPathFilter< TFourierSeriesPath, TSwathMeritImage, OrthogonallyCorrected2DParametricPath > Superclass
OutputPathType::OrthogonalCorrectionTablePointer OrthogonalCorrectionTablePointer
Represent an orthogonally corrected 2D parametric path.
OutputPathType::OrthogonalCorrectionTableType OrthogonalCorrectionTableType
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49