ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMeanSampleFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkMeanSampleFilter_h
00019 #define __itkMeanSampleFilter_h
00020 
00021 #include "itkProcessObject.h"
00022 #include "itkArray.h"
00023 #include "itkSimpleDataObjectDecorator.h"
00024 
00025 namespace itk
00026 {
00027 namespace Statistics
00028 {
00047 template< class TSample >
00048 class ITK_EXPORT MeanSampleFilter:public ProcessObject
00049 {
00050 public:
00052   typedef MeanSampleFilter           Self;
00053   typedef ProcessObject              Superclass;
00054   typedef SmartPointer< Self >       Pointer;
00055   typedef SmartPointer< const Self > ConstPointer;
00056   typedef TSample                    SampleType;
00057 
00059   itkTypeMacro(MeanSampleFilter, ProcessObject);
00060   itkNewMacro(Self);
00062 
00064   typedef unsigned int                                                MeasurementVectorSizeType;
00065   typedef typename TSample::MeasurementVectorType                     MeasurementVectorType;
00066   typedef typename TSample::MeasurementType                           MeasurementType;
00067   typedef typename NumericTraits< MeasurementType >::RealType         MeasurementRealType;
00068   typedef typename NumericTraits< MeasurementVectorType >::RealType   MeasurementVectorRealType;
00069 
00071   using Superclass::SetInput;
00072   void SetInput(const SampleType *sample);
00073 
00074   const SampleType *  GetInput() const;
00075 
00078   typedef  SimpleDataObjectDecorator< MeasurementVectorRealType > MeasurementVectorDecoratedType;
00079 
00080   typedef MeasurementVectorDecoratedType OutputType;
00081 
00083   const MeasurementVectorDecoratedType * GetOutput() const;
00084 
00085   const MeasurementVectorRealType GetMean() const;
00086 
00087   MeasurementVectorSizeType GetMeasurementVectorSize() const;
00088 
00089 protected:
00090   MeanSampleFilter();
00091   virtual ~MeanSampleFilter();
00092   void PrintSelf(std::ostream & os, Indent indent) const;
00093 
00095   typedef DataObject::Pointer DataObjectPointer;
00096 
00097   typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
00098   using Superclass::MakeOutput;
00099   virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
00100 
00101   void GenerateData();
00102 
00103 private:
00104   MeanSampleFilter(const Self &); //purposely not implemented
00105   void operator=(const Self &);   //purposely not implemented
00106 };                                // end of class
00107 } // end of namespace Statistics
00108 } // end of namespace itk
00109 
00110 #ifndef ITK_MANUAL_INSTANTIATION
00111 #include "itkMeanSampleFilter.hxx"
00112 #endif
00113 
00114 #endif
00115