RTK  2.6.0
Reconstruction Toolkit
rtkSubSelectImageFilter.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 #ifndef rtkSubSelectImageFilter_h
19 #define rtkSubSelectImageFilter_h
20 
21 #include <itkPasteImageFilter.h>
22 #include <itkExtractImageFilter.h>
23 #include "rtkConstantImageSource.h"
25 
26 namespace rtk
27 {
28 
63 template <typename ProjectionStackType>
64 class ITK_TEMPLATE_EXPORT SubSelectImageFilter
65  : public itk::ImageToImageFilter<ProjectionStackType, ProjectionStackType>
66 {
67 public:
68  ITK_DISALLOW_COPY_AND_MOVE(SubSelectImageFilter);
69 
74 
76  itkOverrideGetNameOfClassMacro(SubSelectImageFilter);
77 
79  void
80  SetInputProjectionStack(const ProjectionStackType * Projections);
81  typename ProjectionStackType::ConstPointer
82  GetInputProjectionStack();
84 
89 
90  itkSetObjectMacro(InputGeometry, GeometryType);
91  itkGetModifiableObjectMacro(InputGeometry, GeometryType);
92 
93  itkGetMacro(SelectedProjections, std::vector<bool>);
94 
96  GetOutputGeometry();
97 
98 protected:
100  ~SubSelectImageFilter() override = default;
101 
103  void
104  VerifyPreconditions() const override;
105 
106  void
107  GenerateInputRequestedRegion() override;
108 
109  void
110  GenerateOutputInformation() override;
111 
113  void
114  GenerateData() override;
115 
119  std::vector<bool> m_SelectedProjections;
121 
122 private:
126 };
127 } // namespace rtk
128 
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 # include "rtkSubSelectImageFilter.hxx"
132 #endif
133 
134 #endif
GeometryType::Pointer m_InputGeometry
ExtractFilterType::Pointer m_ExtractFilter
Generate an n-dimensional image with constant pixel values.
Subselects projections from a stack of projections.
std::vector< bool > m_SelectedProjections
PasteFilterType::Pointer m_PasteFilter
Projection geometry for a source and a 2-D flat panel.
GeometryType::Pointer m_OutputGeometry
EmptyProjectionStackSourceType::Pointer m_EmptyProjectionStackSource