19#ifndef rtkMechlemOneStepSpectralReconstructionFilter_h
20#define rtkMechlemOneStepSpectralReconstructionFilter_h
42# include <itkCudaImageFromImageFilter.h>
157template <
typename TOutputImage,
typename TMeasuredProjections,
typename TInc
identSpectrum>
176 static constexpr unsigned int nBins = TMeasuredProjections::PixelType::Dimension;
177 static constexpr unsigned int nMaterials = TOutputImage::PixelType::Dimension;
178 using dataType =
typename TOutputImage::PixelType::ValueType;
186 typename TOutputImage::template RebindImageType<itk::Vector<dataType, nMaterials * nMaterials>,
187 TOutputImage::ImageDimension>;
189 typename TOutputImage::template RebindImageType<dataType, TOutputImage::ImageDimension>;
191#ifndef ITK_FUTURE_LEGACY_REMOVE
194 using IncidentSpectrumPixelType =
typename TIncidentSpectrum::PixelType;
196 using VectorSpectrumImageType =
itk::VectorImage<IncidentSpectrumPixelType, TIncidentSpectrum::ImageDimension - 1>;
197 using FlattenVectorSpectrumFilterType =
204 using CastIncidentSpectrumFilterType =
205 std::conditional_t<std::is_same_v<TIncidentSpectrum, CPUIncidentSpectrumType>,
207 itk::CudaImageFromImageFilter<CPUIncidentSpectrumType>>;
213#if !defined(ITK_WRAPPING_PARSER)
216 std::is_same_v<TOutputImage, CPUOutputImageType>,
218 CudaWeidingerForwardModelImageFilter<TOutputImage, TMeasuredProjections, TIncidentSpectrum>>;
220 typename std::conditional_t<std::is_same_v<TOutputImage, CPUOutputImageType>,
222 CudaForwardProjectionImageFilter<SingleComponentImageType, SingleComponentImageType>>;
224 typename std::conditional_t<std::is_same_v<TOutputImage, CPUOutputImageType>,
226 CudaBackProjectionImageFilter<HessiansImageType>>;
240#if !defined(ITK_WRAPPING_PARSER)
269 itkGetMacro(NumberOfIterations,
int);
273 itkGetMacro(NumberOfSubsets,
int);
279 itkGetMacro(ResetNesterovEvery,
int);
292#ifndef ITK_FUTURE_LEGACY_REMOVE
296 SetInputPhotonCounts(
const TMeasuredProjections * measuredProjections);
298 SetInputSpectrum(
const TIncidentSpectrum * incidentSpectrum);
308 itkSetMacro(RegularizationWeights,
typename TOutputImage::PixelType);
309 itkGetMacro(RegularizationWeights,
typename TOutputImage::PixelType);
312 itkSetMacro(RegularizationRadius,
typename TOutputImage::RegionType::SizeType);
313 itkGetMacro(RegularizationRadius,
typename TOutputImage::RegionType::SizeType);
336#if !defined(ITK_WRAPPING_PARSER)
362# ifndef ITK_FUTURE_LEGACY_REMOVE
363 typename FlattenVectorSpectrumFilterType::Pointer m_FlattenVectorSpectrumFilter;
364 typename PermuteSpectrumFilterType::Pointer m_PermuteSpectrumFilter;
365 typename CastIncidentSpectrumFilterType::Pointer m_CastIncidentSpectrumFilter;
384 typename TOutputImage::ConstPointer
386 typename TMeasuredProjections::ConstPointer
388 typename TIncidentSpectrum::ConstPointer
390#ifndef ITK_FUTURE_LEGACY_REMOVE
391 typename TMeasuredProjections::ConstPointer
392 GetInputPhotonCounts();
393 typename TIncidentSpectrum::ConstPointer
396 typename SingleComponentImageType::ConstPointer
398 typename SingleComponentImageType::ConstPointer
400 typename SingleComponentImageType::ConstPointer
403#if !defined(ITK_WRAPPING_PARSER)
427#ifndef ITK_MANUAL_INSTANTIATION
428# include "rtkMechlemOneStepSpectralReconstructionFilter.hxx"
Pixel-wise addition of two images.
SmartPointer< Self > Pointer
Casts input pixels to output pixel type.
SmartPointer< Self > Pointer
Templated n-dimensional image class.
Pixel-wise multiplication of two images.
SmartPointer< Self > Pointer
static constexpr T max(const T &)
Permutes the image axes according to a user specified order.
Implements transparent reference counting.
Templated n-dimensional vector image class.
For each vector-valued pixel, adds a vector to the diagonal of a matrix.
itk::SmartPointer< Self > Pointer
itk::SmartPointer< Self > Pointer
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.
itk::SmartPointer< Self > Pointer
Computes update from gradient and Hessian in Newton's method.
itk::SmartPointer< Self > Pointer
Mother class for cone beam reconstruction filters which need runtime selection of their forward and b...
IterativeConeBeamReconstructionFilter()
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
Joseph forward projection.
SingleComponentImageType::ConstPointer GetSpatialRegularizationWeights()
ReorderProjectionsWeightsFilterType::Pointer m_ReorderProjectionsWeightsFilter
MechlemOneStepSpectralReconstructionFilter()
void SetInputMaterialVolumes(const VectorImageType *materialVolumes)
IterativeConeBeamReconstructionFilter< TOutputImage, TOutputImage > Superclass
SQSRegularizationType::Pointer m_SQSRegul
void GenerateInputRequestedRegion() override
GradientsBackProjectionFilterType::Pointer m_GradientsBackProjectionFilter
void SetProjectionWeights(const SingleComponentImageType *weiprojections)
itk::MultiplyImageFilter< TOutputImage, SingleComponentImageType > MultiplyFilterType
NewtonFilterType::Pointer m_NewtonFilter
void SetSupportMask(const SingleComponentImageType *support)
vnl_matrix< dataType > BinnedDetectorResponseType
WeidingerForwardModelImageFilter< TOutputImage, TMeasuredProjections, TIncidentSpectrum > WeidingerForwardModelType
AddMatrixAndDiagonalFilterType::Pointer m_AddHessians
MaterialProjectionsSourceType::Pointer m_ProjectionsSource
AddFilterType::Pointer m_AddGradients
void GenerateData() override
rtk::ReorderProjectionsImageFilter< SingleComponentImageType > ReorderProjectionsWeightsFilterType
MultiplyFilterType::Pointer m_MultiplySupportFilter
rtk::ConstantImageSource< GradientsImageType > GradientsSourceType
void VerifyInputInformation() const override
rtk::ConstantImageSource< SingleComponentImageType > SingleComponentImageSourceType
ForwardProjectionFilterType::Pointer m_ForwardProjectionFilter
rtk::ConstantImageSource< HessiansImageType > HessiansSourceType
rtk::ForwardProjectionImageFilter< TOutputImage, TOutputImage > ForwardProjectionFilterType
HessiansBackProjectionFilterType::Pointer InstantiateHessiansBackProjectionFilter(int bptype)
itk::ExtractImageFilter< TMeasuredProjections, TMeasuredProjections > ExtractMeasuredProjectionsFilterType
TOutputImage::ConstPointer GetInputMaterialVolumes()
TIncidentSpectrum::ConstPointer GetInputIncidentSpectrum()
void SetInputMeasuredProjections(const VectorImageType *measuredProjections)
typename itk::VectorImage< dataType, TOutputImage::ImageDimension > VectorImageType
rtk::ReorderProjectionsImageFilter< TMeasuredProjections > ReorderMeasuredProjectionsFilterType
MultiplyGradientFilterType::Pointer m_MultiplyGradientToBeBackprojectedFilter
TOutputImage GradientsImageType
static constexpr unsigned int nMaterials
HessiansSourceType::Pointer m_HessiansSource
rtk::ConstantImageSource< TOutputImage > MaterialProjectionsSourceType
SingleComponentImageSourceType::Pointer m_SingleComponentVolumeSource
static constexpr unsigned int nBins
void SetInputIncidentSpectrum(const TIncidentSpectrum *incidentSpectrum)
void SetInputMeasuredProjections(const TMeasuredProjections *measuredProjections)
void SetInputMaterialVolumes(const TOutputImage *materialVolumes)
CastMeasuredProjectionsFilterType::Pointer m_CastMeasuredProjectionsFilter
MultiplyGradientFilterType::Pointer m_MultiplyRegulGradientsFilter
void GenerateOutputInformation() override
NesterovFilterType::Pointer m_NesterovFilter
ExtractMeasuredProjectionsFilterType::Pointer m_ExtractMeasuredProjectionsFilter
ReorderMeasuredProjectionsFilterType::Pointer m_ReorderMeasuredProjectionsFilter
ThreeDCircularProjectionGeometry::ConstPointer m_Geometry
TMeasuredProjections::ConstPointer GetInputMeasuredProjections()
typename itk::Image< typename TOutputImage::PixelType, TOutputImage::ImageDimension > CPUOutputImageType
rtk::NesterovUpdateImageFilter< TOutputImage > NesterovFilterType
JosephForwardProjectionImageFilter< SingleComponentImageType, SingleComponentImageType > CudaSingleComponentForwardProjectionImageFilterType
SingleComponentImageType::ConstPointer GetProjectionWeights()
HessiansBackProjectionFilterType::Pointer m_HessiansBackProjectionFilter
typename Superclass::ForwardProjectionType ForwardProjectionType
itk::SmartPointer< Self > Pointer
SingleComponentForwardProjectionFilterType::Pointer m_SingleComponentForwardProjectionFilter
typename TOutputImage::PixelType::ValueType dataType
SingleComponentImageSourceType::Pointer m_SingleComponentProjectionsSource
SingleComponentImageType::ConstPointer GetSupportMask()
rtk::AddMatrixAndDiagonalImageFilter< GradientsImageType, HessiansImageType > AddMatrixAndDiagonalFilterType
int m_NumberOfProjections
CastMaterialVolumesFilterType::Pointer m_CastMaterialVolumesFilter
std::vector< int > m_NumberOfProjectionsInSubset
itk::CastImageFilter< VectorImageType, TMeasuredProjections > CastMeasuredProjectionsFilterType
rtk::ForwardProjectionImageFilter< SingleComponentImageType, SingleComponentImageType > SingleComponentForwardProjectionFilterType
itk::CastImageFilter< VectorImageType, TOutputImage > CastMaterialVolumesFilterType
~MechlemOneStepSpectralReconstructionFilter() override=default
TOutputImage::RegionType::SizeType m_RegularizationRadius
TOutputImage::PixelType m_RegularizationWeights
virtual void SetMaterialAttenuations(const MaterialAttenuationsType &matAtt)
void SetSpatialRegularizationWeights(const SingleComponentImageType *regweights)
GradientsSourceType::Pointer m_GradientsSource
typename TOutputImage::template RebindImageType< dataType, TOutputImage::ImageDimension > SingleComponentImageType
virtual void SetBinnedDetectorResponse(const BinnedDetectorResponseType &detResp)
itk::MultiplyImageFilter< GradientsImageType, SingleComponentImageType > MultiplyGradientFilterType
vnl_matrix< dataType > MaterialAttenuationsType
rtk::BackProjectionImageFilter< HessiansImageType, HessiansImageType > HessiansBackProjectionFilterType
typename TOutputImage::template RebindImageType< itk::Vector< dataType, nMaterials *nMaterials >, TOutputImage::ImageDimension > HessiansImageType
rtk::GetNewtonUpdateImageFilter< GradientsImageType, HessiansImageType > NewtonFilterType
rtk::SeparableQuadraticSurrogateRegularizationImageFilter< GradientsImageType > SQSRegularizationType
int m_NumberOfProjectionsPerSubset
MultiplyGradientFilterType::Pointer m_MultiplyRegulHessiansFilter
MechlemOneStepSpectralReconstructionFilter Self
BackProjectionImageFilter< HessiansImageType, HessiansImageType > CudaHessiansBackProjectionImageFilterType
typename Superclass::BackProjectionType BackProjectionType
rtk::BackProjectionImageFilter< GradientsImageType, GradientsImageType > GradientsBackProjectionFilterType
void VerifyPreconditions() const override
WeidingerForwardModelType::Pointer m_WeidingerForward
itk::AddImageFilter< GradientsImageType > AddFilterType
SingleComponentForwardProjectionFilterType::Pointer InstantiateSingleComponentForwardProjectionFilter(int fwtype)
Applies Nesterov's momentum technique.
itk::SmartPointer< Self > Pointer
Sorts or shuffle projections and geometry inputs.
itk::SmartPointer< Self > Pointer
For one-step inversion of spectral CT data by the method Mechlem2017, computes regularization term's ...
itk::SmartPointer< Self > Pointer
Projection geometry for a source and a 2-D flat panel.
itk::SmartPointer< const Self > ConstPointer
Re-writes a vector image as an image.
Performs intermediate computations in Weidinger2016.
itk::SmartPointer< Self > Pointer
#define itkSetMacro(name, type)