ITK  5.4.0
Insight Toolkit
itkImageMaskSpatialObject.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 itkImageMaskSpatialObject_h
19 #define itkImageMaskSpatialObject_h
20 
21 #include "itkNumericTraits.h"
22 #include "itkImageSpatialObject.h"
24 
25 namespace itk
26 {
46 template <unsigned int TDimension = 3, typename TPixel = unsigned char>
47 class ITK_TEMPLATE_EXPORT ImageMaskSpatialObject : public ImageSpatialObject<TDimension, TPixel>
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_MOVE(ImageMaskSpatialObject);
51 
56 
57  using typename Superclass::ScalarType;
58  using typename Superclass::PixelType;
59  using typename Superclass::ImageType;
60  using typename Superclass::ImagePointer;
61  using typename Superclass::IndexType;
62  using typename Superclass::RegionType;
63  using typename Superclass::SizeType;
64  using typename Superclass::TransformType;
65  using typename Superclass::PointType;
66  using typename Superclass::BoundingBoxType;
67  using typename Superclass::InterpolatorType;
68 
70 
72  itkNewMacro(Self);
73 
75  itkOverrideGetNameOfClassMacro(ImageMaskSpatialObject);
76 
85  bool
86  IsInsideInObjectSpace(const PointType & point) const override;
87 
92  itkSetMacro(MaskValue, PixelType);
93  itkGetConstReferenceMacro(MaskValue, PixelType);
96  itkBooleanMacro(UseMaskValue);
97  itkSetMacro(UseMaskValue, bool);
98  itkGetConstReferenceMacro(UseMaskValue, bool);
99 
100  /* Avoid hiding the overload that supports depth and name arguments */
101  using Superclass::IsInsideInObjectSpace;
102 
113  RegionType
114  ComputeMyBoundingBoxInIndexSpace() const;
115 
116 #if !defined(ITK_LEGACY_REMOVE)
117 
120  itkLegacyMacro(RegionType GetAxisAlignedBoundingBoxRegion() const);
121 
122 #endif
123 
124 protected:
128  void
129  ComputeMyBoundingBox() override;
130 
132  ~ImageMaskSpatialObject() override = default;
133 
134  typename LightObject::Pointer
135  InternalClone() const override;
136 
137 private:
138  bool m_UseMaskValue{ false };
140 };
141 } // end of namespace itk
142 
143 #ifndef ITK_MANUAL_INSTANTIATION
144 # include "itkImageMaskSpatialObject.hxx"
145 #endif
146 
147 #endif // itkImageMaskSpatialObject_h
itkImageSpatialObject.h
itk::ImageRegion< VDimension >
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::ImageSpatialObject
Implementation of an image as spatial object.
Definition: itkImageSpatialObject.h:40
itk::ImageSliceConstIteratorWithIndex
Multi-dimensional image iterator which only walks a region.
Definition: itkImageSliceConstIteratorWithIndex.h:113
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::NumericTraits::OneValue
static T OneValue()
Definition: itkNumericTraits.h:157
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageSpatialObject< TDimension, TPixel >::PixelType
TPixel PixelType
Definition: itkImageSpatialObject.h:52
itkImageSliceConstIteratorWithIndex.h
itk::ImageMaskSpatialObject
Implementation of an image mask as spatial object.
Definition: itkImageMaskSpatialObject.h:47
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itkNumericTraits.h
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293