Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkOrthogonalSwath2DPathFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkOrthogonalSwath2DPathFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/04/14 11:54:33 $
00007   Version:   $Revision: 1.10 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkOrthogonalSwath2DPathFilter_h
00019 #define __itkOrthogonalSwath2DPathFilter_h
00020 
00021 #include "itkPathAndImageToPathFilter.h"
00022 #include "itkOrthogonallyCorrected2DParametricPath.h"
00023 
00024 
00025 namespace itk
00026 {
00048 template <class TFourierSeriesPath, class TSwathMeritImage>
00049 class ITK_EXPORT OrthogonalSwath2DPathFilter : public
00050 PathAndImageToPathFilter< TFourierSeriesPath, TSwathMeritImage,
00051                           OrthogonallyCorrected2DParametricPath >
00052 {
00053 public:
00055   typedef OrthogonalSwath2DPathFilter                         Self;
00056   typedef PathAndImageToPathFilter< TFourierSeriesPath, TSwathMeritImage,
00057                       OrthogonallyCorrected2DParametricPath > Superclass;
00058   typedef SmartPointer<Self>                                  Pointer;
00059   typedef SmartPointer<const Self>                            ConstPointer;
00060 
00062   itkNewMacro(Self);
00063 
00065   itkTypeMacro(OrthogonalSwath2DPathFilter, PathAndImageToPathFilter);
00066 
00068   typedef TFourierSeriesPath                    InputPathType;
00069   typedef typename InputPathType::Pointer       InputPathPointer;
00070   typedef typename InputPathType::InputType     InputPathInputType;
00071 
00072   typedef TSwathMeritImage                      ImageType;
00073   typedef typename ImageType::ConstPointer      ImageConstPointer;
00074   
00075   typedef OrthogonallyCorrected2DParametricPath OutputPathType;
00076   typedef typename OutputPathType::Pointer      OutputPathPointer;
00077   typedef typename OutputPathType::InputType    OutputPathInputType;
00078   typedef typename OutputPathType::OrthogonalCorrectionTableType
00079                                                 OrthogonalCorrectionTableType;
00080   typedef typename OutputPathType::OrthogonalCorrectionTablePointer
00081                                                 OrthogonalCorrectionTablePointer;
00082   
00083   typedef typename InputPathType::IndexType     IndexType;
00084   typedef typename InputPathType::OffsetType    OffsetType;
00085   typedef typename ImageType::SizeType          SizeType;
00086 
00087 protected:
00088   OrthogonalSwath2DPathFilter();
00089   virtual ~OrthogonalSwath2DPathFilter();
00090   void PrintSelf(std::ostream& os, Indent indent) const;
00091 
00092   void GenerateData(void);
00093 
00094 private:
00095   OrthogonalSwath2DPathFilter(const Self&); //purposely not implemented
00096   void operator=(const Self&); //purposely not implemented
00097   
00098   // Find the "L" for the maximum merit over the range L-1 to L+1 at F & x.
00099   // This value is both returned and stored in m_StepValues.
00100   // The merits for F & x at L-1 to L+1 must have already been calculated.
00101   unsigned int FindAndStoreBestErrorStep(unsigned int x, unsigned int F,
00102                                                          unsigned int L);
00103   
00104   // m_StepValues & m_MeritValues are stored as datatype[x][F][L] which requres
00105   // cols*rows*rows bytes of storage where rows and cols are the dimensions of
00106   // the processed image.
00107   // 
00108   // This ordering of elements is most efficient when L is incremented in the
00109   // inner-most loop and x is incremented in the outer-most loop.
00110   // 
00111   // m_StepValues & m_MeritValues should always be accessed using the StepValue()
00112   // and MeritValue() access functions.  StepValue() and MeritValue() can each be
00113   // used on both the left and right hand of assignments for reads & writes, ex: 
00114   // StepValue(1,1,1) = 2+MeritValue(0,0,3);
00115   inline int &StepValue(int   f, int l, int x)
00116     {
00117     int rows=m_SwathSize[1];
00118     return m_StepValues[ (x*rows*rows) + (f*rows) + (l) ];
00119     }
00120 
00121   inline double &MeritValue(int  f, int l, int x)
00122     {
00123     int rows=m_SwathSize[1];
00124     return m_MeritValues[ (x*rows*rows) + (f*rows) + (l) ];
00125     }
00126 
00127   int    *m_StepValues; // best y=error coordinate @ x of image for (0,F) -> (x+1,L)
00128   double *m_MeritValues;
00129   
00130   int                             *m_OptimumStepsValues;  // best step (e value) sequence for a closed path
00131   OrthogonalCorrectionTablePointer m_FinalOffsetValues;
00132 
00133   SizeType m_SwathSize;
00134 };
00135 
00136 } // end namespace itk
00137 
00138 #ifndef ITK_MANUAL_INSTANTIATION
00139 #include "itkOrthogonalSwath2DPathFilter.txx"
00140 #endif
00141 
00142 #endif
00143 

Generated at Wed Nov 5 23:23:46 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000