ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMaskFeaturePointSelectionFilter.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 __itkMaskFeaturePointSelectionFilter_h
00019 #define __itkMaskFeaturePointSelectionFilter_h
00020 
00021 #include "itkImageToMeshFilter.h"
00022 #include "itkDefaultDynamicMeshTraits.h"
00023 #include "itkImage.h"
00024 #include "itkPointSet.h"
00025 #include "itkImageRegionConstIterator.h"
00026 #include "itkConstNeighborhoodIterator.h"
00027 #include "itkMatrix.h"
00028 #include <vector>
00029 
00030 
00031 namespace itk
00032 {
00056 template<
00057   class TImage,
00058   class TMask = TImage,
00059   class TFeatures = PointSet< Matrix< double, TImage::ImageDimension, TImage::ImageDimension>, TImage::ImageDimension > >
00060 class ITK_EXPORT MaskFeaturePointSelectionFilter;
00061 
00062 template<
00063   class TImagePixel,
00064   class TMaskPixel,
00065   class TTensorValueType,
00066   class TFeaturesTraits,
00067   unsigned VImageDimension >
00068 class ITK_EXPORT MaskFeaturePointSelectionFilter<
00069   Image< TImagePixel, VImageDimension >,
00070   Image< TMaskPixel, VImageDimension >,
00071   PointSet< Matrix< TTensorValueType, VImageDimension, VImageDimension>, VImageDimension, TFeaturesTraits > >:
00072 public ImageToMeshFilter<
00073   Image< TImagePixel, VImageDimension >,
00074   PointSet< Matrix< TTensorValueType, VImageDimension, VImageDimension>, VImageDimension, TFeaturesTraits > >
00075 {
00076 public:
00078   typedef MaskFeaturePointSelectionFilter  Self;
00079   typedef ImageToMeshFilter<
00080     Image< TImagePixel, VImageDimension >,
00081     PointSet< Matrix< TTensorValueType, VImageDimension, VImageDimension>, VImageDimension, TFeaturesTraits >
00082   >                                        Superclass;
00083   typedef SmartPointer< Self >             Pointer;
00084   typedef SmartPointer< const Self >       ConstPointer;
00085 
00087   itkNewMacro(Self);
00088 
00090   itkTypeMacro(MaskFeaturePointSelectionFilter, ImageToMeshFilter);
00091 
00092   itkStaticConstMacro(ImageDimension, unsigned, VImageDimension);
00093 
00095   typedef ImageRegion< VImageDimension >  RegionType;
00096   typedef Size< VImageDimension >         SizeType;
00097   typedef Index< VImageDimension >        IndexType;
00098   typedef Offset< VImageDimension >       OffsetType;
00099 
00101   typedef Image< TImagePixel, VImageDimension >                ImageType;
00102   typedef typename ImageType::ConstPointer                     ImageConstPointer;
00103   typedef typename ImageType::PixelType                        ImagePixelType;
00104 
00106   typedef Image< TMaskPixel, VImageDimension >                 MaskType;
00107   typedef typename MaskType::ConstPointer                      MaskConstPointer;
00108   typedef typename MaskType::PixelType                         MaskPixelType;
00109 
00111   typedef PointSet<
00112     Matrix< TTensorValueType, VImageDimension, VImageDimension>,
00113     VImageDimension,
00114     TFeaturesTraits
00115   >                                              FeaturePointsType;
00116   typedef typename FeaturePointsType::Pointer    FeaturePointsPointer;
00117   typedef typename FeaturePointsType::PixelType  StructureTensorType;
00118   typedef typename FeaturePointsType::PointType  PointType;
00119 
00120 
00122   enum
00123   {
00124     VERTEX_CONNECTIVITY = 0,
00125     EDGE_CONNECTIVITY = 1,
00126     FACE_CONNECTIVITY = 2
00127   };
00128 
00133   void SetNonConnectivity( unsigned connect ) throw ( ExceptionObject );
00134   itkGetConstMacro(NonConnectivity, unsigned);
00136 
00138   itkSetInputMacro(MaskImage, MaskType);
00139   itkGetInputMacro(MaskImage, MaskType);
00141 
00143   itkSetMacro(BlockRadius, SizeType);
00144   itkGetConstMacro(BlockRadius, SizeType);
00146 
00148   itkSetMacro(ComputeStructureTensors, bool);
00149   itkGetConstMacro(ComputeStructureTensors, bool);
00150   itkBooleanMacro(ComputeStructureTensors);
00152 
00154   itkSetMacro(SelectFraction, double);
00155   itkGetConstMacro(SelectFraction, double);
00157 
00158 protected:
00159   MaskFeaturePointSelectionFilter();
00160   ~MaskFeaturePointSelectionFilter();
00161   void PrintSelf(std::ostream & os, Indent indent) const;
00162   void GenerateData();
00163 
00164 private:
00165   //purposely not implemented purposely
00166   MaskFeaturePointSelectionFilter(const MaskFeaturePointSelectionFilter &);
00167   void operator=(const MaskFeaturePointSelectionFilter &);
00168 
00169   unsigned                   m_NonConnectivity;
00170   std::vector< OffsetType >  m_NonConnectivityOffsets;
00171   SizeType                   m_BlockRadius;
00172   double                     m_SelectFraction;
00173   bool                       m_ComputeStructureTensors;
00174 };
00175 } // end namespace itk
00176 
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkMaskFeaturePointSelectionFilter.hxx"
00179 #endif
00180 
00181 #endif
00182