Skip to content

Commit

Permalink
STYLE: Rename non-templated types from T* to *Type
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit committed Dec 16, 2022
1 parent 2c35fdf commit c4882b8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
37 changes: 19 additions & 18 deletions include/rtkMechlemOneStepSpectralReconstructionFilter.h
Expand Up @@ -168,16 +168,17 @@ class ITK_TEMPLATE_EXPORT MechlemOneStepSpectralReconstructionFilter
/** SFINAE type alias, depending on whether a CUDA image is used. */
using CPUOutputImageType = typename itk::Image<typename TOutputImage::PixelType, TOutputImage::ImageDimension>;
#ifdef RTK_USE_CUDA
typedef typename std::conditional<
std::is_same<TOutputImage, CPUOutputImageType>::value,
itk::Image<itk::Vector<dataType, nMaterials * nMaterials>, TOutputImage::ImageDimension>,
itk::CudaImage<itk::Vector<dataType, nMaterials * nMaterials>, TOutputImage::ImageDimension>>::type THessiansImage;
typedef
typename std::conditional<std::is_same<TOutputImage, CPUOutputImageType>::value,
itk::Image<itk::Vector<dataType, nMaterials * nMaterials>, TOutputImage::ImageDimension>,
itk::CudaImage<itk::Vector<dataType, nMaterials * nMaterials>,
TOutputImage::ImageDimension>>::type HessiansImageType;
typedef
typename std::conditional<std::is_same<TOutputImage, CPUOutputImageType>::value,
itk::Image<dataType, TOutputImage::ImageDimension>,
itk::CudaImage<dataType, TOutputImage::ImageDimension>>::type SingleComponentImageType;
#else
using THessiansImage =
using HessiansImageType =
typename itk::Image<itk::Vector<dataType, nMaterials * nMaterials>, TOutputImage::ImageDimension>;
using SingleComponentImageType = typename itk::Image<dataType, TOutputImage::ImageDimension>;
#endif
Expand All @@ -194,16 +195,16 @@ class ITK_TEMPLATE_EXPORT MechlemOneStepSpectralReconstructionFilter
CudaForwardProjectionImageFilter<SingleComponentImageType, SingleComponentImageType>>::
type CudaSingleComponentForwardProjectionImageFilterType;
typedef typename std::conditional<std::is_same<TOutputImage, CPUOutputImageType>::value,
BackProjectionImageFilter<THessiansImage, THessiansImage>,
CudaBackProjectionImageFilter<THessiansImage>>::type
BackProjectionImageFilter<HessiansImageType, HessiansImageType>,
CudaBackProjectionImageFilter<HessiansImageType>>::type
CudaHessiansBackProjectionImageFilterType;
# else
using WeidingerForwardModelType = WeidingerForwardModelImageFilter<TOutputImage, TPhotonCounts, TSpectrum>;
using CudaSingleComponentForwardProjectionImageFilterType =
JosephForwardProjectionImageFilter<SingleComponentImageType, SingleComponentImageType>;
using CudaHessiansBackProjectionImageFilterType = BackProjectionImageFilter<THessiansImage, THessiansImage>;
using CudaHessiansBackProjectionImageFilterType = BackProjectionImageFilter<HessiansImageType, HessiansImageType>;
# endif
using TGradientsImage = TOutputImage;
using GradientsImageType = TOutputImage;
#endif

