ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkMeshSpatialObject.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 itkMeshSpatialObject_h
19#define itkMeshSpatialObject_h
20
21#include "itkMesh.h"
22#include "itkSpatialObject.h"
23
24namespace itk
25{
36
37template <typename TMesh = Mesh<int>>
38class ITK_TEMPLATE_EXPORT MeshSpatialObject : public SpatialObject<TMesh::PointDimension>
39{
40public:
41 using ScalarType = double;
43
44 static constexpr unsigned int Dimension = TMesh::PointDimension;
45
49
50 using MeshType = TMesh;
51 using MeshPointer = typename MeshType::Pointer;
52 using typename Superclass::TransformType;
53 using typename Superclass::PointType;
54 using typename Superclass::BoundingBoxType;
55
58
60 itkNewMacro(Self);
61
63 itkOverrideGetNameOfClassMacro(MeshSpatialObject);
64
67 void
68 Clear() override;
69
71 void
73
75 MeshType *
77 const MeshType *
78 GetMesh() const;
80
88 bool
89 IsInsideInObjectSpace(const PointType & point) const override;
90
91 /* Avoid hiding the overload that supports depth and name arguments */
93
96 GetMTime() const override;
97
98#if !defined(ITK_LEGACY_REMOVE)
100 itkLegacyMacro(const char * GetPixelTypeName())
101 {
102 return m_PixelType.c_str();
103 }
104#endif
105
112 itkSetMacro(IsInsidePrecisionInObjectSpace, double);
113 itkGetConstMacro(IsInsidePrecisionInObjectSpace, double);
115
116protected:
118 void
120
122 ~MeshSpatialObject() override = default;
123
124 void
125 PrintSelf(std::ostream & os, Indent indent) const override;
126
127 typename LightObject::Pointer
128 InternalClone() const override;
129
130private:
132#if !defined(ITK_LEGACY_REMOVE)
133 std::string m_PixelType{};
134#endif
136};
137
138} // end namespace itk
139
140#ifndef ITK_MANUAL_INSTANTIATION
141# include "itkMeshSpatialObject.hxx"
142#endif
143
144#endif // itkMeshSpatialObject_h
Control indentation during Print() invocation.
Definition itkIndent.h:50
SmartPointer< Self > Pointer
void ComputeMyBoundingBox() override
typename MeshType::Pointer MeshPointer
SpatialObject< Self::Dimension > Superclass
typename PointContainerType::Pointer PointContainerPointer
LightObject::Pointer InternalClone() const override
void PrintSelf(std::ostream &os, Indent indent) const override
bool IsInsideInObjectSpace(const PointType &point) const override
SmartPointer< const Self > ConstPointer
void SetMesh(MeshType *mesh)
static constexpr unsigned int Dimension
const MeshType * GetMesh() const
~MeshSpatialObject() override=default
void Clear() override
Point< ScalarType, VDimension > PointType
MeshSpatialObject< TMesh > Self
VectorContainer< PointType > PointContainerType
ModifiedTimeType GetMTime() const override
Implements transparent reference counting.
BoundingBox< IdentifierType, VDimension, ScalarType, VectorContainerType > BoundingBoxType
SpatialObject()=default
bool IsInsideInObjectSpace(const PointType &point, unsigned int depth, const std::string &name="") const
Point< ScalarType, VDimension > PointType
AffineTransform< ScalarType, VDimension > TransformType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter 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
detail::VectorContainer< std::conditional_t< std::is_void_v< T2 >, SizeValueType, T1 >, std::conditional_t< std::is_void_v< T2 >, T1, T2 > > VectorContainer
SizeValueType ModifiedTimeType