ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkLevelSetDomainPartitionImageWithKdTree.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 __itkLevelSetDomainPartitionImageWithKdTree_h
00019 #define __itkLevelSetDomainPartitionImageWithKdTree_h
00020 
00021 #include "itkLevelSetDomainPartitionImageBase.h"
00022 
00023 #include "itkListSample.h"
00024 #include "itkKdTreeGenerator.h"
00025 
00026 namespace itk
00027 {
00033 template< class TImage >
00034 class LevelSetDomainPartitionImageWithKdTree:
00035   public LevelSetDomainPartitionImageBase< TImage >
00036 {
00037 public:
00038 
00039   typedef LevelSetDomainPartitionImageWithKdTree      Self;
00040   typedef LevelSetDomainPartitionImageBase< TImage >  Superclass;
00041   typedef SmartPointer< Self >                        Pointer;
00042   typedef SmartPointer< const Self >                  ConstPointer;
00043 
00044   itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
00045 
00047   itkNewMacro(Self);
00048 
00049   itkTypeMacro( LevelSetDomainPartitionImageWithKdTree,
00050                 LevelSetDomainPartitionImageBase);
00051 
00052   typedef TImage                                        ImageType;
00053   typedef typename Superclass::ListIndexType            ListIndexType;
00054   typedef typename Superclass::ListRegionType           ListRegionType;
00055   typedef typename Superclass::ListPointType            ListPointType;
00056   typedef typename Superclass::ListIteratorType         ListIteratorType;
00057   typedef typename Superclass::IdentifierListType       IdentifierListType;
00058 
00059   typedef typename ListPointType::VectorType                    CentroidVectorType;
00060   typedef typename Statistics::ListSample< CentroidVectorType > SampleType;
00061   typedef typename Statistics::KdTreeGenerator< SampleType >    TreeGeneratorType;
00062   typedef typename TreeGeneratorType::Pointer                   TreePointer;
00063   typedef typename TreeGeneratorType::KdTreeType                TreeType;
00064   typedef typename TreeType::Pointer                            KdTreePointer;
00065 
00067   itkSetObjectMacro( KdTree, TreeType );
00068 
00070   typedef unsigned int NeighborsIdType;
00071 
00073   itkSetMacro( NumberOfNeighbors, NeighborsIdType );
00074   itkGetMacro( NumberOfNeighbors, NeighborsIdType );
00076 
00077 protected:
00078   LevelSetDomainPartitionImageWithKdTree();
00079   ~LevelSetDomainPartitionImageWithKdTree();
00080 
00083   void PopulateListDomain();
00084 
00087   void PopulateDomainWithKdTree();
00088 
00089 private:
00090   LevelSetDomainPartitionImageWithKdTree(const Self &); // purposely not implemented
00091   void operator=(const Self &); // purposely not implemented
00092 
00093   KdTreePointer     m_KdTree;
00094   NeighborsIdType   m_NumberOfNeighbors;
00095 };
00096 
00097 } //end namespace itk
00098 
00099 #ifndef ITK_MANUAL_INSTANTIATION
00100 #include "itkLevelSetDomainPartitionImageBase.h"
00101 #endif
00102 
00103 #endif
00104