ITK  4.8.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 >
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 
85  typedef typename InputPathType::IndexType IndexType;
86  typedef typename InputPathType::OffsetType OffsetType;
87  typedef typename ImageType::SizeType SizeType;
88 
89 protected:
92  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
93 
94  void GenerateData(void) ITK_OVERRIDE;
95 
96 private:
97  OrthogonalSwath2DPathFilter(const Self &); //purposely not implemented
98  void operator=(const Self &); //purposely not implemented
99 
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 FindAndStoreBestErrorStep(unsigned int x, unsigned int F,
104  unsigned int L);
105 
106  // m_StepValues & m_MeritValues are stored as datatype[x][F][L] which requres
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 & StepValue(int f, int l, int x)
120  {
121  int rows = m_SwathSize[1];
122 
123  return m_StepValues[( x * rows * rows ) + ( f * rows ) + ( l )];
124  }
125 
126  inline double & MeritValue(int f, int l, int x)
127  {
128  int rows = m_SwathSize[1];
129 
130  return m_MeritValues[( x * rows * rows ) + ( f * rows ) + ( l )];
131  }
132 
133  int * m_StepValues; // best y=error coordinate @ x of image for (0,F) ->
134  // (x+1,L)
135  double *m_MeritValues;
136 
137  int * m_OptimumStepsValues; // best step (e value)
138  // sequence for a
139  // closed path
141 
143 };
144 } // end namespace itk
145 
146 #ifndef ITK_MANUAL_INSTANTIATION
147 #include "itkOrthogonalSwath2DPathFilter.hxx"
148 #endif
149 
150 #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
void PrintSelf(std::ostream &os, Indent indent) const override
void GenerateData(void) override
unsigned int FindAndStoreBestErrorStep(unsigned int x, unsigned int F, unsigned int L)
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