ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkDisplacementFieldToBSplineImageFilter.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 #ifndef __itkDisplacementFieldToBSplineImageFilter_h
19 #define __itkDisplacementFieldToBSplineImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
24 #include "itkPointSet.h"
25 #include "itkVector.h"
26 
27 namespace itk
28 {
29 
40 template <class TInputImage, class TOutputImage = TInputImage>
42  : public ImageToImageFilter<TInputImage, TOutputImage>
43 {
44 public:
49 
51  itkNewMacro( Self );
52 
54  itkStaticConstMacro( ImageDimension, unsigned int, TInputImage::ImageDimension );
55 
56  typedef TInputImage InputFieldType;
57  typedef TOutputImage OutputFieldType;
58 
61 
63  typedef typename OutputFieldType::PixelType PixelType;
64  typedef typename OutputFieldType::PixelType VectorType;
65  typedef typename OutputFieldType::RegionType RegionType;
66  typedef typename OutputFieldType::IndexType IndexType;
67 
68  typedef typename OutputFieldType::PointType PointType;
69  typedef typename OutputFieldType::SpacingType SpacingType;
70  typedef typename OutputFieldType::PointType OriginType;
71  typedef typename OutputFieldType::SizeType SizeType;
72  typedef typename OutputFieldType::DirectionType DirectionType;
73 
76 
83 
85  void SetDisplacementField( const InputFieldType * field )
86  {
87  this->SetInput( field );
88  }
89 
94  {
95  return this->GetInput( 0 );
96  }
97 
102  {
104  }
105 
109  itkSetMacro( SplineOrder, unsigned int );
110 
114  itkGetConstMacro( SplineOrder, unsigned int );
115 
123  itkSetMacro( NumberOfControlPoints, ArrayType );
124 
132  itkGetConstMacro( NumberOfControlPoints, ArrayType );
133 
140  itkSetMacro( NumberOfFittingLevels, ArrayType );
141 
148  void SetNumberOfFittingLevels( unsigned int n )
149  {
150  ArrayType nlevels;
151 
152  nlevels.Fill( n );
153  this->SetNumberOfFittingLevels( nlevels );
154  }
155 
162  itkGetConstMacro( NumberOfFittingLevels, ArrayType );
163 
167  itkBooleanMacro( EstimateInverse );
168  itkSetMacro( EstimateInverse, bool );
169  itkGetConstMacro( EstimateInverse, bool );
171 
175  itkBooleanMacro( EnforceStationaryBoundary );
176  itkSetMacro( EnforceStationaryBoundary, bool );
177  itkGetConstMacro( EnforceStationaryBoundary, bool );
179 
180 protected:
181 
184 
187 
189  void PrintSelf( std::ostream& os, Indent indent ) const;
190 
192  void GenerateData();
193 
194 private:
195  DisplacementFieldToBSplineImageFilter( const Self& ); //purposely not implemented
196  void operator=( const Self& ); //purposely not implemented
197 
200  unsigned int m_SplineOrder;
203 
205 
206 
207 };
208 
209 } // end namespace itk
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 #include "itkDisplacementFieldToBSplineImageFilter.hxx"
213 #endif
214 
215 #endif
216