ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkBSplineDecompositionImageFilter.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 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef __itkBSplineDecompositionImageFilter_h
29 #define __itkBSplineDecompositionImageFilter_h
30 
31 #include <vector>
32 
34 #include "vnl/vnl_matrix.h"
35 
36 #include "itkImageToImageFilter.h"
37 
38 namespace itk
39 {
72 template< class TInputImage, class TOutputImage >
74  public ImageToImageFilter< TInputImage, TOutputImage >
75 {
76 public:
82 
85 
87  itkNewMacro(Self);
88 
90  typedef typename Superclass::InputImageType InputImageType;
91  typedef typename Superclass::InputImagePointer InputImagePointer;
92  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
93  typedef typename Superclass::OutputImagePointer OutputImagePointer;
94 
96 
98  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
99  itkStaticConstMacro(OutputImageDimension, unsigned int,
100  TOutputImage::ImageDimension);
102 
105 
108  void SetSplineOrder(unsigned int SplineOrder);
109 
110  itkGetConstMacro(SplineOrder, int);
111 
112 #ifdef ITK_USE_CONCEPT_CHECKING
113 
114  itkConceptMacro( DimensionCheck,
116  itkConceptMacro( InputConvertibleToOutputCheck,
117  ( Concept::Convertible< typename TInputImage::PixelType,
118  typename TOutputImage::PixelType > ) );
119  itkConceptMacro( DoubleConvertibleToOutputCheck,
121 
123 #endif
124 protected:
127  void PrintSelf(std::ostream & os, Indent indent) const;
129 
130  void GenerateData();
131 
133  void GenerateInputRequestedRegion();
134 
136  void EnlargeOutputRequestedRegion(DataObject *output);
137 
139  std::vector< CoeffType > m_Scratch; // temp storage for processing
140  // of Coefficients
141  typename TInputImage::SizeType m_DataLength; // Image size
142 
143  unsigned int m_SplineOrder; // User specified spline order (3rd
144  // or cubic is the default)
145  double m_SplinePoles[3]; // Poles calculated for a given
146  // spline order
147  int m_NumberOfPoles; // number of poles
148 
149  double m_Tolerance; // Tolerance used for determining
150  // initial causal coefficient
151  unsigned int m_IteratorDirection; // Direction for iterator
152  // incrementing
153 private:
154  BSplineDecompositionImageFilter(const Self &); //purposely not implemented
155  void operator=(const Self &); //purposely not implemented
156 
158  virtual void SetPoles();
159 
161  virtual bool DataToCoefficients1D();
162 
165  void DataToCoefficientsND();
166 
168  virtual void SetInitialCausalCoefficient(double z);
169 
172  virtual void SetInitialAntiCausalCoefficient(double z);
173 
175  void CopyImageToImage();
176 
179  void CopyCoefficientsToScratch(OutputLinearIterator &);
180 
182  void CopyScratchToCoefficients(OutputLinearIterator &);
183 };
184 } // namespace itk
185 
186 #ifndef ITK_MANUAL_INSTANTIATION
187 #include "itkBSplineDecompositionImageFilter.hxx"
188 #endif
189 
190 #endif
191