ITK  4.9.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< typename TInputImage, typename TOutputImage >
74  public ImageToImageFilter< TInputImage, TOutputImage >
75 {
76 public:
82 
85 
87  itkNewMacro(Self);
88 
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  // Begin concept checking
114  itkConceptMacro( DimensionCheck,
116  itkConceptMacro( InputConvertibleToOutputCheck,
117  ( Concept::Convertible< typename TInputImage::PixelType,
118  typename TOutputImage::PixelType > ) );
119  itkConceptMacro( DoubleConvertibleToOutputCheck,
121  // End concept checking
122 #endif
123 
124 protected:
127  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
128 
129  void GenerateData() ITK_OVERRIDE;
130 
132  void GenerateInputRequestedRegion() ITK_OVERRIDE;
133 
135  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
136 
138  std::vector< CoeffType > m_Scratch; // temp storage for processing
139  // of Coefficients
140  typename TInputImage::SizeType m_DataLength; // Image size
141 
142  unsigned int m_SplineOrder; // User specified spline order (3rd
143  // or cubic is the default)
144  double m_SplinePoles[3]; // Poles calculated for a given
145  // spline order
146  int m_NumberOfPoles; // number of poles
147 
148  double m_Tolerance; // Tolerance used for determining
149  // initial causal coefficient
150  unsigned int m_IteratorDirection; // Direction for iterator
151  // incrementing
152 
153 private:
154  BSplineDecompositionImageFilter(const Self &) ITK_DELETE_FUNCTION;
155  void operator=(const Self &) ITK_DELETE_FUNCTION;
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 
180 
182  void CopyScratchToCoefficients(OutputLinearIterator &);
183 };
184 } // namespace itk
185 
186 #ifndef ITK_MANUAL_INSTANTIATION
187 #include "itkBSplineDecompositionImageFilter.hxx"
188 #endif
189 
190 #endif
virtual void SetInitialAntiCausalCoefficient(double z)
void CopyCoefficientsToScratch(OutputLinearIterator &)
A multi-dimensional image iterator that visits image pixels within a region in a &quot;scan-line&quot; order...
void SetSplineOrder(unsigned int SplineOrder)
InputImageType::ConstPointer InputImageConstPointer
virtual void SetInitialCausalCoefficient(double z)
ImageLinearIteratorWithIndex< TOutputImage > OutputLinearIterator
ImageToImageFilter< TInputImage, TOutputImage > Superclass
InputImageType::Pointer InputImagePointer
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for all process objects that output image data.
itk::NumericTraits< typename TOutputImage::PixelType >::RealType CoeffType
OutputImageType::Pointer OutputImagePointer
void GenerateInputRequestedRegion() override
void CopyScratchToCoefficients(OutputLinearIterator &)
Calculates the B-Spline coefficients of an image. Spline order may be from 0 to 5.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void EnlargeOutputRequestedRegion(DataObject *output) override
#define itkConceptMacro(name, concept)
Superclass::InputImageConstPointer InputImageConstPointer
Base class for all data objects in ITK.