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 
34 #ifndef __itkMultiOrderBSplineDecompositionImageFilter_h
35 #define __itkMultiOrderBSplineDecompositionImageFilter_h
36 
37 #include <vector>
38 
39 #include "itkImageLinearIteratorWithIndex.h"
40 #include "vnl/vnl_matrix.h"
41 
42 #include "itkImageToImageFilter.h"
43 
44 namespace itk
45 {
78 template <class TInputImage, class TOutputImage>
80  public ImageToImageFilter<TInputImage,TOutputImage>
81 {
82 public:
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  void SetSplineOrder( unsigned int dimension, unsigned int order );
115  void GetSplineOrder( unsigned int dimension )
116  {
117  return m_SplineOrder[ dimension ];
118  }
119  //itkGetMacro( SplineOrder, unsigned int * );
120 
121 #ifdef ITK_USE_CONCEPT_CHECKING
122 
123  itkConceptMacro(DimensionCheck,
124  (Concept::SameDimension<ImageDimension, OutputImageDimension>));
125  itkConceptMacro(InputConvertibleToOutputCheck,
126  (Concept::Convertible<typename TInputImage::PixelType,
127  typename TOutputImage::PixelType>));
128  itkConceptMacro(DoubleConvertibleToOutputCheck,
129  (Concept::Convertible<double, typename TOutputImage::PixelType>));
131 #endif
132 
133 protected:
136  void PrintSelf(std::ostream& os, Indent indent) const;
137 
138  void GenerateData( );
139 
141  void GenerateInputRequestedRegion();
142 
144  void EnlargeOutputRequestedRegion( DataObject *output );
145 
147  std::vector<CoeffType> m_Scratch; // temp storage for processing of Coefficients
148  typename TInputImage::SizeType m_DataLength; // Image size
149 
150  unsigned int m_SplineOrder[ImageDimension]; // User specified spline order per dimension (3rd or cubic is the default)
151  double m_SplinePoles[3]; // Poles calculated for a given spline order
152  int m_NumberOfPoles; // number of poles
153  double m_Tolerance; // Tolerance used for determining initial causal coefficient
154  unsigned int m_IteratorDirection; // Direction for iterator incrementing
155 
156 
157 private:
158  MultiOrderBSplineDecompositionImageFilter( const Self& ); //purposely not implemented
159  void operator=( const Self& ); //purposely not implemented
160 
162  virtual void SetPoles( unsigned int dimension );
163 
165  virtual bool DataToCoefficients1D();
166 
169  void DataToCoefficientsND();
170 
172  virtual void SetInitialCausalCoefficient(double z);
173 
175  virtual void SetInitialAntiCausalCoefficient(double z);
176 
178  void CopyImageToImage();
179 
181  void CopyCoefficientsToScratch( OutputLinearIterator & );
182 
184  void CopyScratchToCoefficients( OutputLinearIterator & );
185 
186 };
187 
188 
189 } // namespace itk
190 
191 #ifndef ITK_MANUAL_INSTANTIATION
192 #include "itkMultiOrderBSplineDecompositionImageFilter.txx"
193 #endif
194 
195 #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 05-01-2014 for elastix by doxygen 1.8.5 elastix logo