RTK  2.1.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  * http://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 DrawEllipsoidImageFilter : public DrawConvexImageFilter<TInputImage, TOutputImage>
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_ASSIGN(DrawEllipsoidImageFilter);
42 
48 
53 
55  itkNewMacro(Self);
56 
59 
61  itkGetMacro(Density, ScalarType);
62  itkSetMacro(Density, ScalarType);
64 
66  itkGetConstReferenceMacro(PlaneDirections, std::vector<VectorType>);
67  itkGetConstReferenceMacro(PlanePositions, std::vector<ScalarType>);
69 
71  void
72  AddClipPlane(const VectorType & dir, const ScalarType & pos);
73 
75  itkGetMacro(Center, PointType);
76  itkSetMacro(Center, PointType);
78 
80  itkGetMacro(Axis, VectorType);
81  itkSetMacro(Axis, VectorType);
83 
85  itkGetMacro(Angle, ScalarType);
86  itkSetMacro(Angle, ScalarType);
88 
89 protected:
91  ~DrawEllipsoidImageFilter() override = default;
92 
93  void
94  BeforeThreadedGenerateData() override;
95 
96 private:
98  std::vector<VectorType> m_PlaneDirections;
99  std::vector<ScalarType> m_PlanePositions;
100 
104 };
105 
106 } // end namespace rtk
107 
108 #ifndef ITK_MANUAL_INSTANTIATION
109 # include "rtkDrawEllipsoidImageFilter.hxx"
110 #endif
111 
112 #endif
std::vector< VectorType > m_PlaneDirections
itk::Vector< ScalarType, Dimension > VectorType
void BeforeThreadedGenerateData() override
Draws an ellipsoid in a 3D image.
#define itkSetMacro(name, type)
~DrawEllipsoidImageFilter() override=default
void AddClipPlane(const VectorType &dir, const ScalarType &pos)
Draws a rtk::ConvexShape in a 3D image.
std::vector< ScalarType > m_PlanePositions
itk::Vector< ScalarType, Dimension > PointType