ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkMaskFeaturePointSelectionFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkMaskFeaturePointSelectionFilter_h
19 #define __itkMaskFeaturePointSelectionFilter_h
20 
21 #include "itkImageToMeshFilter.h"
23 #include "itkImage.h"
24 #include "itkPointSet.h"
27 #include "itkMatrix.h"
28 #include "itkConceptChecking.h"
29 #include <vector>
30 
31 
32 namespace itk
33 {
58 template<
59  class TImage,
60  class TMask = TImage,
61  class TFeatures = PointSet< Matrix< double, TImage::ImageDimension, TImage::ImageDimension>, TImage::ImageDimension > >
62 class ITK_EXPORT MaskFeaturePointSelectionFilter: public ImageToMeshFilter< TImage, TFeatures >
63 {
64 public:
70 
72  itkNewMacro(Self);
73 
76 
77  itkStaticConstMacro(ImageDimension, unsigned, 3u);
78 
84 
86  typedef TImage ImageType;
87  typedef typename ImageType::ConstPointer ImageConstPointer;
88  typedef typename ImageType::PixelType ImagePixelType;
89 
91  typedef TMask MaskType;
92  typedef typename MaskType::ConstPointer MaskConstPointer;
93  typedef typename MaskType::PixelType MaskPixelType;
94 
96  typedef TFeatures FeaturePointsType;
97  typedef typename FeaturePointsType::Pointer FeaturePointsPointer;
98  typedef typename FeaturePointsType::PixelType StructureTensorType;
99  typedef typename FeaturePointsType::PointType PointType;
100 
102  enum
103  {
104  VERTEX_CONNECTIVITY = 0,
105  EDGE_CONNECTIVITY = 1,
106  FACE_CONNECTIVITY = 2
107  };
108 
113  itkSetMacro(NonConnectivity, unsigned);
114  itkGetMacro(NonConnectivity, unsigned);
116 
118  itkSetInputMacro(MaskImage, MaskType);
119  itkGetInputMacro(MaskImage, MaskType);
121 
123  itkSetMacro(BlockRadius, SizeType);
124  itkGetConstReferenceMacro(BlockRadius, SizeType);
126 
128  itkSetMacro(ComputeStructureTensors, bool);
129  itkGetMacro(ComputeStructureTensors, bool);
130  itkBooleanMacro(ComputeStructureTensors);
132 
134  itkSetClampMacro(SelectFraction, double, 0, 1);
135  itkGetMacro(SelectFraction, double);
137 
138 #ifdef ITK_USE_CONCEPT_CHECKING
139 
140  itkConceptMacro( ImageDimensionShouldBe3,
142  itkConceptMacro( MaskDimensionShouldBe3,
144  itkConceptMacro( PointDimensionShouldBe3,
146 
148 #endif
149 
150 protected:
153  void PrintSelf(std::ostream & os, Indent indent) const;
154 
155  void GenerateData();
156 
161  void ComputeConnectivityOffsets( void ) throw ( ExceptionObject );
162 
163 private:
164  // purposely not implemented
166  void operator=(const MaskFeaturePointSelectionFilter &);
167 
168  unsigned m_NonConnectivity;
169  std::vector< OffsetType > m_NonConnectivityOffsets;
170  SizeType m_BlockRadius;
171  double m_SelectFraction;
172  bool m_ComputeStructureTensors;
173 };
174 } // end namespace itk
175 
176 #ifndef ITK_MANUAL_INSTANTIATION
177 #include "itkMaskFeaturePointSelectionFilter.hxx"
178 #endif
179 
180 #endif
181