ITK  5.0.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  typename TImage,
60  typename TMask = TImage,
61  typename TFeatures = PointSet< Matrix< SpacePrecisionType, TImage::ImageDimension, TImage::ImageDimension>, TImage::ImageDimension > >
62 class ITK_TEMPLATE_EXPORT MaskFeaturePointSelectionFilter: public ImageToMeshFilter< TImage, TFeatures >
63 {
64 public:
65  ITK_DISALLOW_COPY_AND_ASSIGN(MaskFeaturePointSelectionFilter);
66 
72 
74  itkNewMacro(Self);
75 
78 
79  static constexpr unsigned ImageDimension = 3u;
80 
86 
88  using ImageType = TImage;
89  using ImageConstPointer = typename ImageType::ConstPointer;
90  using ImagePixelType = typename ImageType::PixelType;
91 
93  using MaskType = TMask;
94  using MaskConstPointer = typename MaskType::ConstPointer;
95  using MaskPixelType = typename MaskType::PixelType;
96 
98  using FeaturePointsType = TFeatures;
99  using FeaturePointsPointer = typename FeaturePointsType::Pointer;
100  using StructureTensorType = typename FeaturePointsType::PixelType;
102 
104  enum
105  {
106  VERTEX_CONNECTIVITY = 0,
107  EDGE_CONNECTIVITY = 1,
108  FACE_CONNECTIVITY = 2
109  };
110 
115  itkSetMacro(NonConnectivity, unsigned);
116  itkGetMacro(NonConnectivity, unsigned);
118 
120  itkSetInputMacro(MaskImage, MaskType);
121  itkGetInputMacro(MaskImage, MaskType);
123 
125  itkSetMacro(BlockRadius, SizeType);
126  itkGetConstReferenceMacro(BlockRadius, SizeType);
128 
130  itkSetMacro(ComputeStructureTensors, bool);
131  itkGetMacro(ComputeStructureTensors, bool);
132  itkBooleanMacro(ComputeStructureTensors);
134 
136  itkSetClampMacro(SelectFraction, double, 0, 1);
137  itkGetMacro(SelectFraction, double);
139 
140 #ifdef ITK_USE_CONCEPT_CHECKING
141  // Begin concept checking
142  itkConceptMacro( ImageDimensionShouldBe3,
144  itkConceptMacro( MaskDimensionShouldBe3,
146  itkConceptMacro( PointDimensionShouldBe3,
148  // End concept checking
149 #endif
150 
151 protected:
153  ~MaskFeaturePointSelectionFilter() override = default;
154  void PrintSelf(std::ostream & os, Indent indent) const override;
155 
156  void GenerateData() override;
157 
162  void ComputeConnectivityOffsets();
163 
164 private:
166  std::vector< OffsetType > m_NonConnectivityOffsets;
170 };
171 } // end namespace itk
172 
173 #ifndef ITK_MANUAL_INSTANTIATION
174 #include "itkMaskFeaturePointSelectionFilter.hxx"
175 #endif
176 
177 #endif
Light weight base class for most itk classes.
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
An image region represents a structured region of data.
ImageToMeshFilter is the base class for all process objects that output Mesh data and require image d...
Generate a PointSet containing the feature points selected from a masked 3D input image...
typename FeaturePointsType::PixelType StructureTensorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename FeaturePointsType::Pointer FeaturePointsPointer
typename FeaturePointsType::PointType PointType
#define itkConceptMacro(name, concept)