From a3e3c2fa84d9d7d4cf84f7e2b30d34d7c6f06e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Coussat?= Date: Fri, 12 Jun 2026 13:59:05 +0200 Subject: [PATCH] DOC: Clean the docstrings in the C++ code --- include/pctBetheBlochFunctor.h | 15 ++++++----- include/pctDDParkerShortScanImageFilter.h | 8 +++--- include/pctEnergyAdaptiveMLPFunction.h | 13 +++++++--- include/pctEnergyStragglingFunctor.h | 9 +++---- include/pctFDKDDBackProjectionImageFilter.h | 4 +++ .../pctFDKDDConeBeamReconstructionFilter.h | 9 +++---- include/pctFDKDDWeightProjectionFilter.h | 17 ++++++------- include/pctHoleFillingImageFilter.h | 20 ++++++--------- include/pctMostLikelyPathFunction.h | 5 ++-- include/pctPolynomialMLPFunction.h | 16 ++++++++---- include/pctProtonPairsToBackProjection.h | 4 +++ ...pctProtonPairsToDistanceDrivenProjection.h | 4 +++ include/pctSchulteMLPFunction.h | 25 +++++++++++++------ include/pctThirdOrderPolynomialMLPFunction.h | 3 +-- ...pctZengWeightedBackProjectionImageFilter.h | 2 +- 15 files changed, 89 insertions(+), 65 deletions(-) diff --git a/include/pctBetheBlochFunctor.h b/include/pctBetheBlochFunctor.h index 3631a55..4d3fe6c 100644 --- a/include/pctBetheBlochFunctor.h +++ b/include/pctBetheBlochFunctor.h @@ -7,20 +7,19 @@ namespace pct { +namespace Functor +{ + /** \class BetheBlochProtonStoppingPower * \ingroup PCT - * \brief Proton stopping power according to the Bethe-Bloch equation + * \brief Proton stopping power according to the Bethe-Bloch equation. * The function corresponds to: - * - F in [Li, MIC-NSS, 2003]. - * - S in [Schulte, Med Phys, 2005]. + * - F in [Li, MIC-NSS, 2003]; + * - S in [Schulte, Med Phys, 2005]; * - S in [Penfold, Med Phys, 2009]. * Note that they have all an error. r must be squared in the equation. * The CLHEP system of units is used. */ - -namespace Functor -{ - template class BetheBlochProtonStoppingPower { @@ -49,7 +48,7 @@ class BetheBlochProtonStoppingPower /** \class IntegratedBetheBlochProtonStoppingPowerInverse * \ingroup PCT - * \brief Numerical for integral used in proton CT. + * \brief Numerical approximation of integrals used in proton CT. */ template class IntegratedBetheBlochProtonStoppingPowerInverse diff --git a/include/pctDDParkerShortScanImageFilter.h b/include/pctDDParkerShortScanImageFilter.h index 696aa84..9ca4d7c 100644 --- a/include/pctDDParkerShortScanImageFilter.h +++ b/include/pctDDParkerShortScanImageFilter.h @@ -5,8 +5,11 @@ #include #include "rtkConfiguration.h" +namespace pct +{ + /** \class DDParkerShortScanImageFilter - * \ingroup PCT + * \ingroup PCT * Weighting of image projections to handle off-centered panels * in tomography reconstruction. Based on [Wang, Med Phys, 2002]. * @@ -16,9 +19,6 @@ * * \author Simon Rit */ -namespace pct -{ - template class ITK_TEMPLATE_EXPORT DDParkerShortScanImageFilter : public itk::InPlaceImageFilter { diff --git a/include/pctEnergyAdaptiveMLPFunction.h b/include/pctEnergyAdaptiveMLPFunction.h index 022d661..d8f9162 100644 --- a/include/pctEnergyAdaptiveMLPFunction.h +++ b/include/pctEnergyAdaptiveMLPFunction.h @@ -36,7 +36,10 @@ GetLinearCoefficients(itk::Vector & ab, const double E_in, const doub ab[0] = (inverseScatteringPower_out - inverseScatteringPower_in) / deltaU; } -// class which calculates factor A, B, C, D as in eq. 19 in [Krah 2019, PMB] +/** \class FactorsABCD + * \ingroup PCT + * Class which calculates factor A, B, C, D as in Eq. 7-10 in [Krah 2021, PMB]. + */ class FactorsABCD { public: @@ -73,6 +76,10 @@ class FactorsABCD } }; +/** \class CoefficientsC + * \ingroup PCT + * Class which calculates factors c0 and c1 as in Eq. 15 in [Krah 2019, PMB]. + */ class CoefficientsC { public: @@ -97,8 +104,8 @@ class CoefficientsC } // end namespace Functor /** \class EnergyAdaptiveMLPFunction - * \ingroup PCT - * \ingroup Functions + * \ingroup PCT Functions + * Energy-adaptive calculation of the most likely path [Krah 2021, PMB]. */ class PCT_EXPORT EnergyAdaptiveMLPFunction : public MostLikelyPathFunction { diff --git a/include/pctEnergyStragglingFunctor.h b/include/pctEnergyStragglingFunctor.h index eec1da7..3f584cc 100644 --- a/include/pctEnergyStragglingFunctor.h +++ b/include/pctEnergyStragglingFunctor.h @@ -6,15 +6,14 @@ namespace pct { +namespace Functor +{ + /** \class EnergyStragglingFunctor - * \ingroup PCT + * \ingroup PCT * \brief Function to compute energy straggling * This is based on a fit of a pencil beam of 200 MeV protons in water */ - -namespace Functor -{ - template class EnergyStragglingFunctor { diff --git a/include/pctFDKDDBackProjectionImageFilter.h b/include/pctFDKDDBackProjectionImageFilter.h index 2d1c4e1..b0f6859 100644 --- a/include/pctFDKDDBackProjectionImageFilter.h +++ b/include/pctFDKDDBackProjectionImageFilter.h @@ -7,6 +7,10 @@ namespace pct { +/** \class FDKDDBackProjectionImageFilter + * \ingroup PCT + * Distance-dirven FDK back projection for proton CT [Rit 2013, Medical Physics]. + */ template class ITK_TEMPLATE_EXPORT FDKDDBackProjectionImageFilter : public rtk::BackProjectionImageFilter diff --git a/include/pctFDKDDConeBeamReconstructionFilter.h b/include/pctFDKDDConeBeamReconstructionFilter.h index 612a88e..a93ab57 100644 --- a/include/pctFDKDDConeBeamReconstructionFilter.h +++ b/include/pctFDKDDConeBeamReconstructionFilter.h @@ -8,14 +8,13 @@ #include #include -/** \class FDKDDConeBeamReconstructionFilter - * TODO - * \ingroup PCT - * \author Simon Rit - */ namespace pct { +/** \class FDKDDConeBeamVarianceReconstructionFilter + * \ingroup PCT + * Implements distance-driven FDK reconstruction [Rit 2013, Medical Physics]. + */ template class ITK_TEMPLATE_EXPORT FDKDDConeBeamReconstructionFilter : public itk::ImageToImageFilter { diff --git a/include/pctFDKDDWeightProjectionFilter.h b/include/pctFDKDDWeightProjectionFilter.h index 5d4ad2d..0746bf7 100644 --- a/include/pctFDKDDWeightProjectionFilter.h +++ b/include/pctFDKDDWeightProjectionFilter.h @@ -4,23 +4,20 @@ #include #include +namespace pct +{ + /** \class FDKDDWeightProjectionFilter - * \ingroup PCT - * \brief Weighting of projections to correct for the divergence in - * filtered backprojection reconstruction algorithms. + * \ingroup PCT + * \brief Weighting of projections to correct for the divergence in filtered backprojection reconstruction algorithms. * The weighting comprises: * - the 2D weighting of the FDK algorithm [Feldkamp, 1984], * - the correction of the ramp factor for divergent full scan, * - the angular weighting for the final 3D integral of FDK. - * Note that SourceToDetectorDistance, SourceToDetectorIsocenter - * SouceOffsets and ProjectionOffsets are accounted for on a per - * projection basis but InPlaneRotation and OutOfPlaneRotation are not - * accounted for. + * Note that SourceToDetectorDistance, SourceToDetectorIsocenter, SouceOffsets and ProjectionOffsets are accounted for + * on a per projection basis but InPlaneRotation and OutOfPlaneRotation are not accounted for. * \author Simon Rit */ -namespace pct -{ - template class ITK_TEMPLATE_EXPORT FDKDDWeightProjectionFilter : public itk::InPlaceImageFilter { diff --git a/include/pctHoleFillingImageFilter.h b/include/pctHoleFillingImageFilter.h index 6217d79..afe2ac7 100644 --- a/include/pctHoleFillingImageFilter.h +++ b/include/pctHoleFillingImageFilter.h @@ -7,19 +7,15 @@ namespace pct { -/** - * - * A simple iterative hole filling filter. A pixel equal to the HolePixel is - * considered a hole. On each iteration, every hole pixel is replaced by the - * average of its non-hole neighbors in a radius=1 neighborhood (center - * excluded). Iterations repeat until no hole pixels remain or MaxIterations - * is reached or an iteration makes no progress. - * - * This filter reproduces the behavior of the project's SmallHoleFiller - * helper. For the original reference see: - * https://www.insight-journal.org/browse/publication/835/ - */ +/** \class HoleFillingImageFilter + * \ingroup PCT + * A simple iterative hole filling filter. A pixel equal to the HolePixel is considered a hole. On each iteration, every + * hole pixel is replaced by the average of its non-hole neighbors in a radius=1 neighborhood (center excluded). + * Iterations repeat until no hole pixels remain or MaxIterations is reached or an iteration makes no progress. This + * filter reproduces the behavior of the project's SmallHoleFiller helper. For the original reference see: + * https://www.insight-journal.org/browse/publication/835/. + */ template class HoleFillingImageFilter : public itk::ImageToImageFilter { diff --git a/include/pctMostLikelyPathFunction.h b/include/pctMostLikelyPathFunction.h index 90db6f9..f2e4f0c 100644 --- a/include/pctMostLikelyPathFunction.h +++ b/include/pctMostLikelyPathFunction.h @@ -16,9 +16,8 @@ namespace pct { /** \class MostLikelyPathFunction - * \brief Base class for computing the most likely path of a proton. - * - * \ingroup Functions PCT + * \ingroup PCT Functions + * Base class for computing the most likely path of a proton. */ template class ITK_TEMPLATE_EXPORT MostLikelyPathFunction : public itk::LightObject diff --git a/include/pctPolynomialMLPFunction.h b/include/pctPolynomialMLPFunction.h index 63ca5f2..8c89832 100644 --- a/include/pctPolynomialMLPFunction.h +++ b/include/pctPolynomialMLPFunction.h @@ -59,7 +59,10 @@ static const std::vector bm_4 = { 5.401888e-06, -7.991486e-08, 3.262799e static const std::vector bm_5 = { 4.307328e-06, 9.657939e-08, -3.338966e-09, 6.069645e-11, -4.427153e-13, 1.201749e-15 }; -// ADD COMMENT HERE +/** \class FactorsABCD + * \ingroup PCT + * Class which calculates factor A, B, C, D as in Eq. 19 in [Krah 2019, PMB]. + */ class FactorsABCD { public: @@ -108,6 +111,10 @@ class FactorsABCD } }; +/** \class CoefficientsC + * \ingroup PCT + * Class which calculates factors c0 and c1 as in Eq. 15 in [Krah 2019, PMB]. + */ class CoefficientsC { public: @@ -131,10 +138,9 @@ class CoefficientsC } // end namespace Functor -/** \class SchulteMLPFunction - * \brief See [Schulte, Med Phys, 2008]. - * - * \ingroup Functions PCT +/** \class PolynomialMLPFunction + * \ingroup PCT Functions + * Polynomial calculation of the most likely path [Krah 2019, PMB]. */ class PCT_EXPORT PolynomialMLPFunction : public MostLikelyPathFunction { diff --git a/include/pctProtonPairsToBackProjection.h b/include/pctProtonPairsToBackProjection.h index e5bda73..c48f295 100644 --- a/include/pctProtonPairsToBackProjection.h +++ b/include/pctProtonPairsToBackProjection.h @@ -12,6 +12,10 @@ namespace pct { +/** \class ProtonPairsToBackProjection + * \ingroup PCT + * Backprojection of the proton pairs according to the MLP before applying the MLP. + */ template class ITK_TEMPLATE_EXPORT ProtonPairsToBackProjection : public itk::InPlaceImageFilter { diff --git a/include/pctProtonPairsToDistanceDrivenProjection.h b/include/pctProtonPairsToDistanceDrivenProjection.h index ec02726..4c6ef72 100644 --- a/include/pctProtonPairsToDistanceDrivenProjection.h +++ b/include/pctProtonPairsToDistanceDrivenProjection.h @@ -11,6 +11,10 @@ namespace pct { +/** \class ProtonPairsToDistanceDrivenProjection + * \ingroup PCT + * Conversion of the proton pairs to distance-driven projections [Rit 2013, Medical Physics]. + */ template class ITK_TEMPLATE_EXPORT ProtonPairsToDistanceDrivenProjection : public itk::InPlaceImageFilter diff --git a/include/pctSchulteMLPFunction.h b/include/pctSchulteMLPFunction.h index 93cf6f2..e2057c0 100644 --- a/include/pctSchulteMLPFunction.h +++ b/include/pctSchulteMLPFunction.h @@ -53,7 +53,10 @@ static const double a4 = -2.215321e-08 * aunit / (CLHEP::cm3 * CLHEP::cm); static const double a5 = 5.398933e-10 * aunit / (CLHEP::cm3 * CLHEP::cm2); #endif -// [Schulte, Med Phys, 2008], constant part of equations 7, 8 and 9 +/** \class ConstantPartOfIntegrals + * \ingroup PCT Functions + * Constant part of Eq. 7, 8 and 9 [Schulte 2008, Medical Physics]. + */ class ConstantPartOfIntegrals { public: @@ -71,7 +74,10 @@ class ConstantPartOfIntegrals } }; -// [Schulte, Med Phys, 2008], integral for sigma in equation 8 +/** \class IntegralForSigmaSqTheta + * \ingroup PCT Functions + * Integral for sigma in equation 8 [Schulte 2008, Medical Physics]. + */ class IntegralForSigmaSqTheta { public: @@ -90,7 +96,10 @@ class IntegralForSigmaSqTheta } }; -// [Schulte, Med Phys, 2008], integral for sigma in equation 9 +/** \class IntegralForSigmaSqTTheta + * \ingroup PCT Functions + * Integral for sigma in equation 9 [Schulte 2008, Medical Physics]. + */ class IntegralForSigmaSqTTheta { public: @@ -109,7 +118,10 @@ class IntegralForSigmaSqTTheta } }; -// [Schulte, Med Phys, 2008], integral for sigma in equation 7 +/** \class IntegralForSigmaSqT + * \ingroup PCT Functions + * Integral for sigma in equation 7 [Schulte 2008, Medical Physics]. + */ class IntegralForSigmaSqT { public: @@ -133,9 +145,8 @@ class IntegralForSigmaSqT } // end namespace Functor /** \class SchulteMLPFunction - * \brief See [Schulte, Med Phys, 2008]. - * - * \ingroup Functions PCT + * \ingroup PCT Functions + * Maximum-likelihood proton path for proton CT [Schulte 2008, Medical Physics]. */ class PCT_EXPORT SchulteMLPFunction : public MostLikelyPathFunction { diff --git a/include/pctThirdOrderPolynomialMLPFunction.h b/include/pctThirdOrderPolynomialMLPFunction.h index ef3817e..aa481f3 100644 --- a/include/pctThirdOrderPolynomialMLPFunction.h +++ b/include/pctThirdOrderPolynomialMLPFunction.h @@ -7,9 +7,8 @@ namespace pct { /** \class ThirdOrderPolynomialMLPFunction + * \ingroup PCT Functions * \brief Fit a third order polynomial given input and output direction and position. - * - * \ingroup Functions PCT */ template class ITK_TEMPLATE_EXPORT ThirdOrderPolynomialMLPFunction : public MostLikelyPathFunction diff --git a/include/pctZengWeightedBackProjectionImageFilter.h b/include/pctZengWeightedBackProjectionImageFilter.h index 972a13d..e395d26 100644 --- a/include/pctZengWeightedBackProjectionImageFilter.h +++ b/include/pctZengWeightedBackProjectionImageFilter.h @@ -8,7 +8,7 @@ /** \class ZengWeightedBackProjectionImageFilter * \ingroup PCT * From an input 4D image where the 4th dimension is the angle, computes - * the weighted backprojection for DBP described in [Zeng, Med Phys, 2007]. + * the weighted backprojection for DBP described in [Zeng 2007, Medical Physics]. * * \author Simon Rit */