ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkImagePCADecompositionCalculator.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 itkImagePCADecompositionCalculator_h
19 #define itkImagePCADecompositionCalculator_h
20 
21 #include "itkObject.h"
23 #include "vnl/vnl_vector.h"
24 #include "vnl/vnl_matrix.h"
25 
26 namespace itk
27 {
58 template< typename TInputImage,
59  typename TBasisImage = Image< double, TInputImage::ImageDimension > >
61 {
62 public:
65  typedef Object Superclass;
68 
70  itkNewMacro(Self);
71 
74 
76  typedef TInputImage InputImageType;
77  typedef TBasisImage BasisImageType;
78 
80  typedef typename TInputImage::Pointer InputImagePointer;
81  typedef typename TBasisImage::Pointer BasisImagePointer;
82 
84  typedef typename TInputImage::ConstPointer InputImageConstPointer;
85  typedef typename TBasisImage::ConstPointer BasisImageConstPointer;
86 
88  typedef typename TBasisImage::PixelType BasisPixelType;
89 
91  itkStaticConstMacro(InputImageDimension, unsigned int,
92  TInputImage::ImageDimension);
93 
95  itkStaticConstMacro(BasisImageDimension, unsigned int,
96  TBasisImage::ImageDimension);
97 
99  typedef std::vector< BasisImagePointer > BasisImagePointerVector;
100 
102  typedef vnl_matrix< BasisPixelType > BasisMatrixType;
103  typedef vnl_vector< BasisPixelType > BasisVectorType;
104 
106  itkSetConstObjectMacro(Image, InputImageType);
107  itkGetConstObjectMacro(Image, InputImageType);
109 
111  itkSetConstObjectMacro(MeanImage, BasisImageType);
112  itkGetConstObjectMacro(MeanImage, BasisImageType);
114 
117 
119 
121  typedef typename ImagePCAShapeModelEstimator< TInputImage,
123 
126 
128  void Compute();
129 
131  itkGetConstMacro(Projection, BasisVectorType);
132 
133 protected:
136  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
137 
138  void CalculateBasisMatrix();
139 
141 
142 private:
143  typedef typename BasisImageType::SizeType BasisSizeType;
144 
145  ImagePCADecompositionCalculator(const Self &) ITK_DELETE_FUNCTION;
146  void operator=(const Self &) ITK_DELETE_FUNCTION;
147 
157 };
158 } // end namespace itk
159 
160 #ifndef ITK_MANUAL_INSTANTIATION
161 #include "itkImagePCADecompositionCalculator.hxx"
162 #endif
163 
164 #endif
Light weight base class for most itk classes.
Decomposes an image into directions along basis components.
std::vector< BasisImagePointer > BasisImagePointerVector
unsigned long SizeValueType
Definition: itkIntTypes.h:143
Base class for ImagePCAShapeModelEstimator object.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetBasisFromModel(ModelPointerType model)
void SetBasisImages(const BasisImagePointerVector &)
ImagePCAShapeModelEstimator< TInputImage, TBasisImage >::Pointer ModelPointerType
Base class for most ITK classes.
Definition: itkObject.h:57
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Templated n-dimensional image class.
Definition: itkImage.h:75