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  * Copyright UMC Utrecht and contributors
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  Program: Insight Segmentation & Registration Toolkit
21  Module: $RCSfile: itkMultiOrderBSplineDecompositionImageFilter.h,v $
22  Language: C++
23  Date: $Date: 2010-03-19 07:06:01 $
24  Version: $Revision: 1.12 $
25 
26  Copyright (c) Insight Software Consortium. All rights reserved.
27  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
28 
29  Portions of this code are covered under the VTK copyright.
30  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
31 
32  This software is distributed WITHOUT ANY WARRANTY; without even
33  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
34  PURPOSE. See the above copyright notices for more information.
35 
36 =========================================================================*/
37 #ifndef __itkMultiOrderBSplineDecompositionImageFilter_h
38 #define __itkMultiOrderBSplineDecompositionImageFilter_h
39 
40 #include <vector>
41 
42 #include "itkImageLinearIteratorWithIndex.h"
43 #include "vnl/vnl_matrix.h"
44 
45 #include "itkImageToImageFilter.h"
46 
47 namespace itk
48 {
81 template< class TInputImage, class TOutputImage >
83  public ImageToImageFilter< TInputImage, TOutputImage >
84 {
85 public:
86 
89  typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
91  typedef SmartPointer< const Self > ConstPointer;
92 
94  itkTypeMacro( MultiOrderBSplineDecompositionImageFilter, ImageToImageFilter );
95 
97  itkNewMacro( Self );
98 
100  typedef typename Superclass::InputImageType InputImageType;
101  typedef typename Superclass::InputImagePointer InputImagePointer;
102  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
103  typedef typename Superclass::OutputImagePointer OutputImagePointer;
104 
105  typedef typename itk::NumericTraits< typename TOutputImage::PixelType >::RealType CoeffType;
106 
108  itkStaticConstMacro( ImageDimension, unsigned int, TInputImage::ImageDimension );
109  itkStaticConstMacro( OutputImageDimension, unsigned int,
110  TOutputImage::ImageDimension );
111 
113  typedef ImageLinearIteratorWithIndex< TOutputImage > OutputLinearIterator;
114 
117  void SetSplineOrder( unsigned int order );
118 
119  void SetSplineOrder( unsigned int dimension, unsigned int order );
120 
121  void GetSplineOrder( unsigned int dimension )
122  {
123  return m_SplineOrder[ dimension ];
124  }
125 
126 
127  //itkGetMacro( SplineOrder, unsigned int * );
128 
129 #ifdef ITK_USE_CONCEPT_CHECKING
130 
131  itkConceptMacro( DimensionCheck,
132  ( Concept::SameDimension< ImageDimension, OutputImageDimension > ) );
133  itkConceptMacro( InputConvertibleToOutputCheck,
134  ( Concept::Convertible< typename TInputImage::PixelType,
135  typename TOutputImage::PixelType > ) );
136  itkConceptMacro( DoubleConvertibleToOutputCheck,
137  ( Concept::Convertible< double, typename TOutputImage::PixelType > ) );
139 #endif
140 
141 protected:
142 
145  void PrintSelf( std::ostream & os, Indent indent ) const;
146 
147  void GenerateData();
148 
150  void GenerateInputRequestedRegion();
151 
153  void EnlargeOutputRequestedRegion( DataObject * output );
154 
156  std::vector< CoeffType > m_Scratch; // temp storage for processing of Coefficients
157  typename TInputImage::SizeType m_DataLength; // Image size
158 
159  unsigned int m_SplineOrder[ ImageDimension ]; // User specified spline order per dimension (3rd or cubic is the default)
160  double m_SplinePoles[ 3 ]; // Poles calculated for a given spline order
161  int m_NumberOfPoles; // number of poles
162  double m_Tolerance; // Tolerance used for determining initial causal coefficient
163  unsigned int m_IteratorDirection; // Direction for iterator incrementing
164 
165 private:
166 
167  MultiOrderBSplineDecompositionImageFilter( const Self & ); //purposely not implemented
168  void operator=( const Self & ); //purposely not implemented
169 
171  virtual void SetPoles( unsigned int dimension );
172 
174  virtual bool DataToCoefficients1D();
175 
178  void DataToCoefficientsND();
179 
181  virtual void SetInitialCausalCoefficient( double z );
182 
184  virtual void SetInitialAntiCausalCoefficient( double z );
185 
187  void CopyImageToImage();
188 
190  void CopyCoefficientsToScratch( OutputLinearIterator & );
191 
193  void CopyScratchToCoefficients( OutputLinearIterator & );
194 
195 };
196 
197 } // namespace itk
198 
199 #ifndef ITK_MANUAL_INSTANTIATION
200 #include "itkMultiOrderBSplineDecompositionImageFilter.hxx"
201 #endif
202 
203 #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 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo