1 Introduction

Tomographic reconstruction is a process for recovering an object from a finite set of projections acquired by various techniques such as CT, MRI and PET scanning in medical imaging or electron microscopy in structural biology. There are many well-known tomographic reconstruction methods that can be categorized into three groups: Fourier methods, backprojection methods and algebraic methods. The details of these methods can be found in [11]. In most cases of tomographic reconstruction, the projection directions are known and then can be used to perform the reconstruction. However, there are some cases in which the projection directions are unknown, for example, when studying the particles in cryo-electron microscopy or when the studied object moves during the acquisition. Thus, the projection directions need to be estimated in the tomographic reconstruction process of these cases. During this process, the Euclidean distance between two projections is often used for projection set clustering or refinement [4, 6, 7, 25]. Instead of using the Euclidean distance for projection refinement, the cross-correlation coefficient [26] can be used to measure the distances between two projections, but the projection refinements obtained using the Euclidean distance or the cross-correlation coefficient are not different as shown in [9]. The Euclidean distance is also used in [3] as a cost for simultaneously driving the estimation of the projection directions and the object reconstruction.

However, the relation between the projection direction angular differences and the projection Euclidean distance is not monotonic, nor even one-to-one, even when the two projection directions are close. Thus, using such a non-monotonic distance measure when classifying or refining the projections may lead to errors.

To tackle this problem, we propose in this paper a new method that can estimate the angular difference between two projections in both the 2D and the 3D cases. The problem of the angular difference estimation in 2D is different from that in 3D. Thus, the two cases need to be treated separately.

In 2D, formulae for the angular difference estimation have already been developed based on the relationship between the object moments and its projection moments. This relationship, known as the moment method for the projection direction estimation, is well studied in [1, 2, 20]. Here, our objective is different. We focus on the angular difference estimation between two projections without knowing nor estimating the projection directions. Our developed formulae are not robust when the angular difference between two projections is large. Therefore, these formulae are just applied to estimate the angular differences between neighboring projections. In order to find the neighbors of each projection, local adaptive thresholds are proposed in the projection moment space. The given thresholds correspond to the assumption that the projection directions are uniformly distributed on the semicircle. However, other distributions can be used instead. After estimating the angular differences between the neighboring projections, we build a weighted neighborhood graph whose vertices are the projections and whose edges connect the neighboring projections and are weighted by the estimated angular difference. Finally, the angular difference between any two projections on the neighborhood graph is calculated by using a shortest path algorithm [5].

In 3D, the angular reconstruction method [24, 26] is often used to find the projection directions and can be applied to estimate the angular differences between projections. The method is based on the central slice theorem in which two projections share one common line in the Fourier’s space. This common line is perpendicular to the projection directions, and the combination of common lines between sets of three projections enables us to find any projection direction. Further history of this method can be found in [8, 15, 17, 27]. However, searching the common lines between projections is time- consuming and may lead to accumulative errors when the common lines are not correctly identified. We therefore prefer to extend to 3D our approach based on the 2D version of the moment method described in [10, 20]. In [20], the author shows that the moment method is fast and does not lead to the accumulation of errors as in the common-line-based method.

While our previous work [18] only solved the 2D case of angular difference estimation, here we (1) extend it to 3D, (2) explain more in detail the mathematical proofs and (3) provide more experimental results. The rest of this paper is organized as follows: In Sect. 2, some background notions are provided. Then, in Sect. 3, we deal with the angular difference estimation in 2D tomography and we extend our results to 3D in Sect. 4. The performance of our method is carried out in Sect. 5 for both 2D and 3D images. Finally, the conclusion is given in Sect. 6.

2 Background Notions

We introduce in this section the notions of projection and moment in both the 2D and 3D cases. In the following, an object in \(\mathbb {R}^{n}\) for \(n=2\) or 3 corresponds to a Lebesgue measurable function \(f:\mathbb {R}^{n} \rightarrow [0, 1]\) such that the support \(\mathcal {S}_f\) of f, that is the closure of the set \(\{x\in \mathbb {R}^n \;|\; f(x) \not = 0\}\), is a compact subset of \(\mathbb {R}^{n}\). Then, we define the centroid G of the function f, also known as the center of mass [14], as follows:

The group of the rotations around the origin in \(\mathbb {R}^n\) is noted \(\hbox {SO}(n)\). In \(\hbox {SO}(2)\), the rotation through the angle \(\theta \) around the origin is characterized by its matrix \(\hbox {R}_\theta \):

$$\begin{aligned} \hbox {R}_\theta = \left( \begin{array}{cc} \cos \theta &{} -\sin \theta \\ \sin \theta &{} \cos \theta \end{array} \right) . \end{aligned}$$

In \(\hbox {SO}(3)\), the matrix of the rotation through the angles \((\varphi , \theta , \psi )\) around x-axis, y-axis and z-axis is

$$\begin{aligned} \hbox {R}_{\varphi , \theta , \psi } = (C^1, C^2, C^3), \end{aligned}$$

where

$$\begin{aligned} C^1= & {} \begin{pmatrix} \cos \theta \cos \psi \\ \sin \varphi \sin \theta \cos \psi + \cos \varphi \sin \psi \\ -\cos \varphi \sin \theta \cos \psi + \sin \varphi \sin \psi \end{pmatrix},\\ C^2= & {} \begin{pmatrix} -\cos \theta \sin \psi \\ -\sin \varphi \sin \theta \sin \psi + \cos \varphi \cos \psi \\ \cos \varphi \sin \theta \sin \psi + \sin \varphi \cos \psi \end{pmatrix} \hbox { and }\\ C^3= & {} \begin{pmatrix} \sin \theta \\ -\sin \varphi \cos \theta \\ \cos \varphi \cos \theta \end{pmatrix}. \end{aligned}$$

2.1 Tomography in 2D

Firstly, we present the definition of the projection in 2D. Given an object in \(\mathbb {R}^2\) (2D Cartesian coordinates), the projection of the object in the direction defined by the angle \(\theta \in \mathbb {R}\) is obtained by rotating the coordinating system by an angle \(\theta \), then by projecting the object along the new Oy axis, onto the new Ox axis. This is similar to a rotation of the object by an angle \(-\theta \) and then a projection of the object onto the Ox axis. The definition of the projection in 2D is therefore the following:

Definition 1

Let \(f:\mathbb {R}^{2} \rightarrow [0, 1]\) be a 2D object and let \(\theta \in \mathbb {R}\). The projection \(\mathcal {P}_f(\theta )\) in the direction \(\theta \in \mathbb {R}\) is defined by

$$\begin{aligned} \mathcal {P}_f(\theta )( x) = \int _{\mathbb {R}}^{} f(\rho _{-\theta }(x,y))\,\hbox {d}y, \end{aligned}$$

where \((\rho _{\theta }(x,y))^{T} = \hbox {R}_{\theta } \, (x, y)^{T}\), \(\hbox {R}_{\theta } \in \hbox {SO}(2)\).

Let us now recall that the moment of a measurable function \(g : \mathbb {R} \rightarrow \mathbb {R}\), with order \(d \in \mathbb {N}\), is given by

$$\begin{aligned} \mu _{d}(g) = \int _{\mathbb {R}}^{} x^d g(x) \,\hbox {d}x. \end{aligned}$$
(1)

We note \(\mu _{f,d}(\theta )\) the dth-order moment of the projection \(\mathcal {P}_f(\theta )\). The case of the second-order projection moments \(\mathcal {P}_f(\theta )\) is physically meaningful since it relates to the inertia moments of the function f and enables us to calculate the rotation of f as shown in [20]. The following property proved in [16] shows that the dth-order projection moment is a trigonometric polynomial of degree d as a function of the projection direction \(\theta \).

Property 1

[16] Let \(d \in \mathbb {N}\). The dth-order moment of a projection \(\mathcal {P}_f(\theta )\) can be presented as

$$\begin{aligned} \mu _{f,d}(\theta ) = \sum _{\begin{array}{c} 0 \le k \le d\\ k\equiv d \bmod 2 \end{array}} a_{k} \cos (k\theta ) + b_{k} \sin (k\theta ), \end{aligned}$$
(2)

where \(a_{k}, b_{k} \in \mathbb {R}\).

