ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkWeightedMeanSampleFilter.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 itkWeightedMeanSampleFilter_h
19 #define itkWeightedMeanSampleFilter_h
20 
21 #include "itkMeanSampleFilter.h"
22 #include "itkFunctionBase.h"
23 #include "itkDataObjectDecorator.h"
24 
25 namespace itk
26 {
27 namespace Statistics
28 {
41 template< typename TSample >
42 class ITK_TEMPLATE_EXPORT WeightedMeanSampleFilter : public MeanSampleFilter< TSample >
43 {
44 public:
50 
53  itkNewMacro(Self);
55 
57  typedef typename Superclass::SampleType SampleType;
58  typedef typename Superclass::MeasurementVectorType MeasurementVectorType;
59  typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType;
60  typedef typename Superclass::MeasurementType MeasurementType;
61 
63  typedef typename Superclass::MeasurementVectorRealType MeasurementVectorRealType;
64  typedef typename Superclass::MeasurementRealType MeasurementRealType;
65 
66 
68  typedef double WeightValueType;
69 
70 
73 
76 
78  itkSetGetDecoratedInputMacro(Weights, WeightArrayType);
79 
80 
83 
86 
88  itkSetGetDecoratedObjectInputMacro(WeightingFunction, WeightingFunctionType);
89 
90 
92  typedef typename Superclass::MeasurementVectorDecoratedType MeasurementVectorDecoratedType;
93  typedef typename Superclass::OutputType OutputType;
94 
95 protected:
97  virtual ~WeightedMeanSampleFilter() ITK_OVERRIDE;
98  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
99 
100  void GenerateData() ITK_OVERRIDE;
101 
102  // compute mean with weight array
103  void ComputeMeanWithWeights();
104 
105  // compute mean using a weighting function
106  void ComputeMeanWithWeightingFunction();
107 
108 private:
109  ITK_DISALLOW_COPY_AND_ASSIGN(WeightedMeanSampleFilter);
110 }; // end of class
111 } // end of namespace Statistics
112 } // end of namespace itk
113 
114 #ifndef ITK_MANUAL_INSTANTIATION
115 #include "itkWeightedMeanSampleFilter.hxx"
116 #endif
117 
118 #endif
Given a sample where each measurement vector has associated weight value, this filter computes the sa...
Light weight base class for most itk classes.
SimpleDataObjectDecorator< WeightArrayType > InputWeightArrayObjectType
FunctionBase< MeasurementVectorType, WeightValueType > WeightingFunctionType
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
Base class for all ITK function objects.
Decorates any subclass of itkObject with a DataObject API.
Superclass::MeasurementVectorDecoratedType MeasurementVectorDecoratedType
Superclass::MeasurementRealType MeasurementRealType
Superclass::MeasurementVectorRealType MeasurementVectorRealType
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
DataObjectDecorator< WeightingFunctionType > InputWeightingFunctionObjectType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Given a sample, this filter computes the sample mean.
Superclass::MeasurementVectorType MeasurementVectorType