go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMultiOrderBSplineDecompositionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkMultiOrderBSplineDecompositionImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2010-03-19 07:06:01 $
7  Version: $Revision: 1.12 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  Portions of this code are covered under the VTK copyright.
13  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14 
15  This software is distributed WITHOUT ANY WARRANTY; without even
16  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 
21 #ifndef __itkMultiOrderBSplineDecompositionImageFilter_h
22 #define __itkMultiOrderBSplineDecompositionImageFilter_h
23 
24 #include <vector>
25 
26 #include "itkImageLinearIteratorWithIndex.h"
27 #include "vnl/vnl_matrix.h"
28 
29 #include "itkImageToImageFilter.h"
30 
31 namespace itk
32 {
65 template <class TInputImage, class TOutputImage>
67  public ImageToImageFilter<TInputImage,TOutputImage>
68 {
69 public:
73  typedef SmartPointer<Self> Pointer;
74  typedef SmartPointer<const Self> ConstPointer;
75 
78 
80  itkNewMacro( Self );
81 
83  typedef typename Superclass::InputImageType InputImageType;
84  typedef typename Superclass::InputImagePointer InputImagePointer;
85  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
86  typedef typename Superclass::OutputImagePointer OutputImagePointer;
87 
88  typedef typename itk::NumericTraits<typename TOutputImage::PixelType>::RealType CoeffType;
89 
91  itkStaticConstMacro(ImageDimension, unsigned int,TInputImage::ImageDimension);
92  itkStaticConstMacro(OutputImageDimension, unsigned int,
93  TOutputImage::ImageDimension);
94 
96  typedef ImageLinearIteratorWithIndex<TOutputImage> OutputLinearIterator;
97 
100  void SetSplineOrder( unsigned int order );
101  void SetSplineOrder( unsigned int dimension, unsigned int order );
102  void GetSplineOrder( unsigned int dimension )
103  {
104  return m_SplineOrder[ dimension ];
105  }
106  //itkGetMacro( SplineOrder, unsigned int * );
107 
108 #ifdef ITK_USE_CONCEPT_CHECKING
109 
110  itkConceptMacro(DimensionCheck,
111  (Concept::SameDimension<ImageDimension, OutputImageDimension>));
112  itkConceptMacro(InputConvertibleToOutputCheck,
113  (Concept::Convertible<typename TInputImage::PixelType,
114  typename TOutputImage::PixelType>));
115  itkConceptMacro(DoubleConvertibleToOutputCheck,
116  (Concept::Convertible<double, typename TOutputImage::PixelType>));
118 #endif
119 
120 protected:
123  void PrintSelf(std::ostream& os, Indent indent) const;
124 
125  void GenerateData( );
126 
128  void GenerateInputRequestedRegion();
129 
131  void EnlargeOutputRequestedRegion( DataObject *output );
132 
134  std::vector<CoeffType> m_Scratch; // temp storage for processing of Coefficients
135  typename TInputImage::SizeType m_DataLength; // Image size
136 
137  unsigned int m_SplineOrder[ImageDimension]; // User specified spline order per dimension (3rd or cubic is the default)
138  double m_SplinePoles[3]; // Poles calculated for a given spline order
139  int m_NumberOfPoles; // number of poles
140  double m_Tolerance; // Tolerance used for determining initial causal coefficient
141  unsigned int m_IteratorDirection; // Direction for iterator incrementing
142 
143 
144 private:
145  MultiOrderBSplineDecompositionImageFilter( const Self& ); //purposely not implemented
146  void operator=( const Self& ); //purposely not implemented
147 
149  virtual void SetPoles( unsigned int dimension );
150 
152  virtual bool DataToCoefficients1D();
153 
156  void DataToCoefficientsND();
157 
159  virtual void SetInitialCausalCoefficient(double z);
160 
162  virtual void SetInitialAntiCausalCoefficient(double z);
163 
165  void CopyImageToImage();
166 
168  void CopyCoefficientsToScratch( OutputLinearIterator & );
169 
171  void CopyScratchToCoefficients( OutputLinearIterator & );
172 
173 };
174 
175 
176 } // namespace itk
177 
178 #ifndef ITK_MANUAL_INSTANTIATION
179 #include "itkMultiOrderBSplineDecompositionImageFilter.txx"
180 #endif
181 
182 #endif


Generated on 21-03-2014 for elastix by doxygen 1.8.1.2 elastix logo