From Property 1, we have \(\mu _{f,d}(\theta + \pi ) = (-1)^d \, \mu _{f,d}(\theta )\). Then all \(\left| \mu _{f,d}\right| \) are \(\pi \)-periodic for any \(d>0\). Moreover, for any interval \([a, a + \pi )\) on the circle \(\mathbb {R}/{2\pi }\) and for any \(\theta \) in \(\mathbb {R}/{2\pi }\), we necessarily have either \(\theta \) or \(\theta + \pi \) in \([a, a + \pi )\). Since our method relies on the absolute moments, in the sequel we can assume that the angles lie in \(\left[ -\pi /2, \, \pi /2 \right) \), that is, we identify the projections \(\mathcal {P}_f(\theta )\) and \(\mathcal {P}_f(\theta +\pi )\) (which are such that \(\mathcal {P}_f(\theta +\pi )(x) = \mathcal {P}_f(\theta )(-x)\) for any x).

2.2 X-Ray Tomography in 3D

The projection in 3D can be obtained by an extension of the 2D case presented above. The principal difference is that the 3D object is rotated around the x-, y- and z-axis by the three angles \(-\varphi \), \(-\theta \) and \(-\psi \), respectively, and the object is projected onto the (xOy) plane. Thus, the projection in 3D is defined as follows.

Definition 2

Let \(f : \mathbb {R}^3 \rightarrow [0,1]\) be a 3D object and let \(\varphi , \theta , \psi \in \mathbb {R}\). The projection \(\mathcal {P}_f(\varphi , \theta , \psi )\) of f in the direction \((\varphi , \theta , \psi )\) is defined by

$$\begin{aligned} \mathcal {P}_f(\varphi , \theta , \psi )(x,y) = \int _{\mathbb {R}}^{} f(\rho _{-(\psi , \theta , \varphi )}(x,y,z)) \hbox {d}z, \end{aligned}$$
(3)

where \(\big (\rho _{a}(x,y,z)\big )^{T} = \hbox {R}_{a} \,(x, y, z)^{T}\), \(\hbox {R}_{a} \in \hbox {SO}(3).\)

The direction vector of the projection is the unit vector obtained by rotating the z unit vector by \(\hbox {R}_{\varphi , \theta , \psi }\):

$$\begin{aligned} v_{\mathcal {P}}(\varphi ,\theta )= & {} \hbox {R}_{\varphi , \theta , \psi } \, (0, 0, 1)^\mathrm{T} \nonumber \\= & {} (\sin \theta , -\sin \varphi \cos \theta , \cos \varphi \cos \theta )^\mathrm{T}. \end{aligned}$$
(4)

Note that the projection direction vector \(v_{\mathcal {P}}(\varphi ,\theta )\) does not depend on the angle \(\psi \) which controls the rotation of the projection in its plane.

Also note that \((\varphi , \theta , \psi ) \mapsto \mathcal {P}_f(\varphi , \theta , \psi )\) is a periodic function of period \(2\pi \) in \(\varphi , \theta , \psi \) and \(\mathcal {P}_f(\varphi , \theta , \psi )(x,y) = \mathcal {P}_f(\varphi , \theta + \pi , -\psi )(-x,y) = \mathcal {P}_f(\varphi + \pi , -\theta ,\) \( -\psi )(x,-y) = \mathcal {P}_f(\varphi , \theta , \psi + \pi )(-x,-y)\). In addition, our method in 3D relies on the projection moments that are invariant to the signs of x and y. Thus, we can assume \(\varphi , \theta , \psi \in [-\pi /2, \pi /2)\).

Next, let us recall that the moment of a measurable function \(g : \mathbb {R}^2 \rightarrow \mathbb {R}\), with order \((c, d) \in \mathbb {N}^2\) is given by

$$\begin{aligned} \mu _{c,d}(g) = \int _{\mathbb {R}}^{} \int _{\mathbb {R}}^{} {x}^c \, {y}^d \, g(x,y) \, \hbox {d}x \, \hbox {d}y. \end{aligned}$$
(5)

We note \(\mu _{f,c,d}(\varphi , \theta , \psi )\) the projection moment of \(\mathcal {P}_f(\varphi , \theta , \psi )\) with order (cd). For simplicity, we write \(\mathcal {P}\), \(\mu _d\) and \(\mu _{c,d}\) instead of \(\mathcal {P}_f\), \(\mu _{f,d}\) and \(\mu _{f,c,d}\) when no confusion can occur. The projection moments with orders (2, 0), (0, 2) are related to the inertia moments of f and the 3D rotation of f can be calculated from this relationship as shown in [20]. The next proposition extends Property 1 to the 3D case.

Proposition 1

Let \(f : \mathbb {R}^3 \rightarrow [0,1]\) be a 3D object. Let \(\varphi , \theta , \psi \in \mathbb {R}\) and \(c, d \in \mathbb {N}\). The moment of order (cd) of the projection \(\mathcal {P}_f(\varphi , \theta , \psi )\) of the function f, in the direction \((\varphi , \theta , \psi )\), is a trigonometric polynomial as a function of the projection direction.

The proof is given in “Proof of Proposition 1.”

3 Angular Difference Estimation in 2D

3.1 Angular Difference Estimation Problem

Let f be a 2D object whose centroid is at the origin, \(n \in \mathbb {N}\) and \(\varTheta = \lbrace \theta _1, \ldots , \theta _n \rbrace \subseteq \left[ -\pi /2, \pi /2 \right) \) be a set of unknown directions. We denote by \(\varPi \) the set of the related projections: \(\varPi = \lbrace \mathcal {P}(\theta _i) \; | \; 1 \le i \le n \rbrace \). The angular difference between two projections is

$$\begin{aligned} \hbox {d}_\mathrm{ang}(\mathcal {P}(\theta _i), \mathcal {P}(\theta _j)) = \min (|{\theta _i - \theta _j}|, \pi - |{\theta _i - \theta _j}|). \end{aligned}$$

Our main goal in this work is to estimate the angular difference \(\hbox {d}_\mathrm{ang}\) between any two projections from the set \(\varPi \). In [20], Salzman shows that it is possible to compute the direction \(\theta \) associated with the projection \(\mathcal {P}(\theta )\) by using the following equation:

$$\begin{aligned} \sin ^2(\theta ) = \dfrac{|{\mu _{2}(\theta )-\mu _2^{m}}|}{\mu _2^{\max } - \mu _2^{\min }}, \end{aligned}$$
(6)

where \(\mu _2^{\max } =\max _{\theta \in \mathbb R}\mu _2(\theta )\), \(\mu _2^{\min } =\min _{\theta \in \mathbb R}\mu _2(\theta )\) and \(\mu _2^m=\mu _2^{\max }\) if the origin of the angles is set such that \(\mu _2(0)=\mu _2^{\max }\) or \(\mu _2^m=\mu _2^{\min }\) if the origin of the angles is set such that \(\mu _2(0)=\mu _2^{\min }\). Note that we always may assume in the proofs that the origin is set such that \({\hbox {d}_\mathrm{ang}}(\mathcal {P}(\theta _i), \mathcal {P}(\theta _j)) =|{\theta _i - \theta _j}|\).

Since there are two possible values of \(\theta \in [-\pi /2,\pi /2)\) in Eq. (6), Salzman uses odd-order moments to disambiguate the angle values. The angular difference between two projections can be estimated by subtracting the two arcsines calculated from (6). However, due to the high slope of the function \(x\mapsto \arcsin (\sqrt{x})\) near the abscissae 0 and 1, the calculation of \({\hbox {d}_\mathrm{ang}}(\mathcal {P}(\theta _i), \mathcal {P}(\theta _j))\) derived from (6) is not robust to noise when the moment of one of the projections is close to \(\mu _2^{\min }\) or \(\mu _2^{\max }\), especially as the exact values of \(\mu _2^{\min }\) and \(\mu _2^{\max }\) cannot be known precisely. Instead, we construct a graph \(G=(V,E)\) whose vertices are the projections \(\mathcal {P}(\theta _i)\) and whose edges link projections with close moments (Sect. 3.2). Then, each edge of the graph G is weighted by the corresponding angular difference (Sect. 3.3). Rather than computing this difference directly from Eq. (6), we use a Taylor expansion. As shown in Sect. 5.1.2, this leads our method to be more robust to noise. Finally, we measure the angular difference between any two projections as the length of the shortest path between these projections in the graph G.