using ForwardProjectionType = typename Superclass::ForwardProjectionType;
Expand All @@ -212,22 +213,22 @@ class ITK_TEMPLATE_EXPORT MechlemOneStepSpectralReconstructionFilter
#if !defined(ITK_WRAPPING_PARSER)
/** Filter type alias */
using ExtractPhotonCountsFilterType = itk::ExtractImageFilter<TPhotonCounts, TPhotonCounts>;
using AddFilterType = itk::AddImageFilter<TGradientsImage>;
using AddFilterType = itk::AddImageFilter<GradientsImageType>;
using SingleComponentForwardProjectionFilterType =
rtk::ForwardProjectionImageFilter<SingleComponentImageType, SingleComponentImageType>;
using ForwardProjectionFilterType = rtk::ForwardProjectionImageFilter<TOutputImage, TOutputImage>;
using GradientsBackProjectionFilterType = rtk::BackProjectionImageFilter<TGradientsImage, TGradientsImage>;
using HessiansBackProjectionFilterType = rtk::BackProjectionImageFilter<THessiansImage, THessiansImage>;
using GradientsBackProjectionFilterType = rtk::BackProjectionImageFilter<GradientsImageType, GradientsImageType>;
using HessiansBackProjectionFilterType = rtk::BackProjectionImageFilter<HessiansImageType, HessiansImageType>;
using NesterovFilterType = rtk::NesterovUpdateImageFilter<TOutputImage>;
using SingleComponentImageSourceType = rtk::ConstantImageSource<SingleComponentImageType>;
using MaterialProjectionsSourceType = rtk::ConstantImageSource<TOutputImage>;
using GradientsSourceType = rtk::ConstantImageSource<TGradientsImage>;
using HessiansSourceType = rtk::ConstantImageSource<THessiansImage>;
using SQSRegularizationType = rtk::SeparableQuadraticSurrogateRegularizationImageFilter<TGradientsImage>;
using AddMatrixAndDiagonalFilterType = rtk::AddMatrixAndDiagonalImageFilter<TGradientsImage, THessiansImage>;
using NewtonFilterType = rtk::GetNewtonUpdateImageFilter<TGradientsImage, THessiansImage>;
using GradientsSourceType = rtk::ConstantImageSource<GradientsImageType>;
using HessiansSourceType = rtk::ConstantImageSource<HessiansImageType>;
using SQSRegularizationType = rtk::SeparableQuadraticSurrogateRegularizationImageFilter<GradientsImageType>;
using AddMatrixAndDiagonalFilterType = rtk::AddMatrixAndDiagonalImageFilter<GradientsImageType, HessiansImageType>;
using NewtonFilterType = rtk::GetNewtonUpdateImageFilter<GradientsImageType, HessiansImageType>;
using MultiplyFilterType = itk::MultiplyImageFilter<TOutputImage, SingleComponentImageType>;
using MultiplyGradientFilterType = itk::MultiplyImageFilter<TGradientsImage, SingleComponentImageType>;
using MultiplyGradientFilterType = itk::MultiplyImageFilter<GradientsImageType, SingleComponentImageType>;
#endif

/** Pass the geometry to all filters needing it */
Expand Down
10 changes: 5 additions & 5 deletions include/rtkMechlemOneStepSpectralReconstructionFilter.hxx
Expand Up @@ -65,10 +65,10 @@ MechlemOneStepSpectralReconstructionFilter<TOutputImage, TPhotonCounts, TSpectru
m_SingleComponentVolumeSource->SetConstant(itk::NumericTraits<typename TOutputImage::PixelType::ValueType>::One);
m_GradientsSource->SetConstant(
itk::NumericTraits<typename MechlemOneStepSpectralReconstructionFilter<TOutputImage, TPhotonCounts, TSpectrum>::
TGradientsImage::PixelType>::ZeroValue());
GradientsImageType::PixelType>::ZeroValue());
m_HessiansSource->SetConstant(
itk::NumericTraits<typename MechlemOneStepSpectralReconstructionFilter<TOutputImage, TPhotonCounts, TSpectrum>::
THessiansImage::PixelType>::ZeroValue());
HessiansImageType::PixelType>::ZeroValue());
}

template <class TOutputImage, class TPhotonCounts, class TSpectrum>
Expand Down Expand Up @@ -204,7 +204,7 @@ typename MechlemOneStepSpectralReconstructionFilter<TOutputImage, TPhotonCounts,
{
// Define the type of image to be back projected
using THessians =
typename MechlemOneStepSpectralReconstructionFilter<TOutputImage, TPhotonCounts, TSpectrum>::THessiansImage;
typename MechlemOneStepSpectralReconstructionFilter<TOutputImage, TPhotonCounts, TSpectrum>::HessiansImageType;

// Declare the pointer
typename MechlemOneStepSpectralReconstructionFilter<TOutputImage, TPhotonCounts, TSpectrum>::
Expand Down Expand Up @@ -482,8 +482,8 @@ MechlemOneStepSpectralReconstructionFilter<TOutputImage, TPhotonCounts, TSpectru
// Backproject gradient and hessian of that projection
m_GradientsBackProjectionFilter->Update();
m_HessiansBackProjectionFilter->Update();
typename TGradientsImage::Pointer gBP = m_GradientsBackProjectionFilter->GetOutput();
typename THessiansImage::Pointer hBP = m_HessiansBackProjectionFilter->GetOutput();
typename GradientsImageType::Pointer gBP = m_GradientsBackProjectionFilter->GetOutput();
typename HessiansImageType::Pointer hBP = m_HessiansBackProjectionFilter->GetOutput();
gBP->DisconnectPipeline();
hBP->DisconnectPipeline();
m_GradientsBackProjectionFilter->SetInput(gBP);
Expand Down

0 comments on commit c4882b8

Please sign in to comment.