Skip to content

Commit

Permalink
DOC: Improve formulas in documentation including MathJax 2/3 support
Browse files Browse the repository at this point in the history
Fixes the following:
 * removing strange characters
 * correcting some obvious problems
 * making formulas work under MathJax 2 (and works also under MathJax 3)
  • Loading branch information
albert-github authored and dzenanz committed Feb 10, 2025
1 parent 791454c commit 088b3f0
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 41 deletions.
10 changes: 5 additions & 5 deletions Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ namespace itk
*
* The Gaussian function G(x) is given by
* \f[
* G(\vec{x}) = m e^{-\|\S^{-1} \vec{x}\|^2 / 2},
* G(\vec{x}) = m e^{-\|S^{-1} \vec{x}\|^2 / 2},
* \f]
* where m is a scaling factor set by SetMaximum(), and \f$\S\f$ is the
* where m is a scaling factor set by SetMaximum(), and \f$S\f$ is the
* (invertible) matrix associated to the IndexToObjectTransform of the object
* multiplied by the Sigma parameter. If \f$\S\f$ is symmetric and positive
* multiplied by the Sigma parameter. If \f$S\f$ is symmetric and positive
* definite, and m is chosen so that the integral of G(x) is 1, then G will
* denote a normal distribution with mean 0 and covariance matrix \f$\S \times
* denote a normal distribution with mean 0 and covariance matrix \f$S \times
* Sigma\f$.
* \ingroup ITKSpatialObjects
*/
Expand Down Expand Up @@ -117,7 +117,7 @@ class ITK_TEMPLATE_EXPORT GaussianSpatialObject : public SpatialObject<TDimensio
unsigned int depth = 0,
const std::string & name = "") const override;

