RTK  1.4.0
Reconstruction Toolkit
rtkFieldOfViewImageFilter.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 rtkFieldOfViewImageFilter_h
20 #define rtkFieldOfViewImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
23 
25 #include "rtkConfiguration.h"
26 
27 struct _lprec;
28 
29 namespace rtk
30 {
31 
47 template <class TInputImage, class TOutputImage>
48 class ITK_EXPORT FieldOfViewImageFilter:
49  public itk::InPlaceImageFilter<TInputImage,TOutputImage>
50 {
51 public:
57 
58  typedef typename TOutputImage::RegionType OutputImageRegionType;
59  typedef typename TInputImage::Superclass ProjectionsStackType;
60  typedef typename ProjectionsStackType::Pointer ProjectionsStackPointer;
63  typedef enum {RADIUSINF,RADIUSSUP,RADIUSBOTH} FOVRadiusType;
64 
65 
67  itkNewMacro(Self);
68 
71 
73  itkGetConstObjectMacro(Geometry, GeometryType);
74  itkSetConstObjectMacro(Geometry, GeometryType);
76 
80  itkGetMacro(Mask, bool);
81  itkSetMacro(Mask, bool);
83 
87  itkGetMacro(ProjectionsStack, ProjectionsStackPointer);
88  itkSetObjectMacro(ProjectionsStack, ProjectionsStackType);
90 
93  itkGetMacro(DisplacedDetector, bool);
94  itkSetMacro(DisplacedDetector, bool);
96 
107  virtual bool ComputeFOVRadius(const FOVRadiusType type, double &x, double &z, double &r);
108 
112  void AddCollimationConstraints(const FOVRadiusType type, _lprec *lp);
113 
114 protected:
116  virtual ~FieldOfViewImageFilter() ITK_OVERRIDE {}
117 
118  void BeforeThreadedGenerateData() ITK_OVERRIDE;
119 
122 #if ITK_VERSION_MAJOR<5
123  void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread, ThreadIdType threadId ) ITK_OVERRIDE;
124 #else
125  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
126 #endif
127 
128 
129 private:
130  FieldOfViewImageFilter(const Self&); //purposely not implemented
131  void operator=(const Self&); //purposely not implemented
132 
133  GeometryConstPointer m_Geometry;
134  bool m_Mask;
135  ProjectionsStackPointer m_ProjectionsStack;
136  double m_Radius;
137  double m_CenterX;
138  double m_CenterZ;
144 };
145 
146 } // end namespace rtk
147 
148 #ifndef ITK_MANUAL_INSTANTIATION
149 #include "rtkFieldOfViewImageFilter.hxx"
150 #endif
151 
152 #endif
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
itk::SmartPointer< Self > Pointer
ProjectionsStackType::Pointer ProjectionsStackPointer
TInputImage::Superclass ProjectionsStackType
Projection geometry for a source and a 2-D flat panel.
rtk::ThreeDCircularProjectionGeometry GeometryType
GeometryType::ConstPointer GeometryConstPointer
Computes the field of view mask for circular 3D geometry.
unsigned int ThreadIdType
TOutputImage::RegionType OutputImageRegionType
ProjectionsStackPointer m_ProjectionsStack
#define itkSetMacro(name, type)
itk::SmartPointer< const Self > ConstPointer