The steps of the angular difference estimation are summarized in Algorithm 1 (Sect. 3.4).

In the following section, we explain how to select the projection pairs that are linked by an edge in the graph G.

3.2 Projection Neighbors (Edges of the Graph G)

The aim of this section is a method for selecting the neighbors of a given projection from the projection set \(\varPi \). As the projection moment is a trigonometric polynomial function of the angle (Property 1), two close angles yield two close moments for any order due to the continuity of the moment w.r.t. the angle. However, the converse is false since the moment is non-monotonic as a function of the angle. Thus, the neighbors of each projection should be found by comparing their dth-order moments for several values of d.

For each used order d and each moment \(\mu _d(\theta )\) of a given projection \(\mathcal {P}(\theta )\), an interval of size \(2 \varepsilon _d(\theta )\), centered on \(|{\mu _d(\theta )}|\), is set for finding at least one moment corresponding to a neighbor of the given projection \(\mathcal {P}(\theta )\). The calculation of the threshold \(\varepsilon _d(\theta )\) is shown in Proposition 2. The reader will find its proof in “Proof of Proposition 2.”

Proposition 2

Let \(f:\mathbb {R}^{2} \rightarrow [0, 1]\) be a 2D object and let \(p \in [0, 1]\). Assuming that the projection directions are uniformly distributed on \(\left[ -\pi /2, \pi /2 \right) \), for each moment \(\mu _d(\theta )\) of order d, there exists an interval centered on \(|{\mu _d(\theta )}|\) and of size \(2 \varepsilon _d(\theta )\) in which can be found, with probability p, at least one moment \(\mu _d(\theta ')\) with \(\theta '\not = \theta \) and \(\theta '\) neighboring \(\theta \) in \(\varTheta \). The half-width \(\varepsilon _d(\theta )\) is such that

$$\begin{aligned} \varepsilon _d = \frac{\pi }{2} \big (1 - (1 - p)^{\frac{1}{n - 1}}\big ) \times d \, \max \limits _{\theta \in \mathbb R}(|{\mu _d(\theta )}|). \end{aligned}$$
(7)

Remark 1

When the probability distribution function of the angles is known—let us denote it by \(\lambda \)—the reader can check that the proof of Proposition 2 can easily be modified and, instead of Eq. (7), leads to

$$\begin{aligned} \varepsilon _d = {\pi } k \times d \, \max \limits _{\theta \in \mathbb R}(|{\mu _d(\theta )}|), \end{aligned}$$

where \(k\in \Lambda ^{-1}\big (\tfrac{1}{2} (1 - p)^{\frac{1}{n - 1}}\big )\) with \(\Lambda \) the non-decreasing function \(\delta \mapsto \int _\delta ^{1-\delta }\lambda \star (\lambda \circ (-\text {id})) (t)\,\hbox {d}t\), \(\text {id}\) the identity and \(\star \) the convolution.

The issue with Eq. (7) is that the exact value of \(\max \limits _{\theta \in \mathbb R}(|{\mu _d(\theta )}|)\) is not known. It can only be estimated from the finite set of projections \(\varPi \) by \(\max \{|{\mu _d(\theta )}|\mid \theta \in \varTheta \}\). However, as it will be shown in Proposition 3, the error due to this estimation is quadratically convergent toward 0 as the number of projections increases. Then these errors induce a negligible error on the half-width \(\varepsilon _d(\theta )\).

In conclusion, given a projection \(\mathcal {P}_{i}\), Eq. (7) allows us to find the sets \(\hbox {J}_d^i\) of the projection neighbors for distinct moment orders. The final result \(\hbox {J}^i\) is obtained by intersecting the sets \(\hbox {J}_d^i\). Then, an edge is added in the graph G between \(\mathcal {P}_{i}\) and each projection in \(\hbox {J}^i\).

3.3 Angular Difference Formulae

Hereafter, we present in Definition 3 the weights that we put on the edges of the graph. These weights are derived from Eq. (6) by finite Taylor series expansions. In Proposition 4, we give bounds on the error due not only to the finite expansion but also to the unknown extremum moments that intervene in Eq. (6). The first result of this section is Proposition 3 that gives an upper bound on the difference between the theoretical extremum moments \(\mu _2^{\max }\), \(\mu _2^{\min }\) and the empirical ones \(\tilde{\mu }_2^{\max }\), \(\tilde{\mu }_2^{\min }\).

In the sequel of the Sect. 3.3, we use the following notations and assumptions (in order to make the statements of the section less cumbersome, these hypotheses will not be systematically recalled).

Notations and assumptions of Sect. 3.3

  • \(\varTheta =\{\theta _1, \ldots , \theta _n \} \subset [-\frac{\pi }{2}, \frac{\pi }{2})\): a set of directions such that \( \theta _1< \ldots < \theta _n\). We set \(\theta _0 = \theta _n-\pi \) (thus, \(\theta _0 < \theta _1\)).

  • \(\varDelta (\varTheta ) = \max \limits _{1\le i\le n} (\theta _{i} - \theta _{i-1})\).

  • \(M=\{\mu _2(\theta _i) \;|\; \theta _i \in \varTheta \}\),

  • \(\tilde{\mu }_2^{\max } =\max (M)\) and \(\tilde{\mu }_2^{\min } =\min (M)\).

  • \(\tilde{\theta }^{\max } ={\text {argmax}}(M)\) and \(\tilde{\theta }^{\min } ={\text {argmin}}(M)\).

  • \(\varDelta (M)=\max \limits _{\mu \in M} \min \limits _{\mu '\ne \mu }|{\mu - \mu '}|\): maximum difference between a moment and its nearest neighbor.

The following proposition provides upper bounds on the difference between empirical extremal moments and theoretical ones. It is valid in 2D as in 3D.

Proposition 3

Let \(d\ge 2\). The errors on \(\mu _d^{\max }\) and \(\mu _d^{\min }\) due to the use of the empirical extremums \(\tilde{\mu }_d^{\max }\), \(\tilde{\mu }_d^{\min }\) are less than \(\frac{1}{4}d^2\varDelta (\varTheta )^2(\mu _d^{\max }-\mu _d^{\min })\).

Proof

Let \(\theta _d^{\max } \in [-\pi /2,\pi /2)\), resp. \(\widetilde{\theta }_d^{\max } \in \varTheta \), such that

$$\begin{aligned} \mu _d(\widetilde{\theta }_d^{\max })&= \max \limits _{\theta _i\in \varTheta }\{\mu _d(\theta _i)\}, \\ \mu _d(\theta _d^{\max })&= \max \limits _{\theta \in [-\pi /2,\pi /2)}\{\mu _d(\theta )\}. \end{aligned}$$

Then, \(\theta _d^{\max } \in [\theta _i, \, \theta _{i+1}]\) for some i such that \(0 \le i < n\).

Put \(\mu _d^{\max } = \mu _d(\theta _d^{\max })\), resp. \(\widetilde{\mu }_d^{\max } = \mu _d(\widetilde{\theta }_d^{\max })\).

Then, \(\mu _d^{\max } - \widetilde{\mu }_d^{\max } \le \mu _d(\theta _d^{\max }) - \mu _d(\theta _i)\). The finite Taylor series with the Lagrange remainder term is developed for \(\mu _d\) at \(\theta = \theta _d^{\max }\) where its derivative is null. We derive

$$\begin{aligned} {\mu }_d^{\max } - \widetilde{\mu }_d^{\max } \le \mu _d(\theta _d^{\max }) - \mu _d(\theta _i) \nonumber \\ \le \dfrac{1}{2} (\theta _d^{\max } - \theta _i)^2 \max _{\theta \in \mathbb {R}}\left| \dfrac{\,\hbox {d}^2\mu _d}{\,\hbox {d}\theta ^2}\right| . \end{aligned}$$
(8)

Then, as \(\theta _d^{\max } \in [\theta _i, \, \theta _{i+1}]\), we have

$$\begin{aligned} {\mu }_d^{\max } - \widetilde{\mu }_d^{\max } \le \dfrac{1}{2} \varDelta (\varTheta )^2 \max _{\theta \in \mathbb R}\left| \,\dfrac{\,\hbox {d}^2\mu _d}{\,\hbox {d}\theta ^2}\, \right| . \end{aligned}$$

As \(\mu _d\) is a trigonometric polynomial of degree d, we derive from Bernstein’s inequality that

$$\begin{aligned} {{\mu }_d^{\max } - \widetilde{\mu }_d^{\max }} \le \dfrac{1}{4} \, d^2 \, \varDelta (\varTheta )^2 \, (\mu _d^{\max }-\mu _d^{\min }). \end{aligned}$$

Similarly, we get

$$\begin{aligned} {\widetilde{\mu }_d^{\min } - \mu _d^{\min }} \le \dfrac{1}{4} \, d^2 \, \varDelta (\varTheta )^2 \, (\mu _d^{\max }-\mu _d^{\min }). \end{aligned}$$

We have seen that the errors on the extremum moments are asymptotically negligible as the number of projections grows. So, we can consider building the weights of the graph G from the Taylor expansions of Eq. (6). We distinguish two kinds of edges in G: the edges between projections whose second-order moment is less than a threshold a(M) (resp. greater than a threshold b(M)) and the edges between the projections whose second-order moments lie between a(M) and b(M). The relative positions of \(\mu _2^{\min }\), \(\mu _2^{\max }\), \(\tilde{\mu }_2^{\min }\), \(\tilde{\mu }_2^{\max }\), a(M) and b(M) are shown in Fig. 1. The values of a(M) and b(M) have to be set according to Proposition 4 in order to ensure the convergence of the edge weights toward the angular difference.

Fig. 1
figure 1

Relative positions of \(\mu _2^{\min }\), \(\mu _2^{\max }\), \(\tilde{\mu }_2^{\min }\), \(\tilde{\mu }_2^{\max }\), a(M) and b(M) in the noiseless case

Definition 3

(Local angular difference weight) For two neighboring directions \(\theta _i, \theta _j\), the weight \(w_{i,j}\) between the two corresponding projections \(\mathcal {P}(\theta _i), \mathcal {P}(\theta _j)\) is set as follows.

  • if \(\mu _2(\theta _i) < a(M)\) and \(\mu _2(\theta _j) < a(M)\),

    $$\begin{aligned} w_{i,j} = \dfrac{|{\sqrt{\mu _{2}(\theta _i) - \tilde{\mu }_2^{\min }}-\sqrt{\mu _{2}(\theta _j) - \tilde{\mu }_2^{\min }}}|}{\sqrt{\tilde{\mu }_2^{\max } - \tilde{\mu }_2^{\min }}}; \end{aligned}$$
    (9)
  • if \(\mu _2(\theta _i) > b(M)\) and \(\mu _2(\theta _j) > b(M)\),

    $$\begin{aligned} w_{i,j} = \dfrac{|{\sqrt{\tilde{\mu }_2^{\max } - \mu _{2}(\theta _i)}-\sqrt{\tilde{\mu }_2^{\max } - \mu _{2}(\theta _j)}}|}{\sqrt{\tilde{\mu }_2^{\max } - \tilde{\mu }_2^{\min }}}; \end{aligned}$$
    (10)
  • else,

    $$\begin{aligned} w_{i,j} = \dfrac{|\mu _{2}(\theta _j) - \mu _{2}(\theta _i)|}{ \sqrt{(\tilde{\mu }_2^{\max } - \mu _{2}(\theta _\xi )) (\mu _{2}(\theta _\xi ) - \tilde{\mu }_2^{\min })}}, \end{aligned}$$
    (11)

    where \(\xi \in \{i,j\}\) and \(|{\mu _2(\theta _\xi )-\frac{\widetilde{\mu }_2^{\max }+\widetilde{\mu }_2^{\min }}{2}}|\) is minimal.

Proposition 4 gives conditions on a(M) and b(M) to have the computed weight \(w_{i,j}\) converging toward the angular difference as \(\varDelta (\varTheta )\) tends to 0.

Proposition 4

If the thresholds a(M) and b(M) are such that \(a(M)-\tilde{\mu }_2^{\min }\) and \(\tilde{\mu }_2^{\max } - b(M)\) are asymptotically bounded both from above and below by \(\varDelta (M)^{\alpha }\) for some \(\alpha \in (0, 2/3)\), then, for any \(0\le i,j < n\) such that \(|{\theta _i-\theta _j}|\in O(\varDelta (\varTheta ))\),

  • if \(\mu _2(\theta _i) \in [a(M), b(M)]\) or \(\mu _2(\theta _j) \in [a(M), b(M)]\),

    $$\begin{aligned} w_{i,j} ={\hbox {d}_{ang}}\big (\mathcal {P}(\theta _i), \mathcal {P}(\theta _j)\big )+ o\big (\varDelta (\varTheta )\big ); \end{aligned}$$
  • else,

    $$\begin{aligned} w_{i,j} ={\hbox {d}_{ang}}\big (\mathcal {P}(\theta _i), \mathcal {P}(\theta _j)\big ) + O\big (\varDelta (\varTheta )\big ). \end{aligned}$$

The proof of Proposition 4 is given in “Proof of Proposition 4.”

The estimation errors when using only one of the three formulae of the weight \(w_{i,j}\) in Definition 3 are shown in Figure 2 in which the estimation error is calculated by

$$\begin{aligned} |{w_{i,j} - {\hbox {d}_{ang}}\big (\mathcal {P}(\theta _i), \mathcal {P}(\theta _j)\big )}| \, / \, {\hbox {d}_{ang}}\big (\mathcal {P}(\theta _i), \mathcal {P}(\theta _j)\big ). \end{aligned}$$

We see that Formula (9) gives a better result than the others for the projection pairs lying close to \(\mu _2^{\min }\) and similarly with Formula (10) for the projection pairs lying close to \(\mu _2^{\max }\) and Formula (11) for the projection pairs that are far enough from \(\mu _2^{\min }\) and \(\mu _2^{\max }\). Therefore, the combination of these three formulae gives us a good estimation result. The setting of the two thresholds a(M) and b(M) for separating these three formulae is given in the next section.

Fig. 2
figure 2

Angular difference estimation errors caused by the three formulae given in Definition 3

3.4 Angular Difference Estimation Algorithm

We propose an algorithm for the estimation of the angular difference between any two projections from the projection set \(\varPi \). We first calculate the dth-order moments of the projections in \(\varPi \) for \(d \in \{2, 3, 4, 5\}\). Then, the neighbors of each projection \(\mathcal {P}(\theta )\) are found thanks to the moment intervals \(|{\mu _d(\theta )}| \pm \varepsilon _d(\theta )\) described in Sect. 3.2. The threshold \(\varepsilon _d(\theta )\) is calculated using Formula (7) in Proposition 2 by setting the probability p to 0.95. Note that there are different sets of neighboring projections found according to the different orders of moment. The final result of the neighbor search is then obtained by intersecting these sets of neighboring projections. Here, the order d is set to 2, 3, 4 and 5 since the higher-order moments are sensitive to noise and do not improve the search result.

Next, the angular differences between the neighboring projections are estimated through the three formulae given in Definition 3. In order to separate the use of these three formulae, a(M) is set to \(\tilde{\mu }_2^{\min } + \varDelta (M)^{1/2}\) and b(M) is set to \(\tilde{\mu }_2^{\max } - \varDelta (M)^{1/2}\) according to the conditions in Proposition 4.

Then, we build a neighborhood graph whose vertices are the projections and whose edges connect the neighboring projections and are weighted by the estimated angular differences. Eventually, the angular difference between any two projections on the graph is estimated by using a shortest path algorithm such as Dijkstra’s algorithm. The estimation process is summarized in Algorithm 1.

figure e

3.5 Dealing with Noise

This section addresses the problem of noise that usually contaminates the projections during the acquisition process. Assuming that the noise is modeled as a white-centered Gaussian noise, we first denoise the projection set using a method developed by Wu and Singer [22]. Even if the whole step of this method is not applied, it is nevertheless called here the Wu–Singer denoising method. The main idea of this method is to analyze the projection set using a PCA decomposition [13] combined with an optimized Wiener filter and a graph denoising technique [28].

Noise also propagates to the projection moments and leads to computational errors not only in the searching formula exhibited in Proposition 2 but also in the estimation formulae given in Definition 3. Assuming noisy projections \(\widehat{\mathcal {P}}(\theta ) = \mathcal {P}(\theta ) + \mathfrak {E}(\theta )\), where \(\mathfrak {E}(\theta ) \sim \mathcal {N}(0, \sigma ^2)\) is a Gaussian noise vector with zero mean and variance \(\sigma ^2\) on each coordinate, we can easily prove that the dth-order moment \(\widehat{\mu }_d(\theta )\) of a noisy projection follows the Gaussian distribution with mean \(\mu _d(\theta )\) and variance \(\varSigma ^2\), where

$$\begin{aligned} \varSigma = \left( \int \limits _{-1}^{1} x^{2d}\,\sigma ^2\,\mathrm{d}x\right) ^{\frac{1}{2}} = \dfrac{\sigma }{\sqrt{d + 1/2}}. \end{aligned}$$

As the noise can increase the gap between the theoretical extremal moments and the empirical ones, it is necessary to estimate the former. Under the assumption of a uniform angle distribution, we derive from (6) the probability density function of \(\mu _2\) as follows:

$$\begin{aligned} P(\mu _2) = \frac{1}{\pi }\times \dfrac{1}{2\sqrt{(\mu _2^{\max } - \mu _2)(\mu _2 - \mu _2^{\min })}}. \end{aligned}$$
(12)

When the angle distribution is not uniform, one has to replace \(1/\pi \) in the above formula by

$$\begin{aligned} f\left( \arcsin \big ( \, \sqrt{(\mu _2-\mu _2^{\min })/(\mu _2^{\max } - \mu _2^{\min })} \, \big )\right) , \end{aligned}$$

where f is the p.d.f. of the angles. Then, the probability density function of \(\widehat{\mu }_2\) is obtained by the convolution between P and the probability density function of the Gaussian noise with zero mean and variance \(\varSigma ^2\).

$$\begin{aligned} \widehat{P}(\widehat{\mu }_2) = \int \limits _{\mu _2^{\min }}^{\mu _2^{\max }} P(\mu _2)\dfrac{1}{\sqrt{2\pi }\varSigma }\exp \left( {\dfrac{-(\widehat{\mu }_2 - \mu _2)^2}{2\varSigma ^2}}\right) \hbox {d}\mu _2. \end{aligned}$$
(13)

Figure 3 shows the shapes of P and \(\widehat{P}\) at different levels of noise. Note that the relative positions of \(\mu _2^{\min }\), \(\mu _2^{\max }\), \(\tilde{\mu }_2^{\min }\), \(\tilde{\mu }_2^{\max }\), a(M) and b(M) in case of even moderate noise will likely be changed as in Fig. 4 (compare with Fig. 1).

Fig. 3
figure 3

Probability density of the second-order noisy moment without noise and with different variances of noise

Fig. 4
figure 4

Relative positions of \(\mu _2^{\min }\), \(\mu _2^{\max }\), \(\tilde{\mu }_2^{\min }\), \(\tilde{\mu }_2^{\max }\), a(M) and b(M) in case of noise

The two extremal moments \(\mu _2^{\min }\) and \(\mu _2^{\max }\) can be estimated using the maximum likelihood by

$$\begin{aligned} (\widehat{\mu }_2^{\min }, \widehat{\mu }_2^{\max }) = {\text {argmax}} \prod \limits _{m\in \widehat{M}} \widehat{P}(m\, | \, \min \widehat{M}, \max \widehat{M}), \end{aligned}$$
(14)

where \(\widehat{M} = \{\widehat{\mu }_2(\theta _i)\mid 1\le i \le n\}\).

We did not find an analytical solution for Eq. (14). It is therefore solved using the numerical approach.

The efficiency of the Wu–Singer denoising method and the extremum estimation is shown in Sect. 5.

4 Estimation of Angular Difference in 3D

We now consider the 3D case. Let f be a 3D object whose centroid is at the origin, n be a positive integer and \(\varTheta = \lbrace (\varphi _i, \theta _i, \psi _i) \, | \, 1 \le i \le n \rbrace \) be a set of unknown directions included in \([-\pi / 2, \pi / 2)^3\). We set \(\varPi = \lbrace \mathcal {P}(\varphi _i, \theta _i, \psi _i) \, | \, 1 \le i \le n \rbrace \), the set of projections associated with \(\varTheta \), and \(\hbox {V} = \lbrace v_{\mathcal {P}}(\varphi _i, \theta _i)\, | \, 1 \le i \le n \rbrace \), the set of direction vectors of \(\varPi \). Our goal is to estimate the absolute angular difference between two projections from the set of projections \(\varPi \). Since we cannot distinguish a projection direction from its antipodal direction, the computed angular difference will lie in \(\mathbb R/\pi \mathbb Z\) identified with \((-\pi /2, \pi /2]\) and its absolute value given in \([0,\pi /2]\).

The estimation procedure is almost identical to the 2D case. We first show the estimation formula of the angular difference between the neighboring projections. The angular difference between two projections \(\mathcal {P}\) and \(\mathcal {P}^{'}\) in 3D can be calculated by the inner product between the two direction vectors \(v_{\mathcal {P}}\) and \(v_{\mathcal {P}^{'}}\):

$$\begin{aligned} {\hbox {d}_{ang}}(\mathcal {P}, \mathcal {P}^{'}) = \arccos \left( |{v_{\mathcal {P}}\, . \, v_{\mathcal {P}^{'}}}| \right) . \end{aligned}$$
(15)

