ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkCovarianceSampleFilter.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 itkCovarianceSampleFilter_h
19 #define itkCovarianceSampleFilter_h
20 
21 #include "itkProcessObject.h"
22 
23 #include "itkVariableSizeMatrix.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
51 template< typename TSample >
52 class ITK_TEMPLATE_EXPORT CovarianceSampleFilter:
53  public ProcessObject
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_ASSIGN(CovarianceSampleFilter);
57 
63  using SampleType = TSample;
64 
67  itkNewMacro(Self);
69 
71  using MeasurementVectorType = typename SampleType::MeasurementVectorType;
72 
74  using MeasurementVectorSizeType = typename SampleType::MeasurementVectorSizeType;
75 
77  using MeasurementType = typename SampleType::MeasurementType;
78 
81 
84 
85 
87  using Superclass::SetInput;
88  void SetInput(const SampleType *sample);
89 
91  const SampleType * GetInput() const;
92 
93 
96 
98  const MatrixType GetCovarianceMatrix() const;
99 
103  const MatrixDecoratedType * GetCovarianceMatrixOutput() const;
104 
105 
107  const MeasurementVectorRealType GetMean() const;
108 
112  const MeasurementVectorDecoratedType * GetMeanOutput() const;
114 
115 
116  MeasurementVectorSizeType GetMeasurementVectorSize() const;
117 
118 protected:
120  ~CovarianceSampleFilter() override = default;
121  void PrintSelf(std::ostream & os, Indent indent) const override;
122 
125 
127  using Superclass::MakeOutput;
128  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
129 
130  void GenerateData() override;
131 }; // end of class
132 } // end of namespace Statistics
133 } // end of namespace itk
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkCovarianceSampleFilter.hxx"
137 #endif
138 
139 #endif
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Define numeric traits for std::vector.
A templated class holding a M x N size Matrix.
typename NumericTraits< MeasurementType >::RealType MeasurementRealType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:40
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
typename SampleType::MeasurementType MeasurementType
typename SampleType::MeasurementVectorSizeType MeasurementVectorSizeType
typename SampleType::MeasurementVectorType MeasurementVectorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< Self > Pointer
typename NumericTraits< MeasurementVectorType >::RealType MeasurementVectorRealType
Calculates the covariance matrix of the target sample data.