RTK  1.4.0
Reconstruction Toolkit
rtkMechlemOneStepSpectralReconstructionFilter.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 rtkMechlemOneStepSpectralReconstructionFilter_h
20 #define rtkMechlemOneStepSpectralReconstructionFilter_h
21 
26 #include "rtkConstantImageSource.h"
30 
31 #include <itkExtractImageFilter.h>
32 #include <itkAddImageFilter.h>
33 
34 #ifdef RTK_USE_CUDA
36 #endif
37 
38 namespace rtk
39 {
119 template< typename TOutputImage, typename TPhotonCounts, typename TSpectrum >
121 {
122 public:
127 
129  itkNewMacro(Self)
130 
131 
133 
135  itkStaticConstMacro(nBins, unsigned int, TPhotonCounts::PixelType::Dimension);
136  itkStaticConstMacro(nMaterials, unsigned int, TOutputImage::PixelType::Dimension);
137  typedef typename TOutputImage::PixelType::ValueType dataType;
139 
140 #ifdef RTK_USE_CUDA
141  typedef itk::CudaImage< itk::Vector<dataType, nMaterials * nMaterials>, TOutputImage::ImageDimension > THessiansImage;
142  typedef itk::CudaImage<dataType, TOutputImage::ImageDimension> TSingleComponentImage;
143 #else
146 #endif
147 
148  typedef TOutputImage TGradientsImage;
149 
152 
166 #ifdef RTK_USE_CUDA
167  typedef rtk::CudaWeidingerForwardModelImageFilter<TOutputImage, TPhotonCounts, TSpectrum> WeidingerForwardModelType;
168 #else
170 #endif
173 
175  void SetForwardProjectionFilter (ForwardProjectionType _arg) ITK_OVERRIDE;
176 
178  void SetBackProjectionFilter (BackProjectionType _arg) ITK_OVERRIDE;
179 
181  itkSetConstObjectMacro(Geometry, ThreeDCircularProjectionGeometry)
182 
183  itkSetMacro(NumberOfIterations, int)
184  itkGetMacro(NumberOfIterations, int)
185  itkSetMacro(NumberOfSubsets, int)
186  itkGetMacro(NumberOfSubsets, int)
187 
189  void SetInputMaterialVolumes(const TOutputImage* materialVolumes);
190  void SetInputPhotonCounts(const TPhotonCounts* photonCounts);
191  void SetInputSpectrum(const TSpectrum* spectrum);
193 
195  itkSetMacro(RegularizationWeights, typename TOutputImage::PixelType)
196  itkGetMacro(RegularizationWeights, typename TOutputImage::PixelType)
197 
199  itkSetMacro(RegularizationRadius, typename TOutputImage::RegionType::SizeType)
200  itkGetMacro(RegularizationRadius, typename TOutputImage::RegionType::SizeType)
201 
202 // itkSetMacro(IterationCosts, bool)
203 // itkGetMacro(IterationCosts, bool)
204 
207  typedef vnl_matrix<dataType> BinnedDetectorResponseType;
208  typedef vnl_matrix<dataType> MaterialAttenuationsType;
209  virtual void SetBinnedDetectorResponse(const BinnedDetectorResponseType & detResp);
210  virtual void SetMaterialAttenuations(const MaterialAttenuationsType & matAtt);
212 
213 protected:
214  MechlemOneStepSpectralReconstructionFilter();
215  virtual ~MechlemOneStepSpectralReconstructionFilter() ITK_OVERRIDE {}
216 
218  void GenerateData() ITK_OVERRIDE;
219 
221  typename ExtractPhotonCountsFilterType::Pointer m_ExtractPhotonCountsFilter;
237 
241  void VerifyInputInformation() ITK_OVERRIDE {}
242 
245  void GenerateInputRequestedRegion() ITK_OVERRIDE;
246  void GenerateOutputInformation() ITK_OVERRIDE;
248 
250  typename TOutputImage::ConstPointer GetInputMaterialVolumes();
251  typename TPhotonCounts::ConstPointer GetInputPhotonCounts();
252  typename TSpectrum::ConstPointer GetInputSpectrum();
254 
260 
262 
268 
269  typename TOutputImage::PixelType m_RegularizationWeights;
270  typename TOutputImage::RegionType::SizeType m_RegularizationRadius;
271 
272 private:
273  MechlemOneStepSpectralReconstructionFilter(const Self &); //purposely not implemented
274  void operator=(const Self &); //purposely not implemented
275 
276 // bool m_IterationCosts;
277 };
278 } //namespace ITK
279 
280 
281 #ifndef ITK_MANUAL_INSTANTIATION
282 #include "rtkMechlemOneStepSpectralReconstructionFilter.hxx"
283 #endif
284 
285 #endif
rtk::SeparableQuadraticSurrogateRegularizationImageFilter< TGradientsImage > SQSRegularizationType
typename Superclass::PixelType PixelType
itk::Image< dataType, TOutputImage::ImageDimension > TSingleComponentImage
void SetInputPhotonCounts(const TPhotonCounts *photonCounts)
Base class for forward projection, i.e. accumulation along x-ray lines.
SingleComponentForwardProjectionFilterType::Pointer InstantiateSingleComponentForwardProjectionFilter(int fwtype)
HessiansBackProjectionFilterType::Pointer InstantiateHessiansBackProjectionFilter(int bptype)
Applies Nesterov&#39;s momentum technique.
Generate an n-dimensional image with constant pixel values.
typename FixedImageType::SizeType SizeType
rtk::ForwardProjectionImageFilter< TOutputImage, TOutputImage > ForwardProjectionFilterType
void SetBackProjectionFilter(BackProjectionType _arg) override
rtk::ForwardProjectionImageFilter< TSingleComponentImage, TSingleComponentImage > SingleComponentForwardProjectionFilterType
virtual void SetMaterialAttenuations(const MaterialAttenuationsType &matAtt)
Projection geometry for a source and a 2-D flat panel.
Computes update from gradient and Hessian in Newton&#39;s method.
void SetInputMaterialVolumes(const TOutputImage *materialVolumes)
rtk::BackProjectionImageFilter< THessiansImage, THessiansImage > HessiansBackProjectionFilterType
itk::ExtractImageFilter< TPhotonCounts, TPhotonCounts > ExtractPhotonCountsFilterType
void SetInputSpectrum(const TSpectrum *spectrum)
Performs intermediate computations in Weidinger2016.
rtk::ConstantImageSource< TSingleComponentImage > SingleComponentImageSourceType
rtk::AddMatrixAndDiagonalImageFilter< TGradientsImage, THessiansImage > AddMatrixAndDiagonalFilterType
For each vector-valued pixel, adds a vector to the diagonal of a matrix.
For one-step inversion of spectral CT data by the method Mechlem2017, computes regularization term&#39;s ...
Mother class for cone beam reconstruction filters which need runtime selection of their forward and b...
virtual void SetBinnedDetectorResponse(const BinnedDetectorResponseType &detResp)
rtk::BackProjectionImageFilter< TGradientsImage, TGradientsImage > GradientsBackProjectionFilterType
Implements the one-step spectral CT inversion method described by Mechlem et al.
rtk::GetNewtonUpdateImageFilter< TGradientsImage, THessiansImage > NewtonFilterType
SingleComponentForwardProjectionFilterType::Pointer m_SingleComponentForwardProjectionFilter
TPhotonCounts::ConstPointer GetInputPhotonCounts()
TOutputImage::ConstPointer GetInputMaterialVolumes()
void SetForwardProjectionFilter(ForwardProjectionType _arg) override
itk::Image< itk::Vector< dataType, nMaterials *nMaterials >, TOutputImage::ImageDimension > THessiansImage
#define itkSetMacro(name, type)
rtk::WeidingerForwardModelImageFilter< TOutputImage, TPhotonCounts, TSpectrum > WeidingerForwardModelType
IterativeConeBeamReconstructionFilter< TOutputImage, TOutputImage > Superclass