ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkBoxShape.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright RTK 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 * 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
19#ifndef rtkBoxShape_h
20#define rtkBoxShape_h
21
22#include "RTKExport.h"
23#include "rtkConvexShape.h"
24#include "rtkMacro.h"
25
26#include <itkImageBase.h>
27
28namespace rtk
29{
30
44class RTK_EXPORT BoxShape : public ConvexShape
45{
46public:
48 using Self = BoxShape;
52
54 static constexpr unsigned int Dimension = Superclass::Dimension;
60
62 itkNewMacro(Self);
63
65 itkOverrideGetNameOfClassMacro(BoxShape);
66
68 bool
69 IsInside(const PointType & point) const override;
70
74 bool
75 IsIntersectedByRay(const PointType & rayOrigin,
76 const VectorType & rayDirection,
77 ScalarType & infDist,
78 ScalarType & supDist) const override;
79
81 void
82 Rescale(const VectorType & r) override;
83
85 void
86 Translate(const VectorType & t) override;
87
89 void
90 Rotate(const RotationMatrixType & r) override;
91
94 itkGetConstMacro(BoxMin, PointType);
96
99 itkGetConstMacro(BoxMax, PointType);
101
104 itkGetConstMacro(Direction, RotationMatrixType);
106
108 InternalClone() const override;
109
113 void
114 SetBoxFromImage(const ImageBaseType * img, bool bWithExternalHalfPixelBorder = true);
115
116private:
118
122};
123
124} // end namespace rtk
125
126#endif
Base class for templated image classes.
SmartPointer< Self > Pointer
Implements transparent reference counting.
void SetBoxFromImage(const ImageBaseType *img, bool bWithExternalHalfPixelBorder=true)
Superclass::ScalarType ScalarType
Definition rtkBoxShape.h:55
Superclass::VectorType VectorType
Definition rtkBoxShape.h:57
itk::SmartPointer< const Self > ConstPointer
Definition rtkBoxShape.h:51
PointType m_BoxMin
BoxShape Self
Definition rtkBoxShape.h:48
itk::ImageBase< Dimension > ImageBaseType
Definition rtkBoxShape.h:59
itk::SmartPointer< Self > Pointer
Definition rtkBoxShape.h:50
ConvexShape Superclass
Definition rtkBoxShape.h:49
static constexpr unsigned int Dimension
Definition rtkBoxShape.h:54
itk::LightObject::Pointer InternalClone() const override
bool IsIntersectedByRay(const PointType &rayOrigin, const VectorType &rayDirection, ScalarType &infDist, ScalarType &supDist) const override
void Rescale(const VectorType &r) override
bool IsInside(const PointType &point) const override
PointType m_BoxMax
void Translate(const VectorType &t) override
Superclass::RotationMatrixType RotationMatrixType
Definition rtkBoxShape.h:58
void Rotate(const RotationMatrixType &r) override
Superclass::PointType PointType
Definition rtkBoxShape.h:56
RotationMatrixType m_Direction
itk::Point< ScalarType, Dimension > PointType
static constexpr unsigned int Dimension
itk::Vector< ScalarType, Dimension > VectorType
itk::Matrix< ScalarType, Dimension, Dimension > RotationMatrixType
#define itkSetMacro(name, type)