ITK  6.0.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  * https://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_MOVE(MaskFeaturePointSelectionFilter);
67 
73 
75  itkNewMacro(Self);
76 
78  itkOverrideGetNameOfClassMacro(MaskFeaturePointSelectionFilter);
79 
80  static constexpr unsigned int ImageDimension = 3u;
81 
87 
89  using ImageType = TImage;
91  using ImagePixelType = typename ImageType::PixelType;
92 
94  using MaskType = TMask;
96  using MaskPixelType = typename MaskType::PixelType;
97 
99  using FeaturePointsType = TFeatures;
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 int);
117  itkGetMacro(NonConnectivity, unsigned int);
121  itkSetInputMacro(MaskImage, MaskType);
122  itkGetInputMacro(MaskImage, MaskType);
126  itkSetMacro(BlockRadius, SizeType);
127  itkGetConstReferenceMacro(BlockRadius, SizeType);
131  itkSetMacro(ComputeStructureTensors, bool);
132  itkGetMacro(ComputeStructureTensors, bool);
133  itkBooleanMacro(ComputeStructureTensors);
137  itkSetClampMacro(SelectFraction, double, 0, 1);
138  itkGetMacro(SelectFraction, double);
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:
166  unsigned int m_NonConnectivity{};
167  std::vector<OffsetType> m_NonConnectivityOffsets{};
168  SizeType m_BlockRadius{};
169  double m_SelectFraction{};
170  bool m_ComputeStructureTensors{};
171 };
172 } // end namespace itk
173 
174 #ifndef ITK_MANUAL_INSTANTIATION
175 # include "itkMaskFeaturePointSelectionFilter.hxx"
176 #endif
177 
178 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:68
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::ImageRegion
An image region represents a structured region of data.
Definition: itkImageRegion.h:80
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::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::Concept::SameDimension
Definition: itkConceptChecking.h:697
itkDefaultDynamicMeshTraits.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
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:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
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::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