ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkWeightedCentroidKdTreeGenerator.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 __itkWeightedCentroidKdTreeGenerator_h
00019 #define __itkWeightedCentroidKdTreeGenerator_h
00020 
00021 #include <vector>
00022 
00023 #include "itkSubsample.h"
00024 #include "itkKdTreeGenerator.h"
00025 
00026 namespace itk
00027 {
00028 namespace Statistics
00029 {
00065 template< class TSample >
00066 class ITK_EXPORT WeightedCentroidKdTreeGenerator:
00067   public KdTreeGenerator< TSample >
00068 {
00069 public:
00071   typedef WeightedCentroidKdTreeGenerator Self;
00072   typedef KdTreeGenerator< TSample >      Superclass;
00073   typedef SmartPointer< Self >            Pointer;
00074   typedef SmartPointer< const Self >      ConstPointer;
00075 
00077   itkTypeMacro(WeightedCentroidKdTreeGenerator, KdTreeGenerator);
00078 
00080   itkNewMacro(Self);
00081 
00083   typedef typename Superclass::MeasurementVectorType MeasurementVectorType;
00084   typedef typename Superclass::MeasurementType       MeasurementType;
00085   typedef typename Superclass::SubsampleType         SubsampleType;
00086   typedef typename Superclass::SubsamplePointer      SubsamplePointer;
00087   typedef typename Superclass::KdTreeType            KdTreeType;
00088   typedef typename Superclass::KdTreeNodeType        KdTreeNodeType;
00089 protected:
00090 
00092   WeightedCentroidKdTreeGenerator();
00093 
00095   virtual ~WeightedCentroidKdTreeGenerator() {}
00096 
00097   void PrintSelf(std::ostream & os, Indent indent) const;
00098 
00100   virtual KdTreeNodeType * GenerateNonterminalNode(unsigned int beginIndex,
00101                                                    unsigned int endIndex,
00102                                                    MeasurementVectorType
00103                                                    & lowerBound,
00104                                                    MeasurementVectorType
00105                                                    & upperBound,
00106                                                    unsigned int level);
00107 
00108 private:
00109   WeightedCentroidKdTreeGenerator(const Self &); //purposely not implemented
00110   void operator=(const Self &);                  //purposely not implemented
00111 
00112   MeasurementVectorType m_TempLowerBound;
00113   MeasurementVectorType m_TempUpperBound;
00114   MeasurementVectorType m_TempMean;
00115 };  // end of class
00116 } // end of namespace Statistics
00117 } // end of namespace itk
00118 
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkWeightedCentroidKdTreeGenerator.hxx"
00121 #endif
00122 
00123 #endif
00124