ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkReconstructionConjugateGradientOperator.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 rtkReconstructionConjugateGradientOperator_h
20#define rtkReconstructionConjugateGradientOperator_h
21
22#include <itkAddImageFilter.h>
24
26
30
34
35#ifdef RTK_USE_CUDA
38#endif
39
40namespace rtk
41{
42
116
117template <typename TOutputImage, typename TSingleComponentImage = TOutputImage, typename TWeightsImage = TOutputImage>
118class ITK_TEMPLATE_EXPORT ReconstructionConjugateGradientOperator : public ConjugateGradientOperator<TOutputImage>
119{
120public:
121 ITK_DISALLOW_COPY_AND_MOVE(ReconstructionConjugateGradientOperator);
122
129 typename TOutputImage::template RebindImageType<VectorPixelType, TOutputImage::ImageDimension>;
130
132 itkNewMacro(Self);
133
135 void
136 SetInputVolume(const TOutputImage * vol);
137 void
138 SetInputProjectionStack(const TOutputImage * projs);
139 void
140 SetInputWeights(const TWeightsImage * weights);
141
143 itkOverrideGetNameOfClassMacro(ReconstructionConjugateGradientOperator);
144
147
150
154
155 // If TOutputImage is an itk::Image of floats or double, so are the weights, and a simple Multiply filter is required
156 // If TOutputImage is an itk::Image of itk::Vector<float (or double)>, a BlockDiagonalMatrixVectorMultiply filter
157 // is needed. Thus the meta-programming construct
160 using MultiplyWithWeightsFilterType = typename std::conditional_t<std::is_same_v<TSingleComponentImage, TOutputImage>,
163
164 using OutputImagePointer = typename TOutputImage::Pointer;
165
167 void
169
171 void
173
175 void
176 SetSupportMask(const TSingleComponentImage * SupportMask);
177 typename TSingleComponentImage::ConstPointer
179
183 void
184 SetLocalRegularizationWeights(const TSingleComponentImage * localRegularizationWeights);
185 typename TSingleComponentImage::ConstPointer
187
189 itkSetConstObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
190
193 itkSetMacro(Gamma, float);
194 itkGetMacro(Gamma, float);
195 itkSetMacro(Tikhonov, float);
196 itkGetMacro(Tikhonov, float);
197
198protected:
201
203 void
204 VerifyPreconditions() const override;
205
207 void
208 GenerateData() override;
209
210 template <typename ImageType>
211 typename std::enable_if<std::is_same_v<TSingleComponentImage, ImageType>, ImageType>::type::Pointer
213
214 template <typename ImageType>
215 typename std::enable_if<!std::is_same_v<TSingleComponentImage, ImageType>, ImageType>::type::Pointer
217
221
232 typename MultiplyWithWeightsFilterType::Pointer m_MultiplyWithWeightsFilter;
233
236 float m_Gamma{ 0 }; // Strength of the laplacian regularization
237 float m_Tikhonov{ 0 }; // Strength of the Tikhonov regularization
238
240 typename TOutputImage::Pointer m_FloatingInputPointer, m_FloatingOutputPointer;
241
244 void
245 VerifyInputInformation() const override
246 {}
247
249 void
251 void
253
255 typename TOutputImage::ConstPointer
257 typename TOutputImage::ConstPointer
259 typename TWeightsImage::ConstPointer
261};
262} // namespace rtk
263
264
265#ifndef ITK_MANUAL_INSTANTIATION
266# include "rtkReconstructionConjugateGradientOperator.hxx"
267#endif
268
269#endif
Pixel-wise addition of two images.
A templated class holding a n-Dimensional covariant vector.
Pixel-wise multiplication of two images.
Implements transparent reference counting.
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.
TWeightsImage::ConstPointer GetInputWeights()
TOutputImage::ConstPointer GetInputVolume()
TSingleComponentImage::ConstPointer GetLocalRegularizationWeights()
typename std::conditional_t< std::is_same_v< TSingleComponentImage, TOutputImage >, PlainMultiplyFilterType, MatrixVectorMultiplyFilterType > MultiplyWithWeightsFilterType
void SetInputVolume(const TOutputImage *vol)
void SetSupportMask(const TSingleComponentImage *SupportMask)
typename TOutputImage::template RebindImageType< VectorPixelType, TOutputImage::ImageDimension > GradientImageType
void SetInputWeights(const TWeightsImage *weights)
void SetBackProjectionFilter(BackProjectionFilterType *_arg)
TSingleComponentImage::ConstPointer GetSupportMask()
itk::CovariantVector< typename TOutputImage::ValueType, TOutputImage::ImageDimension > VectorPixelType
TOutputImage::ConstPointer GetInputProjectionStack()
rtk::BlockDiagonalMatrixVectorMultiplyImageFilter< TOutputImage, TWeightsImage > MatrixVectorMultiplyFilterType
std::enable_if<!std::is_same_v< TSingleComponentImage, ImageType >, ImageType >::type::Pointer ConnectGradientRegularization()
void SetForwardProjectionFilter(ForwardProjectionFilterType *_arg)
void SetInputProjectionStack(const TOutputImage *projs)
std::enable_if< std::is_same_v< TSingleComponentImage, ImageType >, ImageType >::type::Pointer ConnectGradientRegularization()
~ReconstructionConjugateGradientOperator() override=default
void SetLocalRegularizationWeights(const TSingleComponentImage *localRegularizationWeights)
Projection geometry for a source and a 2-D flat panel.
#define itkSetMacro(name, type)