/** Returns the $sigma = $ \c m_Radius level set of the Gaussian function, as an
/** Returns the sigma = \c m_Radius level set of the Gaussian function, as an
* EllipseSpatialObject. */
typename EllipseSpatialObject<TDimension>::Pointer
GetEllipsoid() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class ITK_TEMPLATE_EXPORT ElasticBodySplineKernelTransform : public KernelTransf
using typename Superclass::GMatrixType;
/** Compute G(x)
* For the elastic body spline, this is:
* \f$ G(x) = [alpha*r(x)^2*I - 3*x*x']*r(x) \f$
* \f$ G(x) = [\alpha*r(x)^2*I - 3*x*x']*r(x) \f$
* where
* \f$\alpha = 12 ( 1 - \nu ) - 1\f$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace itk
* where \f$\textbf{R}_v\f$ is the rotation matrix given the versor,
* \f$S=\left( \begin{array}{ccc}s_0-1 & 0 & 0 \\ 0 & s_1-1 & 0 \\ 0 & 0 & s_2-1 \end{array} \right) \f$
* , and
* \f$K=\left( \begin{array}{ccc}0 & k_0 & k_1 \\ k_2 & 0 & k_3 \\ k_4 & k_5 & 0 \end{array} \right)\ \f$.
* \f$K=\left( \begin{array}{ccc}0 & k_0 & k_1 \\ k_2 & 0 & k_3 \\ k_4 & k_5 & 0 \end{array} \right) \f$.
*
* \ingroup ITKTransform
*/
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Transform/include/itkScaleVersor3DTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace itk
* The transform can be described as:
* \f$ (\textbf{R}_v + \textbf{S})\textbf{x} \f$ where \f$\textbf{R}_v\f$ is the
* rotation matrix given the versor, and
* \f$S=\left( \begin{array}{ccc}s_0-1 & 0 & 0 \\ 0 & s_1-1 & 0 \\ 0 & 0 & s_2-1 \end{array} \right)\ \f$
* \f$S=\left( \begin{array}{ccc}s_0-1 & 0 & 0 \\ 0 & s_1-1 & 0 \\ 0 & 0 & s_2-1 \end{array} \right) \f$
*
*
* \note This transform's scale parameters are not related to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace itk
* equivalent to multiplying the Fourier transform of the two images,
* the inverse filter consists of inverting the multiplication. In
* other words, this filter computes the following:
* \f[ hat{F}(\omega) =
* \f[ \hat{F}(\omega) =
* \begin{cases}
* G(\omega) / H(\omega) & \text{if $|H(\omega)| \geq \epsilon$} \\
* 0 & \text{otherwise}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace itk
*
* \note For itk::Image, one element is one pixel. So the number of elements is directly
* linked to the physical size of the object, i.e.
* \f$ PhysicalSize = TargetNumberOfElements \cdot \prod_{i=1}{dim} Spacing_{i} \f$
* \f$ PhysicalSize = TargetNumberOfElements \cdot \prod_{i=1}^{dim} Spacing_{i} \f$
*
* \note For itk::QuadEdgeMesh, one element is one vertex.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace itk
* \begin{cases}
* M, & \quad \text{if } U < p/2 \\
* m, & \quad \text{if } U > 1 - p/2 \\
* I_0, & \quad \text{if } p/2 \geq U \leq 1 - p/2
* I_0, & \quad \text{if } p/2 \geq U \leq 1 - p/2
* \end{cases} \f$
*
* \par
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ namespace itk
* It can be modeled as:
*
* \par
* \f$ I = I_0 \ast G \f$
* \f$ I = I_0 \ast G \f$
*
* \par
* where \f$ G \f$ is a is a gamma distributed random variable of mean 1 and
* variance proportional to the noise level:
*
* \par
* \f$ G \sim \Gamma(\frac{1}{\sigma^2}, \sigma^2) \f$
* \f$ G \sim \Gamma(\frac{1}{\sigma^2}, \sigma^2) \f$
*
* \author Gaetan Lehmann
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace itk
*
* For one iteration the location of one vertex is computed as follows:
* \f[
* \boldsymbol{ v' }_i = v_i + m_RelaxationFactor \cdot \frac{ \sum_j w_{ij} ( \boldsymbol{ v_j } - \boldsymbol{ v_i } )
* \boldsymbol{ v' }_i = v_i + m_{RelaxationFactor} \cdot \frac{ \sum_j w_{ij} ( \boldsymbol{ v_j } - \boldsymbol{ v_i } )
* }{ \sum_j w_{ij} } \f]
*
* where \f$ w_{ij} \f$ is computed by the means of the set functor
Expand Down
6 changes: 3 additions & 3 deletions Modules/Numerics/Optimizers/include/itkLBFGSOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ namespace itk
* The step size \f$ s \f$ is determined through line search with the approach
* by More and Thuente \cite more1994. This line search approach finds a step size such that
* \f[
* \lVert \nabla f(x + s (\nabla^2 f(x_n) )^{-1} \nabla f(x) ) \rVert
* \| \nabla f(x + s (\nabla^2 f(x_n) )^{-1} \nabla f(x) ) \|
* \le
* \nu \lVert \nabla f(x) \rVert
* \nu \| \nabla f(x) \|
* \f]
* The parameter \f$ \nu \f$ is set through SetLineSearchAccuracy() (default 0.9)
* The default step length, i.e. starting step length for the line search,
* is set through SetDefaultStepLength() (default 1.0).
*
* The optimization stops when either the gradient satisfies the condition
* \f[
* \lVert \nabla f(x) \rVert \le \epsilon \max(1, \lVert X \rVert)
* \| \nabla f(x) \| \le \epsilon \max(1, \| X \|)
* \f]
* or a maximum number of function evaluations has been reached.
* The tolerance \f$\epsilon\f$ is set through SetGradientConvergenceTolerance()
Expand Down
8 changes: 4 additions & 4 deletions Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ extern ITKOptimizersv4_EXPORT std::ostream &
* the approach by More and Thuente \cite more1994. This line search approach finds a step
* size such that
* \f[
* \lVert \nabla f(x + s (\nabla^2 f(x_n) )^{-1} \nabla f(x) ) \rVert
* \| \nabla f(x + s (\nabla^2 f(x_n) )^{-1} \nabla f(x) ) \|
* \le
* \nu \lVert \nabla f(x) \rVert
* \nu \| \nabla f(x) \|
* \f]
* The parameter \f$\nu\f$ is set through SetLineSearchAccuracy() (default 0.9)
* and SetGradientLineSearchAccuracy()
Expand All @@ -120,7 +120,7 @@ extern ITKOptimizersv4_EXPORT std::ostream &
*
* The optimization stops when either the gradient satisfies the condition
* \f[
* \lVert \nabla f(x) \rVert \le \epsilon \max(1, \lVert X \rVert)
* \| \nabla f(x) \| \le \epsilon \max(1, \| X \|)
* \f]
* or a maximum number of function evaluations has been reached.
* The tolerance \f$\epsilon\f$ is set through SetSolutionAccuracy()
Expand Down Expand Up @@ -380,7 +380,7 @@ class ITK_TEMPLATE_EXPORT LBFGS2Optimizerv4Template
* problems. Setting this parameter to a positive value activates
* Orthant-Wise Limited-memory Quasi-Newton (OWL-QN) method, which
* minimizes the objective function F(x) combined with the L1 norm |x|
* of the variables, \f$F(x) + C |x|}. \f$. This parameter is the coefficient
* of the variables, \f$F(x) + C |x| \f$. This parameter is the coefficient
* for the |x|, i.e., C. As the L1 norm |x| is not differentiable at
* zero, the library modifies function and gradient evaluations from
* a client program suitably; a client program thus have only to return
Expand Down
6 changes: 3 additions & 3 deletions Modules/Numerics/Optimizersv4/include/itkLBFGSOptimizerv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ namespace itk
* The step size \f$ s \f$ is determined through line search with the approach
* by More and Thuente [4]. This line search approach finds a step size such that
* \f[
* \lVert \nabla f(x + s (\nabla^2 f(x_n) )^{-1} \nabla f(x) ) \rVert
* \| \nabla f(x + s (\nabla^2 f(x_n) )^{-1} \nabla f(x) ) \|
* \le
* \nu \lVert \nabla f(x) \rVert
* \nu \| \nabla f(x) \|
* \f]
* The parameter \f$ \nu \f$ is set through SetLineSearchAccuracy() (default 0.9)
* The default step length, i.e. starting step length for the line search,
* is set through SetDefaultStepLength() (default 1.0).
*
* The optimization stops when either the gradient satisfies the condition
* \f[
* \lVert \nabla f(x) \rVert \le \epsilon \max(1, \lVert X \rVert)
* \| \nabla f(x) \| \le \epsilon \max(1, \| X \|)
* \f]
* or a maximum number of function evaluations has been reached.
* The tolerance \f$\epsilon\f$ is set through SetGradientConvergenceTolerance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace itk
* \brief Helper class for CorrelationImageToImageMetricv4 \c
* To compute the average pixel intensities of the fixed image and the moving image
* on the sampled points or inside the virtual image region:
* \f$ \bar f (CorrelationImageToImageMetricv4::m_AverageFix ) \f$
* \f$ \bar m (CorrelationImageToImageMetricv4::m_AverageMov ) \f$
* \f$ \bar f (CorrelationImageToImageMetricv4::m\_AverageFix ) \f$
* \f$ \bar m (CorrelationImageToImageMetricv4::m\_AverageMov ) \f$
*
* \ingroup ITKMetricsv4
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace itk
* surrounded by four borders.
*
* Initial regions of a 8 by 9 image with a 4 by 3 grid partition.
* \f[\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
* \f[\begin{array}{|c|c|c|c|c|c|c|c|c|}
* \hline
* 1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\ \hline
* 1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\ \hline
Expand All @@ -65,10 +65,10 @@ namespace itk
* 7 & 7 & 7 & 8 & 8 & 8 & 9 & 9 & 9 \\ \hline
* a & a & a & b & b & b & c & c & c \\ \hline
* a & a & a & b & b & b & c & c & c \\ \hline
* \end{tabular}\f]
* \end{array}\f]
*
* Region borders are shown as "E".
* \f[\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
* \f[\begin{array}{|c|c|c|c|c|c|c|c|c|c|c|}
* \hline
* C & C & C & & C & C & C & & C & C & C \\ \hline
* C & C & C & E & C & C & C & E & C & C & C \\ \hline
Expand All @@ -81,7 +81,7 @@ namespace itk
* & E & & & & E & & & & E & \\ \hline
* C & C & C & & C & C & C & & C & C & C \\ \hline
* C & C & C & E & C & C & C & E & C & C & C \\ \hline
* \end{tabular}\f]
* \end{array}\f]
*
* \ingroup RegionGrowingSegmentation
* \ingroup ITKKLMRegionGrowing
Expand Down Expand Up @@ -206,11 +206,11 @@ class ITKKLMRegionGrowing_EXPORT KLMSegmentationRegion : public SegmentationRegi
* Lambda set to -1.0.
*
* For example, take an image with 3 regions A, B, C
* \f[\begin{tabular}{|c|c|}
* \f[\begin{array}{|c|c|}
* \hline
* A & A \\ \hline
* B & C \\ \hline
* \end{tabular}\f]
* \end{array}\f]
* where region A has region borders A-B and A-C;
* region B has region borders A-B and B-C; and
* region C has region borders A-C and B-C.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace itk
* \f$ U \f$ and lower threshold \f$ L \f$ according to the following formula.
*
* \par
* \f$ f(x) = \left\{ \begin{array}{ll} g(x) - L & \mbox{if $(g)x < (U-L)/2 + L$} \\ U - g(x) & \mbox{otherwise}
* \f$ f(x) = \left\{ \begin{array}{ll} g(x) - L & \mbox{if g(x) < (U-L)/2 + L} \\ U - g(x) & \mbox{otherwise}
* \end{array} \right. \f$
*
* \sa SegmentationLevelSetImageFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@ extern ITKMarkovRandomFieldsClassifiers_EXPORT std::ostream &
* assigned a weight 1.5. A weight of 1.3 is assigned to the influence of
* the north, south, east, west, and diagonal pixels in the previous and next
* slices.
* \f[\begin{tabular}{ccc}
* \begin{tabular}{|c|c|c|}
* \f[\begin{array}{ccc}
* \begin{array}{|c|c|c|}
* 1.3 & 1.3 & 1.3 \\
* 1.3 & 1.5 & 1.3 \\
* 1.3 & 1.3 & 1.3 \\
* \end{tabular} &
* \begin{tabular}{|c|c|c|}
* \end{array} &
* \begin{array}{|c|c|c|}
* 1.7 & 1.7 & 1.7 \\
* 1.7 & 0 & 1.7 \\
* 1.7 & 1.7 & 1.7 \\
* \end{tabular} &
* \begin{tabular}{|c|c|c|}
* \end{array} &
* \begin{array}{|c|c|c|}
* 1.3 & 1.3 & 1.3 \\
* 1.5 & 1.5 & 1.3 \\
* 1.3 & 1.3 & 1.3 \\
* \end{tabular} \\
* \end{tabular}\f]
* \end{array} \\
* \end{array}\f]
*
* The user needs to set the neighborhood size using the SetNeighborhoodRadius
* function. The details on the semantics of a neighborhood can be found
Expand Down
1 change: 1 addition & 0 deletions Utilities/Doxygen/DoxygenConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ set(DOXYGEN_DOCSET_PUBLISHER_NAME "InsightConsortium")
set(DOXYGEN_ECLIPSE_DOC_ID "org.itk.ITK")
set(DOXYGEN_ENUM_VALUES_PER_LINE "1")
set(DOXYGEN_USE_MATHJAX "YES")
set(DOXYGEN_MATHJAX_VERSION "MathJax_2")
set(DOXYGEN_MATHJAX_RELPATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/")
if(ITK_DOXYGEN_SERVER_BASED_SEARCH)
set(DOXYGEN_SERVER_BASED_SEARCH "YES")
Expand Down

0 comments on commit 088b3f0

Please sign in to comment.