We take from [20] the direction vector expression,

$$\begin{aligned} v_{\mathcal {P}}(\varphi , \theta ) = \left( v_{\mathcal {P}}^1, \, v_{\mathcal {P}}^2, \, v_{\mathcal {P}}^3 \right) ^{T}, \end{aligned}$$
(16)

where (omitting the argument \((\varphi , \theta , \psi )\) in \(\mu _{2,0}\) and \(\mu _{0,2}\)):

$$\begin{aligned} v_{\mathcal {P}}^i = \pm \left( \dfrac{(\mu ^i - \mu _{2,0}) \, (\mu ^i - \mu _{0,2})}{(\mu ^i - \mu ^j)(\mu ^i - \mu ^k)} \right) ^{1/2}, \end{aligned}$$
(17)

with

  • \(\{i,j,k\}=\{1,2,3\}\),

  • \((\mu ^1,\mu ^2,\mu ^3)=(\mu ^{\max },\mu ^{\mathrm{med}},\mu ^{\min })\), where

    $$\begin{aligned} \mu ^{\max }= & {} \max \limits _{(\varphi , \theta , \psi ) \in \mathbb {R}}\max (\mu _{2,0}, \mu _{0,2}), \\ \mu ^{\mathrm{med}}= & {} \max \limits _{(\varphi , \theta , \psi ) \in \mathbb {R}}\min (\mu _{2,0}, \mu _{0,2}), \\= & {} \min \limits _{(\varphi , \theta , \psi ) \in \mathbb {R}}\max (\mu _{2,0}, \mu _{0,2}),\\ \mu ^{\min }= & {} \min \limits _{(\varphi , \theta , \psi ) \in \mathbb {R}}\min (\mu _{2,0}, \mu _{0,2}). \end{aligned}$$

