ITK  4.8.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 WeightedMeanSampleFilter : public MeanSampleFilter< TSample >
43 {
44 public:
50 
53  itkNewMacro(Self);
55 
57  typedef typename Superclass::SampleType SampleType;
61 
65 
66 
68  typedef double WeightValueType;
69 
70 
73 
76 
78  itkSetGetDecoratedInputMacro(Weights, WeightArrayType);
79 
80 
83 
86 
88  itkSetGetDecoratedObjectInputMacro(WeightingFunction, WeightingFunctionType);
89 
90 
94 
95 protected:
97  virtual ~WeightedMeanSampleFilter();
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
107 
108 private:
109  WeightedMeanSampleFilter(const Self &); //purposely not implemented
110  void operator=(const Self &); //purposely not implemented
111 }; // end of class
112 } // end of namespace Statistics
113 } // end of namespace itk
114 
115 #ifndef ITK_MANUAL_INSTANTIATION
116 #include "itkWeightedMeanSampleFilter.hxx"
117 #endif
118 
119 #endif
Given a sample where each measurement vector has associated weight value, this filter computes the sa...
MeasurementVectorDecoratedType OutputType
Light weight base class for most itk classes.
NumericTraits< MeasurementVectorType >::RealType MeasurementVectorRealType
SampleType::MeasurementVectorType MeasurementVectorType
SampleType::MeasurementType MeasurementType
SimpleDataObjectDecorator< MeasurementVectorRealType > MeasurementVectorDecoratedType
SimpleDataObjectDecorator< WeightArrayType > InputWeightArrayObjectType
FunctionBase< MeasurementVectorType, WeightValueType > WeightingFunctionType
NumericTraits< MeasurementType >::RealType MeasurementRealType
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
void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
DataObjectDecorator< WeightingFunctionType > InputWeightingFunctionObjectType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Given a sample, this filter computes the sample mean.
SampleType::MeasurementVectorSizeType MeasurementVectorSizeType
Superclass::MeasurementVectorType MeasurementVectorType