ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkBSplineControlPointImageFunction.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 itkBSplineControlPointImageFunction_h
19 #define itkBSplineControlPointImageFunction_h
20 
21 #include "itkImageFunction.h"
22 
25 #include "itkFixedArray.h"
26 #include "itkImage.h"
27 #include "itkPointSet.h"
28 #include "itkVariableSizeMatrix.h"
29 #include "itkVector.h"
30 #include "itkVectorContainer.h"
31 
32 namespace itk
33 {
57 template <typename TInputImage, typename TCoordRep = double>
59 : public ImageFunction<TInputImage, typename TInputImage::PixelType, TCoordRep>
60 {
61 public:
63  typedef ImageFunction<TInputImage,
64  typename TInputImage::PixelType, TCoordRep> Superclass;
67 
69  itkNewMacro( Self );
70 
72  itkStaticConstMacro( ImageDimension, unsigned int, TInputImage::ImageDimension );
73 
75  typedef TInputImage ControlPointLatticeType;
76  typedef TInputImage InputImageType;
77  typedef TCoordRep CoordRepType;
78  typedef typename InputImageType::PixelType PixelType;
79  typedef typename InputImageType::RegionType RegionType;
80  typedef typename InputImageType::IndexType IndexType;
81  typedef typename Superclass::PointType PointType;
82  typedef typename InputImageType::RegionType InputImageRegionType;
83 
84  typedef typename InputImageType::SpacingType SpacingType;
85  typedef typename InputImageType::PointType OriginType;
86  typedef typename InputImageType::SizeType SizeType;
87 
92 
98  typedef float RealType;
99 
106 
111  virtual void SetInputImage( const InputImageType * ) ITK_OVERRIDE;
112 
117  void SetSplineOrder( const unsigned int );
118 
123  void SetSplineOrder( const ArrayType & );
124 
128  itkGetConstReferenceMacro( SplineOrder, ArrayType );
129 
146  itkSetMacro( CloseDimension, ArrayType );
147 
151  itkGetConstReferenceMacro( CloseDimension, ArrayType );
152 
156  itkSetMacro( Spacing, SpacingType );
157  itkGetConstMacro( Spacing, SpacingType );
159 
163  itkSetMacro( Origin, OriginType );
164  itkGetConstMacro( Origin, OriginType );
166 
170  itkSetMacro( Size, SizeType );
171  itkGetConstMacro( Size, SizeType );
173 
182  itkSetMacro( BSplineEpsilon, RealType );
183  itkGetConstMacro( BSplineEpsilon, RealType );
185 
191 
196  virtual OutputType EvaluateAtIndex( const IndexType & ) const ITK_OVERRIDE;
197 
203  const ContinuousIndexType & ) const ITK_OVERRIDE;
204 
210  virtual OutputType Evaluate( const PointType & ) const ITK_OVERRIDE;
211 
217 
223 
229  const ContinuousIndexType & ) const;
230 
236  GradientType EvaluateGradient( const PointType & ) const;
237 
244  const PointType &, const unsigned int ) const;
245 
252  const IndexType &, const unsigned int ) const;
253 
260  const ContinuousIndexType &, const unsigned int ) const;
261 
268  const PointType &, const unsigned int ) const;
269 
270 protected:
272  virtual ~BSplineControlPointImageFunction();
273  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
274 
275 private:
276  BSplineControlPointImageFunction( const Self& ) ITK_DELETE_FUNCTION;
277  void operator=( const Self& ) ITK_DELETE_FUNCTION;
278 
280  SizeType m_Size;
281  SpacingType m_Spacing;
282  OriginType m_Origin;
283 
285  ArrayType m_CloseDimension;
286  ArrayType m_SplineOrder;
287 
289 
295 
297 };
298 
299 } // end namespace itk
300 
301 #ifndef ITK_MANUAL_INSTANTIATION
302 #include "itkBSplineControlPointImageFunction.hxx"
303 #endif
304 
305 #endif
void SetSplineOrder(const unsigned int)
HessianComponentType EvaluateHessianAtContinuousIndex(const ContinuousIndexType &, const unsigned int) const
Light weight base class for most itk classes.
Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) > PointType
virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &) const override
virtual void SetInputImage(const InputImageType *) override
GradientType EvaluateGradientAtParametricPoint(const PointType &) const
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
void PrintSelf(std::ostream &os, Indent indent) const override
A templated class holding a M x N size Matrix.
GradientType EvaluateGradient(const PointType &) const
HessianComponentType EvaluateHessianAtParametricPoint(const PointType &, const unsigned int) const
BSpline kernel used for density estimation and nonparameteric regression.
HessianComponentType EvaluateHessianAtIndex(const IndexType &, const unsigned int) const
HessianComponentType EvaluateHessian(const PointType &, const unsigned int) const
Image< CoordRepType, ImageDimension > RealImageType
BSpline kernel used for density estimation and nonparameteric regression.
Evaluate a B-spline object given a grid of control points.
ContinuousIndex< TCoordRep, itkGetStaticConstMacro(ImageDimension) > ContinuousIndexType
ImageFunction< TInputImage, typename TInputImage::PixelType, TCoordRep > Superclass
FixedArray< unsigned, ImageDimension > ArrayType
virtual OutputType Evaluate(const PointType &) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
OutputType EvaluateAtParametricPoint(const PointType &) const
GradientType EvaluateGradientAtContinuousIndex(const ContinuousIndexType &) const
virtual OutputType EvaluateAtIndex(const IndexType &) const override
Evaluates a function of an image at specified position.
Templated n-dimensional image class.
Definition: itkImage.h:75
GradientType EvaluateGradientAtIndex(const IndexType &) const
VariableSizeMatrix< CoordRepType > HessianComponentType