Skip to content

Commit

Permalink
ENH: Do not use SmartPointer in Set function for wrapping
Browse files Browse the repository at this point in the history
All instances have been found with
grep -rE Set.*Pointer.* include/*h
  • Loading branch information
Simon Rit authored and SimonRit committed Dec 25, 2024
1 parent 18d1610 commit 870737f
Show file tree
Hide file tree
Showing 23 changed files with 40 additions and 51 deletions.
4 changes: 2 additions & 2 deletions include/rtkADMMTotalVariationConjugateGradientOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ class ITK_TEMPLATE_EXPORT ADMMTotalVariationConjugateGradientOperator : public C

/** Set the backprojection filter*/
void
SetBackProjectionFilter(const BackProjectionFilterPointer _arg);
SetBackProjectionFilter(BackProjectionFilterType * _arg);

/** Set the forward projection filter*/
void
SetForwardProjectionFilter(const ForwardProjectionFilterPointer _arg);
SetForwardProjectionFilter(ForwardProjectionFilterType * _arg);

/** Pass the geometry to all filters needing it */
itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
Expand Down
4 changes: 2 additions & 2 deletions include/rtkADMMTotalVariationConjugateGradientOperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ADMMTotalVariationConjugateGradientOperator<TOutputImage,
template <typename TOutputImage, typename TGradientOutputImage>
void
ADMMTotalVariationConjugateGradientOperator<TOutputImage, TGradientOutputImage>::SetBackProjectionFilter(
const typename BackProjectionFilterType::Pointer _arg)
BackProjectionFilterType * _arg)
{
if (m_BackProjectionFilter != _arg)
this->Modified();
Expand All @@ -76,7 +76,7 @@ ADMMTotalVariationConjugateGradientOperator<TOutputImage, TGradientOutputImage>:
template <typename TOutputImage, typename TGradientOutputImage>
void
ADMMTotalVariationConjugateGradientOperator<TOutputImage, TGradientOutputImage>::SetForwardProjectionFilter(
const typename ForwardProjectionFilterType::Pointer _arg)
ForwardProjectionFilterType * _arg)
{
if (m_ForwardProjectionFilter != _arg)
this->Modified();
Expand Down
6 changes: 3 additions & 3 deletions include/rtkADMMWaveletsConjugateGradientOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ class ITK_TEMPLATE_EXPORT ADMMWaveletsConjugateGradientOperator : public Conjuga

/** Set the backprojection filter*/
void
SetBackProjectionFilter(const BackProjectionFilterPointer _arg);
SetBackProjectionFilter(BackProjectionFilterType * _arg);

/** Set the forward projection filter*/
void
SetForwardProjectionFilter(const ForwardProjectionFilterPointer _arg);
SetForwardProjectionFilter(ForwardProjectionFilterType * _arg);

/** Set the geometry of both m_BackProjectionFilter and m_ForwardProjectionFilter */
void
SetGeometry(const ThreeDCircularProjectionGeometry::Pointer _arg);
SetGeometry(ThreeDCircularProjectionGeometry * _arg);

/** Set the regularization parameter */
itkSetMacro(Beta, float);
Expand Down
10 changes: 4 additions & 6 deletions include/rtkADMMWaveletsConjugateGradientOperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ ADMMWaveletsConjugateGradientOperator<TOutputImage>::ADMMWaveletsConjugateGradie

template <typename TOutputImage>
void
ADMMWaveletsConjugateGradientOperator<TOutputImage>::SetBackProjectionFilter(
const typename BackProjectionFilterType::Pointer _arg)
ADMMWaveletsConjugateGradientOperator<TOutputImage>::SetBackProjectionFilter(BackProjectionFilterType * _arg)
{
if (m_BackProjectionFilter != _arg)
this->Modified();
Expand All @@ -63,8 +62,7 @@ ADMMWaveletsConjugateGradientOperator<TOutputImage>::SetBackProjectionFilter(

template <typename TOutputImage>
void
ADMMWaveletsConjugateGradientOperator<TOutputImage>::SetForwardProjectionFilter(
const typename ForwardProjectionFilterType::Pointer _arg)
ADMMWaveletsConjugateGradientOperator<TOutputImage>::SetForwardProjectionFilter(ForwardProjectionFilterType * _arg)
{
if (m_ForwardProjectionFilter != _arg)
this->Modified();
Expand All @@ -74,9 +72,9 @@ ADMMWaveletsConjugateGradientOperator<TOutputImage>::SetForwardProjectionFilter(

template <typename TOutputImage>
void
ADMMWaveletsConjugateGradientOperator<TOutputImage>::SetGeometry(const ThreeDCircularProjectionGeometry::Pointer _arg)
ADMMWaveletsConjugateGradientOperator<TOutputImage>::SetGeometry(ThreeDCircularProjectionGeometry * _arg)
{
m_BackProjectionFilter->SetGeometry(_arg.GetPointer());
m_BackProjectionFilter->SetGeometry(_arg);
m_ForwardProjectionFilter->SetGeometry(_arg);
m_DisplacedDetectorFilter->SetGeometry(_arg);
}
Expand Down
5 changes: 2 additions & 3 deletions include/rtkConjugateGradientImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class ITK_TEMPLATE_EXPORT ConjugateGradientImageFilter
using Superclass = itk::InPlaceImageFilter<OutputImageType, OutputImageType>;
using Pointer = itk::SmartPointer<Self>;
using ConjugateGradientOperatorType = ConjugateGradientOperator<OutputImageType>;
using ConjugateGradientOperatorPointerType = typename ConjugateGradientOperatorType::Pointer;
using OutputImagePointer = typename OutputImageType::Pointer;

/** Method for creation through the object factory. */
Expand All @@ -72,7 +71,7 @@ class ITK_TEMPLATE_EXPORT ConjugateGradientImageFilter
itkSetMacro(NumberOfIterations, int);

void
SetA(ConjugateGradientOperatorPointerType _arg);
SetA(ConjugateGradientOperatorType * _arg);

/** The input image to be updated.*/
void
Expand Down Expand Up @@ -101,7 +100,7 @@ class ITK_TEMPLATE_EXPORT ConjugateGradientImageFilter
void
GenerateOutputInformation() override;

ConjugateGradientOperatorPointerType m_A;
ConjugateGradientOperatorType * m_A;

int m_NumberOfIterations;
};
Expand Down
2 changes: 1 addition & 1 deletion include/rtkConjugateGradientImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ConjugateGradientImageFilter<OutputImageType>::GetB()

template <typename OutputImageType>
void
ConjugateGradientImageFilter<OutputImageType>::SetA(ConjugateGradientOperatorPointerType _arg)
ConjugateGradientImageFilter<OutputImageType>::SetA(ConjugateGradientOperatorType * _arg)
{
this->m_A = _arg;
this->Modified();
Expand Down
2 changes: 1 addition & 1 deletion include/rtkFDKConeBeamReconstructionFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ITK_TEMPLATE_EXPORT FDKConeBeamReconstructionFilter : public itk::InPlaceI
* created before calling this set function. */
itkGetMacro(BackProjectionFilter, BackProjectionFilterPointer);
virtual void
SetBackProjectionFilter(const BackProjectionFilterPointer _arg);
SetBackProjectionFilter(BackProjectionFilterType * _arg);

protected:
FDKConeBeamReconstructionFilter();
Expand Down
2 changes: 1 addition & 1 deletion include/rtkFDKConeBeamReconstructionFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ FDKConeBeamReconstructionFilter<TInputImage, TOutputImage, TFFTPrecision>::Gener
template <class TInputImage, class TOutputImage, class TFFTPrecision>
void
FDKConeBeamReconstructionFilter<TInputImage, TOutputImage, TFFTPrecision>::SetBackProjectionFilter(
const BackProjectionFilterPointer _arg)
BackProjectionFilterType * _arg)
{
itkDebugMacro("setting BackProjectionFilter to " << _arg);
if (this->m_BackProjectionFilter != _arg)
Expand Down
4 changes: 2 additions & 2 deletions include/rtkFourDReconstructionConjugateGradientOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ class ITK_TEMPLATE_EXPORT FourDReconstructionConjugateGradientOperator

/** Pass the backprojection filter to ProjectionStackToFourD*/
void
SetBackProjectionFilter(const typename BackProjectionFilterType::Pointer _arg);
SetBackProjectionFilter(BackProjectionFilterType * _arg);

/** Pass the forward projection filter to FourDToProjectionStack */
void
SetForwardProjectionFilter(const typename ForwardProjectionFilterType::Pointer _arg);
SetForwardProjectionFilter(ForwardProjectionFilterType * _arg);

/** Pass the geometry to all filters needing it */
itkSetConstObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
Expand Down
4 changes: 2 additions & 2 deletions include/rtkFourDReconstructionConjugateGradientOperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ FourDReconstructionConjugateGradientOperator<VolumeSeriesType, ProjectionStackTy
template <typename VolumeSeriesType, typename ProjectionStackType>
void
FourDReconstructionConjugateGradientOperator<VolumeSeriesType, ProjectionStackType>::SetBackProjectionFilter(
const typename BackProjectionFilterType::Pointer _arg)
BackProjectionFilterType * _arg)
{
m_BackProjectionFilter = _arg;
this->Modified();
Expand All @@ -86,7 +86,7 @@ FourDReconstructionConjugateGradientOperator<VolumeSeriesType, ProjectionStackTy
template <typename VolumeSeriesType, typename ProjectionStackType>
void
FourDReconstructionConjugateGradientOperator<VolumeSeriesType, ProjectionStackType>::SetForwardProjectionFilter(
const typename ForwardProjectionFilterType::Pointer _arg)
ForwardProjectionFilterType * _arg)
{
m_ForwardProjectionFilter = _arg;
this->Modified();
Expand Down
5 changes: 2 additions & 3 deletions include/rtkFourDToProjectionStackImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,10 @@ class ITK_TEMPLATE_EXPORT FourDToProjectionStackImageFilter

/** Set the ForwardProjection filter */
void
SetForwardProjectionFilter(const typename ForwardProjectionFilterType::Pointer _arg);
SetForwardProjectionFilter(ForwardProjectionFilterType * _arg);

/** Pass the geometry to SingleProjectionToFourDFilter */
virtual void
SetGeometry(GeometryType::Pointer _arg);
itkSetObjectMacro(Geometry, GeometryType);

/** Pass the interpolation weights to SingleProjectionToFourDFilter */
void
Expand Down
9 changes: 1 addition & 8 deletions include/rtkFourDToProjectionStackImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ FourDToProjectionStackImageFilter<ProjectionStackType, VolumeSeriesType>::GetInp
template <typename ProjectionStackType, typename VolumeSeriesType>
void
FourDToProjectionStackImageFilter<ProjectionStackType, VolumeSeriesType>::SetForwardProjectionFilter(
const typename ForwardProjectionFilterType::Pointer _arg)
ForwardProjectionFilterType * _arg)
{
m_ForwardProjectionFilter = _arg;
}
Expand All @@ -86,13 +86,6 @@ FourDToProjectionStackImageFilter<ProjectionStackType, VolumeSeriesType>::SetWei
m_Weights = _arg;
}

template <typename ProjectionStackType, typename VolumeSeriesType>
void
FourDToProjectionStackImageFilter<ProjectionStackType, VolumeSeriesType>::SetGeometry(GeometryType::Pointer _arg)
{
m_Geometry = _arg;
}

template <typename VolumeSeriesType, typename ProjectionStackType>
void
FourDToProjectionStackImageFilter<VolumeSeriesType, ProjectionStackType>::SetSignal(const std::vector<double> signal)
Expand Down
4 changes: 2 additions & 2 deletions include/rtkGgoFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace rtk
*/
template <class TConstantImageSourceType, class TArgsInfo>
void
SetConstantImageSourceFromGgo(typename TConstantImageSourceType::Pointer source, const TArgsInfo & args_info)
SetConstantImageSourceFromGgo(TConstantImageSourceType * source, const TArgsInfo & args_info)
{
using ImageType = typename TConstantImageSourceType::OutputImageType;

Expand Down Expand Up @@ -175,7 +175,7 @@ GetProjectionsFileNamesFromGgo(const TArgsInfo & args_info)

template <class TProjectionsReaderType, class TArgsInfo>
void
SetProjectionsReaderFromGgo(typename TProjectionsReaderType::Pointer reader, const TArgsInfo & args_info)
SetProjectionsReaderFromGgo(TProjectionsReaderType * reader, const TArgsInfo & args_info)
{
const std::vector<std::string> fileNames = GetProjectionsFileNamesFromGgo(args_info);

Expand Down
2 changes: 1 addition & 1 deletion include/rtkLookupTableImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ITK_TEMPLATE_EXPORT LUT
return m_LookupTablePointer;
}
void
SetLookupTable(LookupTablePointer lut)
SetLookupTable(LookupTableType * lut)
{
m_LookupTablePointer = lut;
m_LookupTableDataPointer = lut->GetBufferPointer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ class ITK_TEMPLATE_EXPORT MotionCompensatedFourDReconstructionConjugateGradientO

/** The forward and back projection filters cannot be set by the user */
void
SetForwardProjectionFilter(const typename Superclass::ForwardProjectionFilterType::Pointer itkNotUsed(_arg))
SetForwardProjectionFilter(typename Superclass::ForwardProjectionFilterType * itkNotUsed(_arg))
{
itkExceptionMacro(<< "ForwardProjection cannot be changed");
}
void
SetBackProjectionFilter(const typename Superclass::BackProjectionFilterType::Pointer itkNotUsed(_arg))
SetBackProjectionFilter(typename Superclass::BackProjectionFilterType * itkNotUsed(_arg))
{
itkExceptionMacro(<< "BackProjection cannot be changed");
}
Expand Down
4 changes: 2 additions & 2 deletions include/rtkPolynomialGainCorrectionImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class ITK_TEMPLATE_EXPORT PolynomialGainCorrectionImageFilter

/** Dark image, 2D same size of one input projection */
void
SetDarkImage(const InputImagePointer darkImage);
SetDarkImage(InputImageType * darkImage);

/** Weights, matrix A from reference paper
* 3D image: 2D x order. */
void
SetGainCoefficients(const OutputImagePointer gain);
SetGainCoefficients(OutputImageType * gain);

/* if K==0, the filter is bypassed */
itkSetMacro(K, float);
Expand Down
4 changes: 2 additions & 2 deletions include/rtkPolynomialGainCorrectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ PolynomialGainCorrectionImageFilter<TInputImage, TOutputImage>::PolynomialGainCo

template <class TInputImage, class TOutputImage>
void
PolynomialGainCorrectionImageFilter<TInputImage, TOutputImage>::SetDarkImage(const InputImagePointer darkImage)
PolynomialGainCorrectionImageFilter<TInputImage, TOutputImage>::SetDarkImage(InputImageType * darkImage)
{
m_DarkImage = darkImage;
}

template <class TInputImage, class TOutputImage>
void
PolynomialGainCorrectionImageFilter<TInputImage, TOutputImage>::SetGainCoefficients(const OutputImagePointer gain)
PolynomialGainCorrectionImageFilter<TInputImage, TOutputImage>::SetGainCoefficients(OutputImageType * gain)
{
m_GainImage = gain;
}
Expand Down
2 changes: 1 addition & 1 deletion include/rtkProjectionStackToFourDImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class ITK_TEMPLATE_EXPORT ProjectionStackToFourDImageFilter

/** Pass the backprojection filter to SingleProjectionToFourDFilter */
void
SetBackProjectionFilter(const typename BackProjectionFilterType::Pointer _arg);
SetBackProjectionFilter(BackProjectionFilterType * _arg);

/** Pass the geometry to SingleProjectionToFourDFilter */
itkSetConstObjectMacro(Geometry, GeometryType);
Expand Down
2 changes: 1 addition & 1 deletion include/rtkProjectionStackToFourDImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ProjectionStackToFourDImageFilter<VolumeSeriesType, ProjectionStackType, TFFTPre
template <typename VolumeSeriesType, typename ProjectionStackType, typename TFFTPrecision>
void
ProjectionStackToFourDImageFilter<VolumeSeriesType, ProjectionStackType, TFFTPrecision>::SetBackProjectionFilter(
const typename BackProjectionFilterType::Pointer _arg)
BackProjectionFilterType * _arg)
{
m_BackProjectionFilter = _arg;
this->Modified();
Expand Down
4 changes: 2 additions & 2 deletions include/rtkReconstructionConjugateGradientOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ class ITK_TEMPLATE_EXPORT ReconstructionConjugateGradientOperator : public Conju

/** Set the backprojection filter*/
void
SetBackProjectionFilter(const BackProjectionFilterPointer _arg);
SetBackProjectionFilter(BackProjectionFilterType * _arg);

/** Set the forward projection filter*/
void
SetForwardProjectionFilter(const ForwardProjectionFilterPointer _arg);
SetForwardProjectionFilter(ForwardProjectionFilterType * _arg);

/** Set the support mask, if any, for support constraint in reconstruction */
void
Expand Down
4 changes: 2 additions & 2 deletions include/rtkReconstructionConjugateGradientOperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ ReconstructionConjugateGradientOperator<TOutputImage, TSingleComponentImage, TWe
template <typename TOutputImage, typename TSingleComponentImage, typename TWeightsImage>
void
ReconstructionConjugateGradientOperator<TOutputImage, TSingleComponentImage, TWeightsImage>::SetBackProjectionFilter(
const typename BackProjectionFilterType::Pointer _arg)
BackProjectionFilterType * _arg)
{
m_BackProjectionFilter = _arg;
}

template <typename TOutputImage, typename TSingleComponentImage, typename TWeightsImage>
void
ReconstructionConjugateGradientOperator<TOutputImage, TSingleComponentImage, TWeightsImage>::SetForwardProjectionFilter(
const typename ForwardProjectionFilterType::Pointer _arg)
ForwardProjectionFilterType * _arg)
{
m_ForwardProjectionFilter = _arg;
}
Expand Down
2 changes: 1 addition & 1 deletion include/rtkWarpFourDToProjectionStackImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class ITK_TEMPLATE_EXPORT WarpFourDToProjectionStackImageFilter

/** The forward projection filter cannot be set by the user */
void
SetForwardProjectionFilter(const typename Superclass::ForwardProjectionFilterType::Pointer itkNotUsed(_arg))
SetForwardProjectionFilter(typename Superclass::ForwardProjectionFilterType * itkNotUsed(_arg))
{
itkExceptionMacro(<< "ForwardProjection cannot be changed");
}
Expand Down
2 changes: 1 addition & 1 deletion include/rtkWarpProjectionStackToFourDImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class ITK_TEMPLATE_EXPORT WarpProjectionStackToFourDImageFilter

/** The back projection filter cannot be set by the user */
void
SetBackProjectionFilter(const typename Superclass::BackProjectionFilterType::Pointer itkNotUsed(_arg))
SetBackProjectionFilter(typename Superclass::BackProjectionFilterType * itkNotUsed(_arg))
{
itkExceptionMacro(<< "BackProjection cannot be changed");
}
Expand Down

0 comments on commit 870737f

Please sign in to comment.