There are four possible solutions for Eq. (15) due to the unknown signs in Eq. (17). This corresponds to the direction vectors lying on four different octants of the coordinate system. The solution of Eq. (15) can be unique by making the assumption that both of the neighboring projections are in the same octant. This assumption leads to very few, and very small, errors if the number of projections is large enough. Then, under this assumption, Eq. (15) comes down to

$$\begin{aligned} {\hbox {d}_{ang}}(\mathcal {P}, \mathcal {P}^{'}) = \arccos \left( \sum \limits _{i = 1}^{3}{ | v_{\mathcal {P}}^i \, v_{\mathcal {P}^{'}}^i} | \right) . \end{aligned}$$
(18)

We now deal with the problem of searching the neighboring projections. As shown in 2D (Sect. 3), the search of projection neighbors is based on the calculation of projection moment intervals for different moment orders. This approach cannot be applied directly to 3D, because the projection moments depend on the projection rotation (by the angle \(\psi \)) which is unknown. Thus, the moment values of two neighboring projections may be very different according to the projection rotation. Therefore, instead of using the standard moments, we employ the seven Hu moments defined in [12] which are invariant by rotation. These moments are linear combinations of standard moments. Knowing that the standard moments are trigonometric polynomials (Proposition 1) and the set of trigonometric polynomials is a ring, we derive that Hu moments are also trigonometric polynomials. Let \(\mathcal {M}^{h}(\varphi , \theta )\) be the hth Hu moment of the projection \(\mathcal {P}(\varphi ,\theta ,\psi )\), \(h = 1\ldots 7\). The value of \(\mathcal {M}^{h}(\varphi , \theta )\) is calculated as follows (omitting the argument \((\varphi , \theta , \psi )\)):

$$\begin{aligned} \mathcal {M}^{1}= & {} \mu _{2,0} + \mu _{0,2}, \\ \mathcal {M}^{2}= & {} (\mu _{2,0} - \mu _{0,2})^2 + 4\mu ^2_{1,1}, \\ \mathcal {M}^{3}= & {} (\mu _{3,0} - 3\mu _{1,2})^2 + (3\mu _{2,1} - \mu _{0,3})^2, \\ \mathcal {M}^{4}= & {} (\mu _{3,0} + \mu _{1,2})^2 + (\mu _{2,1} + \mu _{0,3})^2,\\ \mathcal {M}^{5}= & {} (\mu _{3,0} - 3\mu _{1,2})(\mu _{3,0}+\mu _{1,2})((\mu _{3,0}+\mu _{1,2})^2 \\&- \,3(\mu _{2,1} + \mu _{0,3})^2) + (3\mu _{2,1} - \mu _{0,3})(\mu _{2,1}+\mu _{0,3})\\&(3(\mu _{3,0}+\mu _{1,2})^2 - (\mu _{2,1} + \mu _{0,3})^2),\\ \mathcal {M}^{6}= & {} (\mu _{2,0} - \mu _{0,2})((\mu _{3,0} + \mu _{1,2})^2 - (\mu _{2,1} + \mu _{0,3})^2) \\&+\,4\mu _{1,1}(\mu _{3,0} + \mu _{1,2})(\mu _{2,1}+\mu _{0,3}),\\ \mathcal {M}^{7}= & {} (3\mu _{2,1} - \mu _{0,3})(\mu _{3,0}+\mu _{1,2})((\mu _{3,0}+\mu _{1,2})^2 \\&-\, 3(\mu _{2,1} + \mu _{0,3})^2) - (\mu _{3,0} - 3\mu _{1,2})(\mu _{2,1}+\mu _{0,3})\\&(3(\mu _{3,0}+\mu _{1,2})^2 - (\mu _{2,1} + \mu _{0,3})^2). \end{aligned}$$

Note that the order of \(\mathcal {M}^h\) is the degree of the trigonometric polynomial. In order to select the pairs of neighboring projections, for each moment \(\mathcal {M}^h(\varphi ,\theta )\) of a projection \(\mathcal {P}(\varphi ,\theta ,\psi )\), an interval \(\mathcal {M}^h(\varphi ,\theta ) \pm \varepsilon _{\mathcal {M}^h}(\varphi ,\theta )\) is calculated for finding at least one other Hu moment \(\mathcal {M}^h(\varphi ',\theta ')\) corresponding to a neighbor of \(\mathcal {P}(\varphi ,\theta ,\psi )\). The value of \(\varepsilon _{\mathcal {M}^h}(\varphi ,\theta )\) is calculated as follows.

Proposition 5

Let \(f:\mathbb {R}^{3} \rightarrow [0, 1]\) be a 3D object and let \(p \in [0, 1]\). Assuming that the projection directions are uniformly distributed on the hemisphere, then for each Hu moment \(\mathcal {M}^h_i\) of a projection \(\mathcal {P}_i\) taken at the direction \(v_{\mathcal {P}_i}\), \(h = 1\ldots 7\), there exists an interval bounded by \(\mathcal {M}^h_i \pm \varepsilon _{\mathcal {M}^h}\) in which can be found, with probability p, at least one Hu moment \(\mathcal {M}^h_j\) of a projection \(\mathcal {P}_j\) taken at the direction \(v_{\mathcal {P}_j}\), \(\mathcal {M}^h_i\ne \mathcal {M}^h_j\) and \(v_{\mathcal {P}_j}\) is close to \(v_{\mathcal {P}_i}\). The half-width \(\varepsilon _{\mathcal {M}^h}\) is such that

$$\begin{aligned} \varepsilon _{\mathcal {M}^h} = \pi \big (1 - (1 - p)^{\frac{1}{n - 1}}\big )^{\frac{1}{3}}\ \xi _h, \end{aligned}$$
(19)

