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  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 /*=========================================================================
15 
16  Program: Insight Segmentation & Registration Toolkit
17  Module: $RCSfile: itkMultiOrderBSplineDecompositionImageFilter.h,v $
18  Language: C++
19  Date: $Date: 2010-03-19 07:06:01 $
20  Version: $Revision: 1.12 $
21 
22  Copyright (c) Insight Software Consortium. All rights reserved.
23  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
24 
25  Portions of this code are covered under the VTK copyright.
26  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
27 
28  This software is distributed WITHOUT ANY WARRANTY; without even
29  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30  PURPOSE. See the above copyright notices for more information.
31 
32 =========================================================================*/
33 #ifndef __itkMultiOrderBSplineDecompositionImageFilter_h
34 #define __itkMultiOrderBSplineDecompositionImageFilter_h
35 
36 #include <vector>
37 
38 #include "itkImageLinearIteratorWithIndex.h"
39 #include "vnl/vnl_matrix.h"
40 
41 #include "itkImageToImageFilter.h"
42 
43 namespace itk
44 {
77 template< class TInputImage, class TOutputImage >
79  public ImageToImageFilter< TInputImage, TOutputImage >
80 {
81 public:
82 
85  typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
86  typedef SmartPointer< Self > Pointer;
87  typedef SmartPointer< const Self > ConstPointer;
88 
90  itkTypeMacro( MultiOrderBSplineDecompositionImageFilter, ImageToImageFilter );
91 
93  itkNewMacro( Self );
94 
96  typedef typename Superclass::InputImageType InputImageType;
97  typedef typename Superclass::InputImagePointer InputImagePointer;
98  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
99  typedef typename Superclass::OutputImagePointer OutputImagePointer;
100 
101  typedef typename itk::NumericTraits< typename TOutputImage::PixelType >::RealType CoeffType;
102 
104  itkStaticConstMacro( ImageDimension, unsigned int, TInputImage::ImageDimension );
105  itkStaticConstMacro( OutputImageDimension, unsigned int,
106  TOutputImage::ImageDimension );
107 
109  typedef ImageLinearIteratorWithIndex< TOutputImage > OutputLinearIterator;
110 
113  void SetSplineOrder( unsigned int order );
114 
115  void SetSplineOrder( unsigned int dimension, unsigned int order );
116 
117  void GetSplineOrder( unsigned int dimension )
118  {
119  return m_SplineOrder[ dimension ];
120  }
121 
122 
123  //itkGetMacro( SplineOrder, unsigned int * );
124 
125 #ifdef ITK_USE_CONCEPT_CHECKING
126 
127  itkConceptMacro( DimensionCheck,
128  ( Concept::SameDimension< ImageDimension, OutputImageDimension > ) );
129  itkConceptMacro( InputConvertibleToOutputCheck,
130  ( Concept::Convertible< typename TInputImage::PixelType,
131  typename TOutputImage::PixelType > ) );
132  itkConceptMacro( DoubleConvertibleToOutputCheck,
133  ( Concept::Convertible< double, typename TOutputImage::PixelType > ) );
135 #endif
136 
137 protected:
138 
141  void PrintSelf( std::ostream & os, Indent indent ) const;
142 
143  void GenerateData();
144 
146  void GenerateInputRequestedRegion();
147 
149  void EnlargeOutputRequestedRegion( DataObject * output );
150 
152  std::vector< CoeffType > m_Scratch; // temp storage for processing of Coefficients
153  typename TInputImage::SizeType m_DataLength; // Image size
154 
155  unsigned int m_SplineOrder[ ImageDimension ]; // User specified spline order per dimension (3rd or cubic is the default)
156  double m_SplinePoles[ 3 ]; // Poles calculated for a given spline order
157  int m_NumberOfPoles; // number of poles
158  double m_Tolerance; // Tolerance used for determining initial causal coefficient
159  unsigned int m_IteratorDirection; // Direction for iterator incrementing
160 
161 private:
162 
163  MultiOrderBSplineDecompositionImageFilter( const Self & ); //purposely not implemented
164  void operator=( const Self & ); //purposely not implemented
165 
167  virtual void SetPoles( unsigned int dimension );
168 
170  virtual bool DataToCoefficients1D();
171 
174  void DataToCoefficientsND();
175 
177  virtual void SetInitialCausalCoefficient( double z );
178 
180  virtual void SetInitialAntiCausalCoefficient( double z );
181 
183  void CopyImageToImage();
184 
186  void CopyCoefficientsToScratch( OutputLinearIterator & );
187 
189  void CopyScratchToCoefficients( OutputLinearIterator & );
190 
191 };
192 
193 } // namespace itk
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
196 #include "itkMultiOrderBSplineDecompositionImageFilter.hxx"
197 #endif
198 
199 #endif
itk::NumericTraits< typename TOutputImage::PixelType >::RealType CoeffType
Calculates the B-Spline coefficients of an image. Spline order may be per dimension from 0 to 5 per...


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo