ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkConjugateGradientConeBeamReconstructionFilter.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 rtkConjugateGradientConeBeamReconstructionFilter_h
20#define rtkConjugateGradientConeBeamReconstructionFilter_h
21
22#include <itkCommand.h>
26#include <itkObject.h>
27#include <itkProcessObject.h>
28
37
38#ifdef RTK_USE_CUDA
42#endif
43
44namespace rtk
45{
108
109template <typename TOutputImage, typename TSingleComponentImage = TOutputImage, typename TWeightsImage = TOutputImage>
111 : public IterativeConeBeamReconstructionFilter<TOutputImage>
112{
113public:
114 ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradientConeBeamReconstructionFilter);
115
120
122 itkNewMacro(Self);
123
125 itkOverrideGetNameOfClassMacro(ConjugateGradientConeBeamReconstructionFilter);
126
128 void
129 SetInputVolume(const TOutputImage * vol);
130 void
131 SetInputProjectionStack(const TOutputImage * projs);
132 void
133 SetInputWeights(const TWeightsImage * weights);
134 void
135 SetLocalRegularizationWeights(const TSingleComponentImage * weights);
136
147 using OutputImagePointer = typename TOutputImage::Pointer;
149
152
153 // If TOutputImage is an itk::Image of floats or double, so are the weights, and a simple Multiply filter is required
154 // If TOutputImage is an itk::Image of itk::Vector<float (or double)>, a BlockDiagonalMatrixVectorMultiply filter
155 // is needed. Thus the meta-programming construct
158 using MultiplyWithWeightsFilterType = typename std::conditional_t<std::is_same_v<TSingleComponentImage, TOutputImage>,
162#ifdef RTK_USE_CUDA
163 using DisplacedDetectorFilterType = typename std::conditional_t<!std::is_same_v<TOutputImage, CPUOutputImageType> &&
164 std::is_same_v<TSingleComponentImage, TOutputImage>,
165 CudaDisplacedDetectorImageFilter,
167 using ConstantImageSourceType = typename std::conditional_t<!std::is_same_v<TOutputImage, CPUOutputImageType> &&
168 std::is_same_v<TSingleComponentImage, TOutputImage>,
169 CudaConstantVolumeSource,
171 using ConstantWeightSourceType = typename std::conditional_t<!std::is_same_v<TOutputImage, CPUOutputImageType> &&
172 std::is_same_v<TSingleComponentImage, TOutputImage>,
173 CudaConstantVolumeSource,
175#else
179#endif
180
182 void
183 SetSupportMask(const TSingleComponentImage * SupportMask);
184 typename TSingleComponentImage::ConstPointer
186
188 itkSetConstObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
189
190 itkSetMacro(NumberOfIterations, int);
191 itkGetMacro(NumberOfIterations, int);
192
194 itkSetMacro(DisableDisplacedDetectorFilter, bool);
195 itkGetMacro(DisableDisplacedDetectorFilter, bool);
196
199 itkSetMacro(Tikhonov, float);
200 itkGetMacro(Tikhonov, float);
201
205 itkSetMacro(Gamma, float);
206 itkGetMacro(Gamma, float);
207
209 itkGetMacro(CudaConjugateGradient, bool);
210 itkSetMacro(CudaConjugateGradient, bool);
211
212protected:
215
217 void
218 VerifyPreconditions() const override;
219
221 void
222 GenerateData() override;
223
235 typename MultiplyWithWeightsFilterType::Pointer m_MultiplyWithWeightsFilter;
236
240 void
241 VerifyInputInformation() const override
242 {}
243
246 void
248 void
250
252 typename TOutputImage::ConstPointer
254 typename TOutputImage::ConstPointer
256 typename TWeightsImage::ConstPointer
258 typename TSingleComponentImage::ConstPointer
260
261 template <typename ImageType,
263 ImageType> * = nullptr>
266
267 template <typename ImageType,
269 ImageType> * = nullptr>
272
274 void
276
277private:
279
281 float m_Gamma;
285
286 // Iteration reporting
288};
289} // namespace rtk
290
291
292#ifndef ITK_MANUAL_INSTANTIATION
293# include "rtkConjugateGradientConeBeamReconstructionFilter.hxx"
294#endif
295
296#endif
Abstraction of the Events used to communicating among filters and with GUIs.
Templated n-dimensional image class.
Definition itkImage.h:89
Implements iterations tracking for a filter.
Pixel-wise multiplication of two images.
Base class for most ITK classes.
Definition itkObject.h:62
Implements transparent reference counting.
Compute min, max, variance and mean of an Image.
BackProjectionImageFilter< TOutputImage, TOutputImage > BackProjectionFilterType
ReconstructionConjugateGradientOperator< TOutputImage, TSingleComponentImage, TWeightsImage > CGOperatorFilterType
TSingleComponentImage::ConstPointer GetLocalRegularizationWeights()
typename itk::Image< typename TOutputImage::PixelType, TOutputImage::ImageDimension > CPUOutputImageType
void SetLocalRegularizationWeights(const TSingleComponentImage *weights)
itk::MultiplyImageFilter< TOutputImage, TSingleComponentImage, TOutputImage > MultiplyFilterType
ForwardProjectionImageFilter< TOutputImage, TOutputImage > ForwardProjectionFilterType
TWeightsImage::ConstPointer GetInputWeights()
void SetInputWeights(const TWeightsImage *weights)
void SetInputProjectionStack(const TOutputImage *projs)
void SetSupportMask(const TSingleComponentImage *SupportMask)
void ReportProgress(itk::Object *, const itk::EventObject &)
void SetInputVolume(const TOutputImage *vol)
BlockDiagonalMatrixVectorMultiplyImageFilter< TOutputImage, TWeightsImage > MatrixVectorMultiplyFilterType
ConjugateGradientFilterPointer InstantiateCudaConjugateGradientImageFilter()
typename std::conditional_t< std::is_same_v< TSingleComponentImage, TOutputImage >, PlainMultiplyFilterType, MatrixVectorMultiplyFilterType > MultiplyWithWeightsFilterType
itk::MultiplyImageFilter< TOutputImage, TOutputImage, TOutputImage > PlainMultiplyFilterType
TOutputImage::ConstPointer GetInputProjectionStack()
TSingleComponentImage::ConstPointer GetSupportMask()
Solves AX = B by conjugate gradient.
Generate an n-dimensional image with constant pixel values.
itk::SmartPointer< Self > Pointer
Base class for forward projection, i.e. accumulation along x-ray lines.
std::enable_if_t<!std::is_same_v< CPUImageType, ImageType > && std::is_same_v< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float > &&(itk::PixelTraits< typename ImageType::PixelType >::Dimension==1|| itk::PixelTraits< typename ImageType::PixelType >::Dimension==2|| itk::PixelTraits< typename ImageType::PixelType >::Dimension==3)> EnableCudaScalarAndVectorType
enum { FP_JOSEPH=0, FP_CUDARAYCAST=2, FP_JOSEPHATTENUATED=3, FP_ZENG=4, FP_CUDAWARP=5, FP_CUDAZENG=6 } ForwardProjectionType
enum { BP_VOXELBASED=0, BP_JOSEPH=1, BP_CUDAVOXELBASED=2, BP_CUDARAYCAST=4, BP_JOSEPHATTENUATED=5, BP_ZENG=6, BP_CUDAWARP=7, BP_CUDAZENG=8 } BackProjectionType
std::enable_if_t< std::is_same_v< CPUImageType, ImageType >|| !std::is_same_v< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float >||(itk::PixelTraits< typename ImageType::PixelType >::Dimension !=1 && itk::PixelTraits< typename ImageType::PixelType >::Dimension !=2 && itk::PixelTraits< typename ImageType::PixelType >::Dimension !=3)> DisableCudaScalarAndVectorType
Implements the operator A used in conjugate gradient reconstruction.
Projection geometry for a source and a 2-D flat panel.
#define itkSetMacro(name, type)