where \(\xi _h = k \max \limits _{1\le j\le n}(|{\mathcal {M}^h(\varphi _j, \theta _j)}|\), \(k = 2, 4, 6, 6, 12, 8, 12\) being the order of \(\mathcal {M}^h\) for \(h = 1\ldots 7\), respectively.

The proof of Proposition 5 is given in “Proof of Proposition 5.”

Remark 2

As in 2D, the proof of Proposition 5 can be adapted in order to drop the angle uniform distribution assumption. Let \(\lambda _1\), \(\lambda _2\) be the p.d.f. of the angles \(\varphi \) and \(\theta \). Then, in Eq. (19), the term \(\big (1 - (1 - p)^{\frac{1}{n - 1}}\big )^{\frac{1}{3}}\) should be replaced by \(\alpha \in \Lambda ^{-1}\left( \tfrac{1}{4} \big (1 - (1 - p)^{\frac{1}{n - 1}}\big )\right) \) where \(\Lambda \) is the non-decreasing function

with \(\tilde{\lambda }_1 = \lambda _1\circ (-\text {id})\) (resp. \(\tilde{\lambda }_2 = \lambda _2\circ (-\text {id})\)) and \(\star \) is the convolution.

After finding the neighbors, we build a neighborhood graph whose vertices are the projections and whose edges connect the neighboring projections and are weighted by the angular differences estimated from Eq. (18). Finally, the angular difference between any two projections on the neighborhood graph can be calculated using a shortest path algorithm.

Recall that our method in 2D linearizes the Salzman’s formula (6) in order to reduce the noise effect. However, since the linearization of the corresponding 3D Eq. (18) is not as simple as in 2D, this step is skipped. As in the 2D case, the value of \(\mu ^{\max }\), \(\mu ^{\mathrm{med}}\) and \(\mu ^{\min }\) used in (18) and (19) can only be estimated from the finite set of projections. Nevertheless, thanks to Proposition 3, which is still valid in 3D, we can neglect the errors on \(\mu ^{\max }\), \(\mu ^{\mathrm{med}}\) and \(\mu ^{\min }\). With noisy projections, the Wu–Singer denoising method is used to denoise the projection set, but the maximum likelihood estimation of \(\mu ^{\max }, \mu ^{\mathrm{med}}\) and \(\mu ^{\min }\) is also skipped due to the high computational complexity. However, even if the linearization of Salzman’s Formula and the extremum estimation are not applied in 3D, the experimental results (Sect. 5) show that our method outperforms the Euclidean distance for the angular difference estimation.

Fig. 5
figure 5

Examples of 2D phantoms with different resolutions

Fig. 6
figure 6

Examples of 1D projections at different levels of noise

The proposed method for estimating the angular differences between tomographic projections in 2D and 3D is now called Moment-based Angular Difference Estimation (MADE) method. All steps of the MADE method are summarized below.

\(Step\; 1\)::

Denoising of the projection set using the Wu–Singer denoising method [22].

\(Step\; 2\)::

Computation of the projection moments from the projection set. In 2D, the moments \(\mu _d\), \(2\le d \le 5\), are calculated by Eq. (1). In 3D, the moments \(\mu _{c,d}\), \(0\le c, d\le 3\), are calculated by Eq. (5). Then the seven Hu moments \(\mathcal {M}^h\), \(1\le h\le 7\), are calculated from \(\mu _{c,d}\).

\(Step\; 3\)::

Estimation of the extremum moments: This step is only available in 2D where \(\mu _2^{\min }\) and \(\mu _2^{\max }\) are estimated as shown in Sect. 3.5.

\(Step\; 4\)::

Selection of the neighbors of each projection by thresholding. In 2D, the threshold \(\varepsilon _d\) is calculated by Eq. 7. In 3D, the threshold \(\varepsilon _{\mathcal {M}^h_i}\) is calculated by Eq. 19.

\(Step\; 5\)::

Computation of the angular differences between the neighboring projections. In 2D, the formulae in Definition 3 are used. In 3D, Formula (18) is used.

\(Step\; 6\)::

Construction of the neighborhood graph whose vertices are the projections and whose edges link the neighboring projections found in Step 4 and are weighted by the angular differences calculated in Step 5.

\(Step\; 7\)::

Computation of the angular difference between any two projections using a shortest path algorithm on the neighborhood graph.

5 Experimental Results

5.1 Experiments in 2D

Our method is tested on a set of fifty 2D phantom images at resolutions \(32^2, \, 64^2, \, 128^2\) and \(256^2\) pixels. The phantoms are generated automatically using our program. Examples of the phantoms are shown in Fig. 5, and their 1D projections at different levels of noise are shown in Fig. 6.

5.1.1 Noiseless Case

A first experiment aims at testing the robustness of the MADE estimation formulae given in Definition 3, in case the angular difference between two projections is small (e.g., neighboring projections). In this first experiment, 200 pairs of angular values \((\theta , \varDelta \theta )\) are randomly generated for each phantom, where \(\theta \in [-90^\circ ,90^\circ )\) and \(\varDelta \theta \in [1^\circ , 2^\circ ]\). The projections \(\mathcal {P}(\theta )\) and \(\mathcal {P}(\theta + \varDelta \theta )\) are computed for each pair \((\theta , \varDelta \theta )\). The angular difference between \(\mathcal {P}(\theta )\) and \(\mathcal {P}(\theta + \varDelta \theta )\) is then estimated using the MADE estimation formulae. Note that the two extreme projection moments \(\mu _2^{\max }\) and \(\mu _2^{\min }\) are calculated from the set of moment values provided by the 200 pairs \((\mu _2(\theta ), \, \mu _2(\theta + \varDelta \theta )\). We also apply the Salzman’s Method (SM) presented in Sect. 3.1 to estimate the angular difference between each projection pair \((\mathcal {P}(\theta ), \mathcal {P}(\theta + \varDelta \theta ))\). The Euclidean distance (ED) between \(\mathcal {P}(\theta )\) and \(\mathcal {P}(\theta + \varDelta \theta )\) is also computed. The purpose of this experiment is to measure the dispersion of the estimated angular difference using MADE (resp. SM) and ED w.r.t the ground truth of the angular difference \({\hbox {d}_{ang}}(\mathcal {P}(\theta ), \, \mathcal {P}(\theta + \varDelta \theta )) = \varDelta \theta \). We used in [18] the variance-to-mean ratio to measure the variation, but here we prefer to employ the root-mean-squared deviation (RMSD) since the result obtained from the RMSD is more accurate. The RMSD is defined as follows

$$\begin{aligned} \hbox {RMSD}(\widehat{X}) = \dfrac{100}{\widehat{X}_{\max } - \widehat{X}_{\min }} \sqrt{\dfrac{\sum _{i = 1}^{n}(X_i - \widehat{X}_i)^2}{n}} ~(\text {in } \%), \end{aligned}$$

where \(\widehat{X}\) is the estimator of X, \(\widehat{X}_{\max } = \max _{1\le i\le n}(\widehat{X}_i)\), \(\widehat{X}_{\min } = \min _{1\le i\le n}(\widehat{X}_i)\). Lower values of the RMSD indicate less residual variance of \(\widehat{X}\). The results of this first experiment are shown in Fig. 7. It is clear that the dispersion of ED (a) is much higher than that of SM (b) and MADE (c). Moreover, the dispersion of SM is slightly lower than that of MADE. This is understandable since our method MADE is the linearization of the SM formula.

Fig. 7
figure 7

First experiment (local case): dispersion of ED (a), SM (b) and MADE (c) between two neighboring projections in 2D for phantom of \(128^2\) pixels

More quantitative results w.r.t the phantom resolutions are shown in Table 1a (local case). We see that the RMSDs of MADE and SM are less than \(5.2\,\%\) at all resolutions.

Table 1 RMSD (%) of Salzman’s Method (SM) and our method MADE in 2D w.r.t the phantom resolutions (in pixels) for the noiseless case
Fig. 8
figure 8

Second experiment (global case): dispersion of ED (a), SM (b) and MADE (c) between any two projections in 2D for phantom of \(128^2\) pixels

Fig. 9
figure 9

Third experiment. RMSD (%) of ED, SM, MADES, MADE w.r.t. the SNR in 2D. Test with phantoms of \(128^2\) pixels, without (a) and with (b) maximum likelihood estimation of the extremum moments \(\widehat{\mu }_2^{\min }\) and \(\widehat{\mu }_2^{\max }\) (a) without estimation of \(\widehat{\mu }_2^{\min }\) and \(\widehat{\mu }_2^{\max }\) (b) with estimation of \(\widehat{\mu }_2^{\min }\) and \(\widehat{\mu }_2^{\max }\)

In the second experiment, the angular difference estimation between any two projections is calculated. For this, 200 angles \(\theta \in [-90^\circ , 90^\circ )\) are randomly generated for each phantom. The corresponding projections \(\mathcal {P}(\theta )\) are then computed. The angular differences between any two projections are estimated by MADE with all the steps described in Algorithm 1. ED and SM are also applied and compared with MADE. As shown in Fig. 8, the dispersion of ED (a) is again much higher than that of SM (b) and MADE (c). The dispersions of SM and MADE are not very different. The estimation results w.r.t the phantom resolutions are shown in Table 1b (global case). The RMSD of SM and MADE is very low (\({<}1\,\%\)) for all resolutions. Also note that the RMSD of the global case decreases significantly compared to the local one. This can be explained by the fact that in 2D the shortest path algorithm allows to reduce the global error compared to the sum of the local errors. In addition, the RMSD is averaged over the angle interval which is very small in the local case (\(\sim [0^\circ , 2^\circ ]\)) compared to the global one (\(\sim [0^\circ , 90^\circ ]\)).

The first two experiments show that the methods MADE and SM give a good angular difference estimation between projections, with small dispersions compared to those of ED. In addition, since MADE is obtained as an approximation of SM, the result of SM is better than the result of MADE for the noiseless case.

5.1.2 Noisy Case

The noise robustness of SM and MADE is now tested in the third experiment without using the denoising method described in Step 1 of Sect. 4. White noise is added to projections with different values of the signal-to-noise ratio (SNR). The SNR is defined by

$$\begin{aligned} \hbox {SNR} = 10 \, \log _{10}\left( \dfrac{Var(S)}{Var(N)} \right) , \end{aligned}$$

where Var(S) is the signal variance and Var(N) is the noise variance. Then, a similar procedure to that used in the second experiment is applied. Moreover, we also test in this experiment a variation of MADE in which the edges of the graph G are weighted by Salzman’s Formula (6) rather by its linearization. This new version is named MADES to distinguish it from the original one. The extremum moment estimations \(\widehat{\mu }_2^{\min }\) and \(\widehat{\mu }_2^{\max }\) are obtained using maximum likelihood (see Section 3.5 for details). For that, we set \(\widehat{\mu }_2^{\min } \in [\hbox {min} \, \widehat{M}, \hbox {med} \, \widehat{M}]\) and \(\widehat{\mu }_2^{\max } \in (\hbox {med} \, \widehat{M}, \hbox {max} \, \widehat{M}]\) thanks to the observation shown in Fig. 4, where \(\widehat{M}\) is the set of noisy moments. Then, the candidates for \(\widehat{\mu }_2^{\min }\) and \(\widehat{\mu }_2^{\max }\) are selected based on Eq. (14). Also note that, the integral in Eq. (13) is approximated using the function integral() in MATLAB.

Figure 9 shows the RMSD of SM, MADES and MADE for SNR varying from 40 dB to 5 dB without (a) and with (b) maximum likelihood estimation of the extremum moments. Lower values of SNR will be tested in the next experiment.

In Fig. 9a, that is without maximum likelihood estimation of the extremum moments, we see that the dispersion of SM is higher than the ones of MADES and MADE. In particular, the RMSD of SM is much higher than the others when the SNR is lower than 25 dB. Also note that the RMSD of MADE is smaller than the RMSD of MADES. This shows that the linearization of Salzman formula gives us a better result when the projections are corrupted by noise. Then, in Fig. 9b, that is with maximum likelihood estimation of the extremum moments, the RMSD of all methods, SM, MADES and MADE is smaller than without the estimation (\({\sim } 2\,\%\)), but the dispersion of SM is still higher than the ones of MADE and MADES. Again, MADE is better than MADES when the noise is high. In Table 2, the RMSD of all methods w.r.t the phantom resolutions is given at a SNR of 25 dB. The RMSD of MADE at all the resolutions is the smallest. The comparison of MADE with MADES shows that the SM formula linearization slightly improves the estimation results.

Table 2 Third experiment: RMSD (%) of SM, MADES, MADE in 2D w.r.t. the phantom resolutions (in pixels) in 2D

We have shown the performance of MADE in 2D compared to SM. The angular difference can also be obtained by means of the projection direction estimation. The Wu–Singer method developed in [22] is known as a good method for the estimation of projection directions. A comparison between our method MADE and the Wu–Singer method is shown in Fig. 10. Note that all the steps of MADE described in Sect. 4 are now fully applied. We see that globally MADE performs better than Wu–Singer, especially when the number of projections is small. For a large number of projection (\({\ge }1000\)), the Wu–Singer method is a bit more robust to noise than MADE when the SNR is higher than 5 dB. But, when the noise level increases, the RMSD of the Wu–Singer method grows up more rapidly than the RMSD of MADE.

Fig. 10
figure 10

Third experiment: RMSD (%) of MADE (a) and the angular difference derived from [22] (b) in 2D w.r.t. the SNR and the numbers of projections for images of \(256^2\) pixels

Fig. 11
figure 11

Examples of 3D phantoms with different resolutions

Fig. 12
figure 12

Examples of 2D projections at different levels of noise

In conclusion, the experiments in 2D show that our method MADE performs better than SM in case of noise and than the Wu–Singer method when the number of projections, or the SNR, is small. The linearization of Salzman formula (6) combined with the extremum moments estimation is useful in case of noise. The preprocessing step allows our method to obtain good results for SNR greater than 0 dB.

5.2 Experiments in 3D

The method MADE is now tested in 3D. A set of fifty 3D phantom images at different resolutions—\(32^3\), \(64^3\), \(128^3\) and \(256^3\) voxels—is generated by our program. Examples of the 3D phantoms and their 2D projections with different levels of noise are shown in Figs. 11 and 12.

5.2.1 Noiseless Case

In this fourth experiment, a set of 1000 triples \((\varphi , \theta , \psi )\) are generated uniformly and randomly on the hemisphere for each phantom, where \(\varphi , \theta , \psi \in [-90^\circ , 90^\circ )\). A set of corresponding projections \(\mathcal {P}(\varphi , \theta , \psi )\) and projection moments \(\mu _{c,d}(\varphi , \theta , \psi )\) are then calculated. The extreme values of \(\mu _{c,d}(\varphi , \theta , \psi )\) are taken from the set of projection moments \(\mu _{c,d}(\varphi , \theta , \psi )\). The neighbors of each projection are found using the Hu moment thresholds defined in Eq. (19). The angular differences between these neighboring projections are then estimated using Formula (18). Finally, the angular differences between any two projections are calculated using a shortest path algorithm on the neighborhood graph. ED is also computed and compared with MADE regarding the dispersion.

Fig. 13
figure 13

Fourth experiment. Dispersion of the angular differences between neighboring projections (local case) in 3D for an phantom of \(128^3\) voxels. a ED, b MADE

Fig. 14
figure 14

Fourth experiment. Dispersion of the angular differences between any two projections (global case) in 3D for an phantom of \(128^3\) voxels. a ED, b MADE

The results are illustrated in Fig. 13 for two neighboring projections (local case) and in Fig. 14 for any two projections (global case). The reader can see that ED (a) varies much more than MADE (b) in both cases. Moreover, the estimation errors of MADE displayed in Fig. 13b are the results of projections lying in different octants of the hemisphere. The number of error cases is small w.r.t the total number of estimated cases and does not affect the estimation results as shown in Table 3, where the RMSD of MADE is lower than \(5.5\,\%\) for the local case and lower than \(6.9\,\%\) for the global case. Also note that the RMSD of the global case does not decrease compared with the local one as in 2D due to two reasons : First the shortest path algorithm does not run well in 3D, and second the angle interval in local case is not small as in 2D \((\sim [0^\circ , 15^\circ ])\) and yields more significant errors than in 2D (including the errors from different octants). Thus the behavior of the global error in 3D is more complicated than in 2D.

This fourth experiment shows that ED in 3D has a high dispersion w.r.t the angular differences between projections, whereas MADE is good for estimating the angular difference with a smaller dispersion.

Table 3 RMSD (%) of MADE in 3D w.r.t the phantom resolutions (in voxels) for the noiseless case

5.2.2 Noisy Case

The noise robustness of MADE in 3D is then evaluated in the fifth experiment. White noise with a given SNR is added to projections. Again, the Wu–Singer denoising method is applied to denoise projections. The estimation results for the different number of projections and at the different levels of noise are shown in Fig. 15 for phantoms of \(128^3\) voxels. Good results are obtained with a RMSD less than \( 10\,\%\) at SNR \({\ge } 10\,\text {dB}\) for the number of projections equal to 1000 and at SNR \(\ge 0\,\text {dB}\) for the number of projections equal to 10000. As in 2D, the angular difference in 3D can also be calculated by means of the projection direction estimation. In particular, the method proposed in [23] gives good estimation results at very low SNR (smaller than \(-10\,\mathrm{dB}\)) and clearly outperforms the results of MADE. Nevertheless, the advantage of our method is that it can be used with a small number of projections, whereas the method in [23] needs a sufficiently large number of projections (\(\ge 10000\)) in order to obtain a good result.

Fig. 15
figure 15

Fifth experiment: The RMSD (%) of MADE in 3D at different levels of noise and with different numbers of projections. The test is performed with images of \(128^3\) voxels. The Wu–Singer method is applied to denoise projections

Another family of direction estimation methods uses the common line technique [8, 15, 17, 27]. The common-line-based method proposed more recently in [21] is robust to noise and can be used in case of a small number of projections. The method is combined with several denoising methods that allow to improve significantly the estimation result. The preprocessing steps are a weak point of our method and need to be more investigated in our further work. However, one of the drawbacks of these common-line- based methods are the runtime complexity. Indeed, the runtime of the method in [21] is a \(O(p^3 \, n^2 + n^3)\) where p is the dimension of the projection space and n is the number of projections. On the other hand, the runtime of our method is faster with a time complexity in \(O(p^2 \, n + n^2)\).

All the experiments in this section were performed on a Linux machine with Xeon 3.20 GHz and 16 GB of RAM. All steps of our method were executed only with one core and were not parallelized. The running time for testing our method on each phantom varies from several seconds to several minutes, depending on the number of projections and the projection dimension.

6 Conclusion

This article addresses the angular difference estimation between tomographic projections.

We propose a new method, MADE, based on the projection moments. The first stage of MADE is to identify the projections that are close, not with respect to the Euclidean distance, but relative to their projection directions. Then, the angular differences between the neighboring projections are evaluated. The process of these two steps involves the calculation of the projection moments with several orders and the estimation of the extreme moments, which intervene in the angle computation. The experimental results on a simulated database with different resolutions show that MADE performs better the selection of the neighboring projections than the Euclidean distance. Regarding the angular difference estimation, the accuracy and the noise robustness of MADE are also better than the other tested methods up to \(-5\,\mathrm{dB}\). Our method can be considered as a potential measure for the projection refinement or the projection classification in the tomographic reconstruction process. As a perspective, we plan to test the method on a real database—especially in the case where the distribution of the projection directions is not uniform—to improve the noise robustness in the 3D case by incorporating more preprocessing steps and to combine MADE with another technique such as the common line.