ITK  5.2.0
Insight Toolkit
itkMaskFeaturePointSelectionFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
59 template <typename TImage,
60  typename TMask = TImage,
61  typename TFeatures = PointSet<Matrix<SpacePrecisionType, TImage::ImageDimension, TImage::ImageDimension>,
62  TImage::ImageDimension>>
63 class ITK_TEMPLATE_EXPORT MaskFeaturePointSelectionFilter : public ImageToMeshFilter<TImage, TFeatures>
64 {
65 public:
66  ITK_DISALLOW_COPY_AND_ASSIGN(MaskFeaturePointSelectionFilter);
67 
73 
75  itkNewMacro(Self);
76 
79 
80  static constexpr unsigned ImageDimension = 3u;
81 
87 
89  using ImageType = TImage;
90  using ImageConstPointer = typename ImageType::ConstPointer;
91  using ImagePixelType = typename ImageType::PixelType;
92 
94  using MaskType = TMask;
95  using MaskConstPointer = typename MaskType::ConstPointer;
96  using MaskPixelType = typename MaskType::PixelType;
97 
99  using FeaturePointsType = TFeatures;
100  using FeaturePointsPointer = typename FeaturePointsType::Pointer;
101  using StructureTensorType = typename FeaturePointsType::PixelType;
103 
105  enum
106  {
107  VERTEX_CONNECTIVITY = 0,
108  EDGE_CONNECTIVITY = 1,
109  FACE_CONNECTIVITY = 2
110  };
111 
116  itkSetMacro(NonConnectivity, unsigned);
117  itkGetMacro(NonConnectivity, unsigned);
119 
121  itkSetInputMacro(MaskImage, MaskType);
122  itkGetInputMacro(MaskImage, MaskType);
124 
126  itkSetMacro(BlockRadius, SizeType);
127  itkGetConstReferenceMacro(BlockRadius, SizeType);
129 
131  itkSetMacro(ComputeStructureTensors, bool);
132  itkGetMacro(ComputeStructureTensors, bool);
133  itkBooleanMacro(ComputeStructureTensors);
135 
137  itkSetClampMacro(SelectFraction, double, 0, 1);
138  itkGetMacro(SelectFraction, double);
140 
141 #ifdef ITK_USE_CONCEPT_CHECKING
142  // Begin concept checking
146  // End concept checking
147 #endif
148 
149 protected:
151  ~MaskFeaturePointSelectionFilter() override = default;
152  void
153  PrintSelf(std::ostream & os, Indent indent) const override;
154 
155  void
156  GenerateData() override;
157 
162  void
163  ComputeConnectivityOffsets();
164 
165 private:
167  std::vector<OffsetType> m_NonConnectivityOffsets;
171 };
172 } // end namespace itk
173 
174 #ifndef ITK_MANUAL_INSTANTIATION
175 # include "itkMaskFeaturePointSelectionFilter.hxx"
176 #endif
177 
178 #endif
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
itkConstNeighborhoodIterator.h
itk::Size< ImageDimension >
itkMatrix.h
itk::MaskFeaturePointSelectionFilter::MaskType
TMask MaskType
Definition: itkMaskFeaturePointSelectionFilter.h:94
itk::MaskFeaturePointSelectionFilter::MaskConstPointer
typename MaskType::ConstPointer MaskConstPointer
Definition: itkMaskFeaturePointSelectionFilter.h:95
itk::MaskFeaturePointSelectionFilter::StructureTensorType
typename FeaturePointsType::PixelType StructureTensorType
Definition: itkMaskFeaturePointSelectionFilter.h:101
itk::MaskFeaturePointSelectionFilter::m_NonConnectivity
unsigned m_NonConnectivity
Definition: itkMaskFeaturePointSelectionFilter.h:166
itk::ImageRegion
An image region represents a structured region of data.
Definition: itkImageRegion.h:69
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itkConceptChecking.h
itk::MaskFeaturePointSelectionFilter::FeaturePointsType
TFeatures FeaturePointsType
Definition: itkMaskFeaturePointSelectionFilter.h:99
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itkImage.h
itk::MaskFeaturePointSelectionFilter::m_NonConnectivityOffsets
std::vector< OffsetType > m_NonConnectivityOffsets
Definition: itkMaskFeaturePointSelectionFilter.h:167
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MaskFeaturePointSelectionFilter::ImagePixelType
typename ImageType::PixelType ImagePixelType
Definition: itkMaskFeaturePointSelectionFilter.h:91
itkImageRegionConstIterator.h
itk::MaskFeaturePointSelectionFilter::m_SelectFraction
double m_SelectFraction
Definition: itkMaskFeaturePointSelectionFilter.h:169
itk::Concept::SameDimension
Definition: itkConceptChecking.h:692
itkDefaultDynamicMeshTraits.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ImageToMeshFilter
ImageToMeshFilter is the base class for all process objects that output Mesh data and require image d...
Definition: itkImageToMeshFilter.h:36
itkImageToMeshFilter.h
itk::Offset< ImageDimension >
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::MaskFeaturePointSelectionFilter::m_BlockRadius
SizeType m_BlockRadius
Definition: itkMaskFeaturePointSelectionFilter.h:168
itk::MaskFeaturePointSelectionFilter::PointType
typename FeaturePointsType::PointType PointType
Definition: itkMaskFeaturePointSelectionFilter.h:102
itk::MaskFeaturePointSelectionFilter::FeaturePointsPointer
typename FeaturePointsType::Pointer FeaturePointsPointer
Definition: itkMaskFeaturePointSelectionFilter.h:100
itk::MaskFeaturePointSelectionFilter::ImageType
TImage ImageType
Definition: itkMaskFeaturePointSelectionFilter.h:89
itk::MaskFeaturePointSelectionFilter::ImageConstPointer
typename ImageType::ConstPointer ImageConstPointer
Definition: itkMaskFeaturePointSelectionFilter.h:90
itk::MaskFeaturePointSelectionFilter::m_ComputeStructureTensors
bool m_ComputeStructureTensors
Definition: itkMaskFeaturePointSelectionFilter.h:170
itk::MaskFeaturePointSelectionFilter::MaskPixelType
typename MaskType::PixelType MaskPixelType
Definition: itkMaskFeaturePointSelectionFilter.h:96
itkPointSet.h
itk::MaskFeaturePointSelectionFilter
Generate a PointSet containing the feature points selected from a masked 3D input image.
Definition: itkMaskFeaturePointSelectionFilter.h:63