ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMeanSampleFilter.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 itkMeanSampleFilter_h
19 #define itkMeanSampleFilter_h
20 
21 #include "itkProcessObject.h"
22 #include "itkArray.h"
24 
25 namespace itk
26 {
27 namespace Statistics
28 {
47 template< typename TSample >
48 class ITK_TEMPLATE_EXPORT MeanSampleFilter : public ProcessObject
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_ASSIGN(MeanSampleFilter);
52 
58  using SampleType = TSample;
59 
61  itkTypeMacro(MeanSampleFilter, ProcessObject);
62  itkNewMacro(Self);
64 
66  using MeasurementVectorType = typename SampleType::MeasurementVectorType;
67 
69  using MeasurementVectorSizeType = typename SampleType::MeasurementVectorSizeType;
70 
72  using MeasurementType = typename SampleType::MeasurementType;
73 
76 
79 
80 
82  using Superclass::SetInput;
83  void SetInput(const SampleType *sample);
84 
86  const SampleType * GetInput() const;
87 
88 
90  const MeasurementVectorRealType GetMean() const;
91 
95  const MeasurementVectorDecoratedType * GetOutput() const;
97 
98 
99  MeasurementVectorSizeType GetMeasurementVectorSize() const;
100 
101 protected:
103  ~MeanSampleFilter() override = default;
104  void PrintSelf(std::ostream & os, Indent indent) const override;
105 
108 
110  using Superclass::MakeOutput;
111  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
112 
113  void GenerateData() override;
114 }; // end of class
115 } // end of namespace Statistics
116 } // end of namespace itk
117 
118 #ifndef ITK_MANUAL_INSTANTIATION
119 #include "itkMeanSampleFilter.hxx"
120 #endif
121 
122 #endif
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Define numeric traits for std::vector.
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
typename SampleType::MeasurementVectorSizeType MeasurementVectorSizeType
typename NumericTraits< MeasurementVectorType >::RealType MeasurementVectorRealType
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Given a sample, this filter computes the sample mean.
typename SampleType::MeasurementVectorType MeasurementVectorType
typename SampleType::MeasurementType MeasurementType
SmartPointer< Self > Pointer
typename NumericTraits< MeasurementType >::RealType MeasurementRealType