ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkCovarianceSampleFilter.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 __itkCovarianceSampleFilter_h
00019 #define __itkCovarianceSampleFilter_h
00020 
00021 #include "itkProcessObject.h"
00022 
00023 #include "itkVariableSizeMatrix.h"
00024 #include "itkSimpleDataObjectDecorator.h"
00025 
00026 namespace itk
00027 {
00028 namespace Statistics
00029 {
00051 template< class TSample >
00052 class ITK_EXPORT CovarianceSampleFilter:
00053   public ProcessObject
00054 {
00055 public:
00057   typedef CovarianceSampleFilter     Self;
00058   typedef ProcessObject              Superclass;
00059   typedef SmartPointer< Self >       Pointer;
00060   typedef SmartPointer< const Self > ConstPointer;
00061   typedef TSample                    SampleType;
00062 
00064   itkTypeMacro(CovarianceSampleFilter, ProcessObject);
00065   itkNewMacro(Self);
00067 
00069   typedef typename TSample::MeasurementVectorSizeType MeasurementVectorSizeType;
00070 
00072   typedef typename TSample::MeasurementVectorType MeasurementVectorType;
00073 
00075   typedef typename TSample::MeasurementType                           MeasurementType;
00076   typedef typename NumericTraits< MeasurementType >::RealType         MeasurementRealType;
00077 
00079   typedef typename NumericTraits< MeasurementVectorType >::RealType   MeasurementVectorRealType;
00080 
00082   typedef VariableSizeMatrix< double > MatrixType;
00083 
00085   using Superclass::SetInput;
00086   void SetInput(const SampleType *sample);
00087 
00088   const SampleType *  GetInput() const;
00089 
00092   typedef  SimpleDataObjectDecorator< MatrixType > MatrixDecoratedType;
00093 
00096   typedef  SimpleDataObjectDecorator< MeasurementVectorRealType > MeasurementVectorDecoratedType;
00097 
00098   typedef MeasurementVectorDecoratedType OutputType;
00099 
00101   const MatrixType GetCovarianceMatrix() const;
00102 
00103   const MatrixDecoratedType * GetCovarianceMatrixOutput() const;
00104 
00106   const MeasurementVectorRealType GetMean() const;
00107 
00108   const MeasurementVectorDecoratedType * GetMeanOutput() const;
00109 
00110   MeasurementVectorSizeType GetMeasurementVectorSize() const;
00111 
00112 protected:
00113   CovarianceSampleFilter();
00114   virtual ~CovarianceSampleFilter();
00115   void PrintSelf(std::ostream & os, Indent indent) const;
00116 
00118   typedef DataObject::Pointer DataObjectPointer;
00119 
00120   typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
00121   using Superclass::MakeOutput;
00122   virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
00123 
00124   void GenerateData();
00125 
00126 private:
00127   CovarianceSampleFilter(const Self &); //purposely not implemented
00128   void operator=(const Self &);         //purposely not implemented
00129 
00130 };  // end of class
00131 } // end of namespace Statistics
00132 } // end of namespace itk
00133 
00134 #ifndef ITK_MANUAL_INSTANTIATION
00135 #include "itkCovarianceSampleFilter.hxx"
00136 #endif
00137 
00138 #endif
00139