RTK  1.4.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  * 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 #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 SubSelectImageFilter : public itk::ImageToImageFilter<ProjectionStackType, ProjectionStackType>
65 {
66 public:
71 
74 
75 
76  void SetInputProjectionStack(const ProjectionStackType* Projections);
77  typename ProjectionStackType::ConstPointer GetInputProjectionStack();
79 
80  typedef itk::PasteImageFilter<ProjectionStackType> PasteFilterType;
81  typedef itk::ExtractImageFilter<ProjectionStackType, ProjectionStackType> ExtractFilterType;
84 
85  itkSetObjectMacro(InputGeometry, GeometryType)
86  itkGetModifiableObjectMacro(InputGeometry, GeometryType)
87 
88  itkGetMacro(SelectedProjections, std::vector<bool>)
89 
90  GeometryType::Pointer GetOutputGeometry();
91 
92 protected:
94  virtual ~SubSelectImageFilter() ITK_OVERRIDE {}
95 
96  void GenerateInputRequestedRegion() ITK_OVERRIDE;
97 
98  void GenerateOutputInformation() ITK_OVERRIDE;
99 
101  void GenerateData() ITK_OVERRIDE;
102 
106  std::vector<bool> m_SelectedProjections;
108 
109 private:
110  SubSelectImageFilter(const Self &); // purposely not implemented
111  void operator=(const Self &); // purposely not implemented
112 
114  typename ExtractFilterType::Pointer m_ExtractFilter;
116 };
117 } //namespace ITK
118 
119 
120 #ifndef ITK_MANUAL_INSTANTIATION
121 #include "rtkSubSelectImageFilter.hxx"
122 #endif
123 
124 #endif
ProjectionStackType::ConstPointer GetInputProjectionStack()
GeometryType::Pointer m_InputGeometry
ExtractFilterType::Pointer m_ExtractFilter
Generate an n-dimensional image with constant pixel values.
Subselects projections from a stack of projections.
STL namespace.
void GenerateInputRequestedRegion() override
std::vector< bool > m_SelectedProjections
PasteFilterType::Pointer m_PasteFilter
Projection geometry for a source and a 2-D flat panel.
GeometryType::Pointer m_OutputGeometry
void GenerateData() override
itk::ImageToImageFilter< ProjectionStackType, ProjectionStackType > Superclass
EmptyProjectionStackSourceType::Pointer m_EmptyProjectionStackSource
GeometryType::Pointer GetOutputGeometry()
itk::SmartPointer< Self > Pointer
void SetInputProjectionStack(const ProjectionStackType *Projections)
void GenerateOutputInformation() override
void operator=(const Self &)