RTK  2.5.0
Reconstruction Toolkit
rtkDrawEllipsoidImageFilter.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 rtkDrawEllipsoidImageFilter_h
20 #define rtkDrawEllipsoidImageFilter_h
21 
23 #include "rtkConfiguration.h"
24 
25 namespace rtk
26 {
27 
37 template <class TInputImage, class TOutputImage>
38 class ITK_TEMPLATE_EXPORT DrawEllipsoidImageFilter : public DrawConvexImageFilter<TInputImage, TOutputImage>
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_MOVE(DrawEllipsoidImageFilter);
42 
48 
53 
55  itkNewMacro(Self);
56 
58 #ifdef itkOverrideGetNameOfClassMacro
59  itkOverrideGetNameOfClassMacro(DrawEllipsoidImageFilter);
60 #else
62 #endif
63 
64 
66  itkGetMacro(Density, ScalarType);
67  itkSetMacro(Density, ScalarType);
69 
71  itkGetConstReferenceMacro(PlaneDirections, std::vector<VectorType>);
72  itkGetConstReferenceMacro(PlanePositions, std::vector<ScalarType>);
74 
76  void
77  AddClipPlane(const VectorType & dir, const ScalarType & pos);
78 
80  itkGetMacro(Center, PointType);
81  itkSetMacro(Center, PointType);
83 
85  itkGetMacro(Axis, VectorType);
86  itkSetMacro(Axis, VectorType);
88 
90  itkGetMacro(Angle, ScalarType);
91  itkSetMacro(Angle, ScalarType);
93 
94 protected:
96  ~DrawEllipsoidImageFilter() override = default;
97 
98  void
99  BeforeThreadedGenerateData() override;
100 
101 private:
102  ScalarType m_Density{ 1. };
103  std::vector<VectorType> m_PlaneDirections;
104  std::vector<ScalarType> m_PlanePositions;
105 
108  ScalarType m_Angle{ 0. };
109 };
110 
111 } // end namespace rtk
112 
113 #ifndef ITK_MANUAL_INSTANTIATION
114 # include "rtkDrawEllipsoidImageFilter.hxx"
115 #endif
116 
117 #endif
std::vector< VectorType > m_PlaneDirections
itk::Vector< ScalarType, Dimension > VectorType
Draws an ellipsoid in a 3D image.
#define itkSetMacro(name, type)
Draws a rtk::ConvexShape in a 3D image.
std::vector< ScalarType > m_PlanePositions
itk::Vector< ScalarType, Dimension > PointType