ITK  4.8.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 >
53  public ProcessObject
54 {
55 public:
61  typedef TSample SampleType;
62 
65  itkNewMacro(Self);
67 
69  typedef typename SampleType::MeasurementVectorType MeasurementVectorType;
70 
72  typedef typename SampleType::MeasurementVectorSizeType MeasurementVectorSizeType;
73 
75  typedef typename SampleType::MeasurementType MeasurementType;
76 
79 
82 
83 
86  void SetInput(const SampleType *sample);
87 
89  const SampleType * GetInput() const;
90 
91 
94 
96  const MatrixType GetCovarianceMatrix() const;
97 
102 
103 
105  const MeasurementVectorRealType GetMean() const;
106 
112 
113 
115 
116 protected:
118  virtual ~CovarianceSampleFilter();
119  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
120 
123 
127 
128  virtual void GenerateData() ITK_OVERRIDE;
129 
130 private:
131  CovarianceSampleFilter(const Self &); //purposely not implemented
132  void operator=(const Self &); //purposely not implemented
133 
134 }; // end of class
135 } // end of namespace Statistics
136 } // end of namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkCovarianceSampleFilter.hxx"
140 #endif
141 
142 #endif
virtual void PrintSelf(std::ostream &os, Indent indent) const override
NumericTraits< MeasurementType >::RealType MeasurementRealType
const MeasurementVectorRealType GetMean() const
Light weight base class for most itk classes.
VariableSizeMatrix< MeasurementRealType > MatrixType
NumericTraits< MeasurementVectorType >::RealType MeasurementVectorRealType
A templated class holding a M x N size Matrix.
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
const SampleType * GetInput() const
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
SampleType::MeasurementVectorType MeasurementVectorType
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
MeasurementVectorSizeType GetMeasurementVectorSize() const
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
void SetInput(const SampleType *sample)
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Make a DataObject of the correct type to used as the specified output.
SimpleDataObjectDecorator< MatrixType > MatrixDecoratedType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void GenerateData() override
const MatrixType GetCovarianceMatrix() const
const MatrixDecoratedType * GetCovarianceMatrixOutput() const
const MeasurementVectorDecoratedType * GetMeanOutput() const
SampleType::MeasurementVectorSizeType MeasurementVectorSizeType
SimpleDataObjectDecorator< MeasurementVectorRealType > MeasurementVectorDecoratedType
Calculates the covariance matrix of the target sample data.