Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

Rotations defined in \(\mathbb {Z}^3\) are simple yet crucial operations in many image processing applications involving 3D data. One way of designing rotations on \(\mathbb {Z}^3\) is to combine continuous rotations defined on \(\mathbb {R}^3\) with a digitization operator that maps the result back into \(\mathbb {Z}^3\). However, the digitized rotation, though uniformly close to its continuous sibling, often no longer satisfies the same properties. In particular, due to the alteration of distances between points—provoked by the digitization—the bijectivity is lost in general.

In this context, it is useful to understand which 3D digitized rotations are indeed bijective. “Simple” 3D digitized rotations, in particular those around one of the coordinate axes, possess the same properties as 2D digitized rotations. Therefore, an obvious subset of 3D bijective digitized rotations consists of the 2D bijective digitized rotations embedded in \(\mathbb {Z}^3\). Nevertheless, the question of determining whether a non-simple 3D digitized rotation is bijective, remained open.

To our knowledge, few efforts were devoted to understand topological alterations of \(\mathbb {Z}^3\) induced by digitized rotations. The contributions known to us were geared toward understanding these alterations in \(\mathbb {Z}^2\): Andres and Jacob provided some necessary conditions under which 2D digitized rotations are bijective [5]; Andres proposed quasi-shear rotations which are bijective but possibly generate errors, particularly for angles around \(\pi /2\) [1]; Nouvel and Rémila studied the discrete structure induced by digitized rotations that are not bijective but generate no error [12, 14]; moreover, they characterized the set of 2D bijective digitized rotations [13]. More recently, Roussillon and Cœurjolly used arithmetic properties of the Gaussian integers to give a different proof of the conditions for bijectivity of 2D digitized rotations [17]. On the other hand, more general 2D digitized rigid motions—rotations, translations and their compositions—were studied by Ngo et al. [9], with their impact on the topological properties of finite digital grids [10]. Moreover, Ngo et al. established some sufficient conditions for topology preservation under 2D digitized rigid motions [11]. Lately we provided a characterization of the set of 2D bijective digitized rigid motions [16].

In this article, our contribution is as follows. We consider an approach similar to that proposed by Roussillon and Cœurjolly to prove the conditions for bijectivity of 2D digitized rotations using arithmetic properties of Gaussian integers [17]—which are complex numbers whose real and imaginary parts are integers [4]. Indeed, the product of two complex numbers has a geometrical interpretation; more precisely, it acts as a rotation when the norm of the multiplier is one. In our work, we partially extend the results of Roussillon and Cœurjolly to 3D digitized rotations, employing Lipschitz quaternions, which play a similar role to Gaussian integers. However, due to the non-commutative nature of quaternions and their two-to-one relation with 3D rotations, the former approach has not succeeded yet to fully characterize the bijective digitized rotations. Nevertheless, we propose an algorithm which certifies whether a given digitized rotation, defined by a Lipschitz quaternion, is bijective. As a consequence, we cover all the rational rotations, i.e., those whose corresponding matrix representation contains only rational elements—since they correspond to rotations given by Lipschitz quaternions. From the point of view of the applications, excluding a rotation whose matrix has irrational elements is a minor issue, since computers mainly work with rational numbers. Moreover, using rational numbers ensures the exactness of the proposed certification algorithm.

This article is organized as follows. In Sect. 2, we recall the basic definitions of 3D rotations and Lipschitz quaternions. Section 3 provides our framework for studying the bijectivity of digitized rotations in \(\mathbb {Z}^3\). In Sect. 4, we provide an algorithm certifying whether a given rational rotation is bijective or not when digitized in \(\mathbb {Z}^3\). Finally, in Sect. 5, we conclude this article and provide some perspectives.

2 Digitized Rotations in Three Dimensions

A rotation in \(\mathbb {R}^3\) is a bijective isometric map defined as

$$\begin{aligned} \left| \begin{array}{lllll} \mathcal {U}&{} : &{} \mathbb {R}^3 &{} \rightarrow &{} \mathbb {R}^3 \\ &{} &{} \mathbf {x}&{} \mapsto &{} \mathbf {R}\mathbf {x}\end{array} \right. \end{aligned}$$
(1)

where \(\mathbf {R}\) is a 3D rotation matrix. Note that the matrix \(\mathbf {R}\) can be obtained from a rotation angle and axis by Rodrigues’ rotation formula [6, 8, 19] or from a quaternion [6, 19].

2.1 Spatial Rotations and Quaternions

The proposed framework for bijectivity certification uses the formalism of quaternions. These are the elements of the set \(\mathbb {H}= \{a + b i + c j + d k \mid a, b, c, d \in \mathbb {R}\}\) with the following properties:

$$\begin{aligned} \begin{array}{ccc} i^2 = -1, &{}\quad j^2 = -1, &{}\quad k^2 = -1, \\ j k = -k j = i, &{}\quad k i = -i k = j, &{}\quad i j = -j i = k\, . \end{array} \end{aligned}$$

Similarly to the set of complex numbers, \(\mathbb {H}\) possesses a division ring structure, albeit a non-commutative one. More precisely, for \(p,q, r \in \mathbb {H}\):

  • the conjugate of \(q = a + b i + c j + d k\) is defined as \(\bar{q} = a - b i - c j - d k\);

  • the product of two quaternions, defined as

    $$ \begin{matrix} q p = ( a_1 + b_1 i + c_1 j + d_1 k ) ( a_2 + b_2 i + c_2 j + d_2 k ) = \\ a_1a_2 - b_1b_2 - c_1c_2 - d_1d_2 + (a_1b_2 + b_1a_2 + c_1d_2 - d_1c_2)i \\ + (a_1c_2 - b_1d_2 + c_1a_2 + d_1b_2)j + (a_1d_2 + b_1c_2 - c_1b_2 + d_1a_2)k, \end{matrix} $$

    is not commutative, i.e. \(q p \ne p q\), in general, although real numbers, i.e., quaternions such that \(q=\bar{q}\) do commute with all others;

  • the norm of q is defined as \(|q| = \sqrt{q \bar{q}} = \sqrt{\bar{q} q} = \sqrt{a^2 + b^2 + c^2 + d^2}\);

  • the inverse of q is defined as \(q^{-1} = \frac{\bar{q}}{|q|^2}\), so that \( q q^{-1} = q^{-1} q = 1\).

Any point in \(\mathbb {R}^3\) is represented by a pure imaginary quaternion: \(\mathbf {x}= (x_1,x_2,x_3) \simeq x_1 i+ x_2 j + x_3 k\). Then, any rotation \(\mathcal {U}\) can be written as \(\mathbf {x}\mapsto q \mathbf {x}q^{-1}\), where \(\mathbf {x}\in \mathbb {R}^3\) [6, 19]. The quaternion q is uniquely determined up to multiplication by a nonzero real number, and, if \(|q|=1\), up to a sign change: \(q \mathbf {x}q^{-1} = (-q)\mathbf {x}(-q)^{-1}\); hence the correspondence between unit quaternions and rotation matrices is two-to-one. Note that for any unit norm quaternion \(q = a + b i + c j + d k\), a rotation angle \(\theta \) and an axis of rotation \(\pmb {\omega }\) are given as \(\theta = 2 \cos ^{-1} a\), and \(\pmb {\omega } = \frac{(b,c,d)^t}{|(b,c,d)^t|}\), respectively. We refer the reader unfamiliar with quaternions to [2, 6, 19].

2.2 Digitized Rotations

According to Eq. (1), we generally have \(\mathcal {U}(\mathbb {Z}^3) \nsubseteq \mathbb {Z}^3\). As a consequence, to define digitized rotations as maps from \(\mathbb {Z}^3\) to \(\mathbb {Z}^3\), we usually consider \(\mathbb {Z}^3\) as a subset of \(\mathbb {R}^3\), apply \(\mathcal {U}\), and then combine the real results with a digitization operator

$$\begin{aligned} \left| \begin{array}{lllll} \mathcal {D}&{} : &{} \mathbb {R}^3 &{} \rightarrow &{} \mathbb {Z}^3 \\ &{} &{} (x,y,z) &{} \mapsto &{} \left( \left\lfloor x + \frac{1}{2} \right\rfloor , \left\lfloor y + \frac{1}{2} \right\rfloor , \left\lfloor z + \frac{1}{2} \right\rfloor \right) \end{array} \right. \end{aligned}$$

where \(\lfloor s \rfloor \) denotes the largest integer not greater than s. The digitized rotation is thus defined by \(U = \mathcal {D}\circ \mathcal {U}_{\mid \mathbb {Z}^3}\). Due to the behavior of \(\mathcal {D}\) that maps \(\mathbb {R}^3\) onto \(\mathbb {Z}^3\), digitized rotations are, most of the time, non-bijective. This leads us to define the notion of point status with respect to a given digitized rotation.

Definition 1

Let \(\mathbf {y} \in \mathbb {Z}^3\) be an integer point. The set of preimages of \(\mathbf {y}\) with respect to U is defined as \(M_U(\mathbf {y}) = \{ \mathbf {x}\in \mathbb {Z}^3 \mid U(\mathbf {x}) = \mathbf {y}\}\), and \(\mathbf {y}\) is referred to as a s-point, where \(s = |M_U(\mathbf {y})|\) is called the status of \(\mathbf {y}\).

Remark 1

In \(\mathbb {Z}^3\), \(|M_U(\mathbf {y})| \in \{0,1,2,3,4\}\) and one can prove that only points \(\mathbf {p}, \mathbf {q} \in \mathbb {Z}^3\) such that \(|\mathbf {p}- \mathbf {q}| < \sqrt{3}\) can be preimages of a 2-point; points \(\mathbf {p}, \mathbf {q}, \mathbf {r} \in \mathbb {Z}^3\) forming an isosceles triangle of side lengths 1, 1 and \(\sqrt{2}\) can be preimages of a 3-point; points \(\mathbf {p}, \mathbf {q}, \mathbf {r}, \mathbf {s} \in \mathbb {Z}^3\) forming a square of side length 1 can be preimages of a 4-point.

The non-injective and non-surjective behaviors of a digitized rotation result in the existence of s-points for \(s \ne 1\). Figure 1 illustrates a simple 3D rotation which provokes 0- and 2- point statuse.

Fig. 1.
figure 1

Examples of three different point statuses: digitization cells corresponding to 0-, 1- and 2-points are in green, black and red, respectively. White dots indicate the positions of images of the points of the initial set \(\mathbb {Z}^3\) by \(\mathcal {U}\), embedded in \(\mathbb {R}^3\), subdivided into digitization cells around the points of the final set \(\mathbb {Z}^3\), represented by gray triangles. Note that, for readability purpose, \(\mathcal {U}\) is a simple 3D digitized rotation such that \(\theta = \frac{\pi }{9}, \pmb {\omega } =(0,0,1)^t\). Therefore, as for 2D digitized rotations, only 0-, 1- and 2- point statuses are possible. Note that only one 2D slice of 3D space is presented.

3 Bijectivity Certification

3.1 Set of Remainders

Let us compare the rotated digital grid \(\mathcal {U}(\mathbb {Z}^3) = q\mathbb {Z}^3q^{-1}\) with the grid \(\mathbb {Z}^3\). The digitized rotation \(U = \mathcal {D}\circ \mathcal {U}\) is bijective if and only if each digitization cell of \(\mathbb {Z}^3\) contains one and only one rotated point of \(q\mathbb {Z}^3q^{-1}\); in other words, \(\forall \mathbf {y}\in \mathbb {Z}^3, |M_U(\mathbf {y})| = 1\). Let us denote by \(\mathscr {C}(\mathbf {y})\) the digitization cell, i.e. the unit cube, centered at the point \(\mathbf {y}= (y_1,y_2,y_3) \in \mathbb {Z}^3\):

$$ \mathscr {C}(\mathbf {y}) = \left[ y_1 - \frac{1}{2}, y_1 + \frac{1}{2} \right) \times \left[ y_2 - \frac{1}{2}, y_2 + \frac{1}{2} \right) \times \left[ y_3 - \frac{1}{2}, y_3 + \frac{1}{2} \right) . $$

Instead of studying the whole source and target spaces, we study the set of remainders defined by the map

$$\begin{aligned} \left| \begin{array}{llll} S_q: &{} \mathbb {Z}^3 \times \mathbb {Z}^3 &{} \rightarrow &{} \mathbb {R}^3 \\ &{} (\mathbf {x}, \mathbf {y}) &{} \mapsto &{} q \mathbf {x}q^{-1} - \mathbf {y}. \end{array} \right. \end{aligned}$$

Then, the bijectivity of U can be expressed as

$$\begin{aligned} \forall \mathbf {y}\in \mathbb {Z}^3 \; \exists ! \mathbf {x}\in \mathbb {Z}^3, S_q(\mathbf {x},\mathbf {y})\in \mathscr {C}(\mathbf {0}), \end{aligned}$$

which is equivalent to the “double” surjectivity relation, used by Roussillon and Cœurjolly [17]:

$$\begin{aligned} \left\{ \begin{array}{lll} \forall \mathbf {y}\in \mathbb {Z}^3 &{} \exists \mathbf {x}\in \mathbb {Z}^3, &{} S_q(\mathbf {x},\mathbf {y})\in \mathscr {C}(\mathbf {0}) \\ \forall \mathbf {x}\in \mathbb {Z}^3 &{} \exists \mathbf {y}\in \mathbb {Z}^3, &{} S_q(\mathbf {x},\mathbf {y})\in q \mathscr {C}(\mathbf {0}) q^{-1} \end{array} \right. \end{aligned}$$
(2)

provided that both sets \(S_q(\mathbb {Z}^3,\mathbb {Z}^3) \cap \mathscr {C}(\mathbf {0})\) and \(S_q(\mathbb {Z}^3,\mathbb {Z}^3) \cap q \mathscr {C}(\mathbf {0}) q^{-1}\) coincide; in other words, \(S_q(\mathbb {Z}^3,\mathbb {Z}^3) \cap ((\mathscr {C}(\mathbf {0}) \cup q \mathscr {C}(\mathbf {0}) q^{-1}) \setminus (\mathscr {C}(\mathbf {0}) \cap q \mathscr {C}(\mathbf {0}) q^{-1})) = \varnothing \). Hereafter, we shall rely on Formula (2), and in the study of the bijectivity of digitized rotation U, we will focus on the values of \(S_q\). More precisely, we will study the group \(\mathcal {G}\) spanned by values of \(S_q\):

$$\begin{aligned} \mathcal {G}= \mathbb {Z}q \left( {\begin{matrix} 1 \\ 0 \\ 0 \end{matrix}}\right) q^{-1} + \mathbb {Z}q \left( {\begin{matrix} 0 \\ 1 \\ 0 \end{matrix}}\right) q^{-1} + \mathbb {Z}q \left( {\begin{matrix} 0 \\ 0 \\ 1 \end{matrix}}\right) q^{-1} + \mathbb {Z}\left( {\begin{matrix} 1 \\ 0 \\ 0 \end{matrix}}\right) + \mathbb {Z}\left( {\begin{matrix} 0 \\ 1 \\ 0 \end{matrix}}\right) + \mathbb {Z}\left( {\begin{matrix} 0 \\ 0 \\ 1 \end{matrix}}\right) . \end{aligned}$$

3.2 Dense Subgroups and Non-injectivity

The key to understanding the conditions that ensure the bijectivity of U is the structure of \(\mathcal {G}\). For this reason, we start by looking at the image \(\mathcal {G}\) of \(S_q\), and discuss its density.

Proposition 2

If one or more generators of \(\mathcal {G}\) have an irrational term, then \(\mathcal {G}\cap V\) is dense for some nontrivial subspace V. We say that \(\mathcal {G}\) has a dense factor.

On the contrary, we have the following result.

Proposition 3

If all generators of \(\mathcal {G}\) have only rational terms, then there exist vectors \(\pmb {\sigma }, \pmb {\phi }, \pmb {\psi } \in \mathcal {G}\) which are the minimal generators of \(\mathcal {G}\).

Proof

The generators of \(\mathcal {G}\) are given by the rational matrix \(\mathbf {B} = \left[ \mathbf {R}\;|\;\mathbf {I}_3 \right] \) where \(\mathbf {I}_3\) stands for the \(3 \times 3\) identity matrix. As \(\mathbf {B}\) is a rational, full row rank matrix, it can be brought to its Hermite normal form \(\mathbf {H} = [\mathbf {T}\;|\;\mathbf {0}_{3,3}]\), where \(\mathbf {T}\) is a non-singular, lower triangular non-negative matrix and \(\mathbf {0}_{3,3}\) stands for \(3\times 3\) zero matrix, such that each row of \(\mathbf {T}\) has a unique maximum entry, which is located on the main diagonalFootnote 1 [18]. Note that the problem of computing the Hermite normal form \(\mathbf {H}\) of the rational matrix \(\mathbf {B}\) reduces to that of computing the Hermite normal form of an integer matrix: let s stand for the least common multiple of all the denominators of \(\mathbf {B}\) which is given by \(s = |q|^2\); compute the Hermite normal form \(\mathbf {H}'\) for the integer matrix \(s \mathbf {B}\); finally, the Hermite normal form \(\mathbf {H}\) of \(\mathbf {B}\) is obtained by \(s^{-1} \mathbf {H}'\). The columns of \(\mathbf {H}\) are the minimal generators of \(\mathcal {G}\). Notice that the rank of \(\mathbf {B}\) is equal to 3. Therefore, \(\mathbf {H}\) gives a base \((\pmb {\sigma }, \pmb {\phi },\pmb {\psi })\), so that \(\mathcal {G}= \mathbb {Z}\pmb {\sigma } + \mathbb {Z}\pmb {\phi } + \mathbb {Z}\pmb {\psi }\). As \(\mathbf {H}'\) gives an integer base, \(s \mathcal {G}\) is an integer lattice.    \(\square \)

Lemma 4

Whenever \(\mathcal {G}\) is dense, the corresponding 3D digitized rotation is not bijective.

Proof

Since \(\mathcal {G}\) is dense, there exists \(\mu = S_{q} ({\mathbf {x}}, {\mathbf {y}}) \in \mathcal {G}\cap \mathscr {C}(\mathbf {0})\), such that \(\mu + \sigma = S_{q}({\mathbf {x}} +i, {\mathbf {y}})\) also line in \(\mathscr {C}(\mathbf {0})\). Then x and \({\mathbf {x}} + i\) are both preimages of \(\mathbf {y}\) by U, which is therefore not bijective.    \(\square \)

When \(\mathcal {G}\) is dense (see Fig. 2(a)), the reasoning of Nouvel and Rémila, originally used to discard 2D digitized irrational rotations as being bijective [13], shows that a corresponding 3D digitized rotation cannot be bijective as well. What differs from the 2D case is the possible existence of non-dense \(\mathcal {G}\) with a dense factor (see Fig. 2(b)). In this context, we state the following conjecture.

Fig. 2.
figure 2

Illustration of a part of \(\mathcal {G}\) when: (a) \(\mathcal {G}\) is dense; (b) \(\mathcal {G}\) is not dense but has a dense factor – the set of points at each plane is dense while the planes are spaced by a rational distance; (c) \(\mathcal {G}\) is a lattice. In the case of (a) and (b), only some random points are presented, for the sake of visibility. In (c), vectors \(\pmb {\sigma }, \pmb {\phi }, \pmb {\psi }\) are marked in red, blue and green, respectively (Color figure online).

Conjecture 1

Whenever \(\mathcal {G}\) has a dense factor, the corresponding digitized rotation is not bijective.

Henceforth, we will assume that \(\mathcal {G}\) is generated by rational vectors, and forms therefore a lattice (see Fig. 2(c)). In other words, corresponding rotations are considered as rational. The question now remains of comparing the (finitely many) points in \(S_q(\mathbb {Z}^3,\mathbb {Z}^3) \cap \mathscr {C}(\mathbf {0})\) and \(S_q(\mathbb {Z}^3,\mathbb {Z}^3) \cap q \mathscr {C}(\mathbf {0}) q^{-1}\).

3.3 Lipschitz Quaternions and Bijectivity

To represent 2D rational rotations, Roussillon and Cœurjolly used Gaussian integers [17]. In \(\mathbb {R}^3\), rational rotations are characterized as follows [3].

Proposition 5

There is a two-to-one correspondence between the set of Lipschitz quaternions \(\mathbb {L}= \{a + b i + c j + d k \mid a, b, c, d \in \mathbb {Z}\}\) such that the greatest common divisor of abcd is 1, and the set of rational rotations.

Working in the framework of rational rotations allows us to turn to integers: \(|q|^2 \mathcal {G}\) is an integer lattice. As integer lattices are easier to work with from the computational point of view, we do scale \(\mathcal {G}\) by \(|q|^2\) in order to develop a certification algorithm.

Similarly to the former discussion, after scaling \(\mathcal {G}\) by \(|q|^2\), we consider the finite set of remainders, obtained by comparing the lattice \(q \mathbb {Z}^3 \bar{q}\) with the lattice \(|q|^2 \mathbb {Z}^3\), and applying the scaled version of the map \(S_q\) defined as

$$\begin{aligned} \left| \begin{array}{llll} \check{S}_q: &{} \mathbb {Z}^3 \times \mathbb {Z}^3 &{} \rightarrow &{} \mathbb {Z}^3 \\ &{} (\mathbf {x}, \mathbf {y}) &{} \mapsto &{} q \mathbf {x}\bar{q} - q \bar{q} \mathbf {y}. \end{array} \right. \end{aligned}$$
(3)

Indeed, Formula (2) is rewritten as

$$\begin{aligned} \left\{ \begin{matrix} \forall \mathbf {y}\in \mathbb {Z}^3 &{} \exists \mathbf {x}\in \mathbb {Z}^3, \check{S}_q(\mathbf {x},\mathbf {y})\in |q|^2 \mathscr {C}(\mathbf {0}) \\ \forall \mathbf {x}\in \mathbb {Z}^3 &{} \exists \mathbf {y}\in \mathbb {Z}^3, \check{S}_q(\mathbf {x},\mathbf {y})\in q \mathscr {C}(\mathbf {0}) \bar{q}. \end{matrix} \right. \end{aligned}$$
(4)

Note that the right hand sides of Formulae (3) and (4) are left multiples of q. As a consequence, we are allowed to divide them by q on the left, while keeping integer-valued functions. Let us define

$$\begin{aligned} \left| \begin{array}{llll} S'_q: &{} \mathbb {Z}^3 \times \mathbb {Z}^3 &{} \rightarrow &{} \mathbb {Z}^4 \\ &{} (\mathbf {x}, \mathbf {y}) &{} \mapsto &{} \mathbf {x}\bar{q} - \bar{q} \mathbf {y}. \end{array} \right. \end{aligned}$$

Then, the bijectivity of U is ensured when

$$\begin{aligned} \left\{ \begin{array}{lll} \forall \mathbf {y}\in \mathbb {Z}^3 &{} \exists \mathbf {x}\in \mathbb {Z}^3, &{} S'_q(\mathbf {x},\mathbf {y})\in \bar{q} \mathscr {C}(\mathbf {0}) \\ \forall \mathbf {x}\in \mathbb {Z}^3 &{} \exists \mathbf {y}\in \mathbb {Z}^3, &{} S'_q(\mathbf {x},\mathbf {y})\in \mathscr {C}(\mathbf {0}) \bar{q}, \end{array} \right. \end{aligned}$$
(5)

provided that both sets \(S'_q(\mathbb {Z}^3,\mathbb {Z}^3) \cap \bar{q} \mathscr {C}(\mathbf {0})\) and \(S'_q(\mathbb {Z}^3,\mathbb {Z}^3) \cap \mathscr {C}(\mathbf {0}) \bar{q}\) coincide.

4 An Algorithm for Bijectivity Certification

In this section we present an algorithm which indicates whether a digitized rational rotation given by a Lipschitz quaternion is bijective or not. The strategy consists of checking whether there exists \(\mathbf {w} \in ((\bar{q} \mathscr {C}(\mathbf {0}) \cup \mathscr {C}(\mathbf {0}) \bar{q}) \setminus (\bar{q} \mathscr {C}(\mathbf {0}) \cap \mathscr {C}(\mathbf {0}) \bar{q})) \cap \mathbb {Z}^4\) such that \(\mathbf {w} = S_q'(\mathbf {x},\mathbf {y})\). If this is the case, then the rotation given by q is not bijective, and conversely.

Because q is a Lipschitz quaternion, the values of \(S'_q\) span a sublattice \(\check{\mathcal {G}} \subset \mathbb {Z}^4\). Therefore, given a Lipschitz quaternion \(q = a + b i + c j + d k\), solving \(S'_q(\mathbf {x},\mathbf {y}) = \mathbf {w}\) with \(\mathbf {x}, \mathbf {y}\in \mathbb {Z}^3\) for \(\mathbf {w} \in \check{\mathcal {G}}\) leads to solving the following linear Diophantine system:

$$\begin{aligned} \mathbf {Az} = \mathbf {w} \end{aligned}$$
(6)

where \(\mathbf {z}^t = (\mathbf {x},\mathbf {y}) \in \mathbb {Z}^6\) and

The minimal basis \((\check{\pmb {\sigma }},\check{\pmb {\phi }},\check{\pmb {\psi }})\) of \(\check{\mathcal {G}}\) can be obtained from the columns of the Hermite normal form of the matrix \(\mathbf {A}\). Since the rank of \(\mathbf {A}\) is 3, we have \(\check{\mathcal {G}} = \mathbb {Z}\check{\pmb {\sigma }} + \mathbb {Z}\check{\pmb {\phi }} + \mathbb {Z}\check{\pmb {\psi }}\).

Therefore, the problem amounts to: (i) finding the minimal basis \((\check{\pmb {\sigma }}, \check{\pmb {\phi }},\check{\pmb {\psi }})\) of the group \(\check{\mathcal {G}}\) by reducing the matrix \(\mathbf {A}\) to its Hermite normal form; (ii) checking whether there exists a linear combination of these basis vectors \(\mathbf {w} = u \check{\pmb {\sigma }} + v \check{\pmb {\phi }} + w \check{\pmb {\psi }}\), for \(u,v,w \in \mathbb {Z}\) such that \(\mathbf {w} \in (\bar{q} \mathscr {C}(\mathbf {0}) \cup \mathscr {C}(\mathbf {0}) \bar{q}) \setminus (\bar{q} \mathscr {C}(\mathbf {0}) \cap \mathscr {C}(\mathbf {0}) \bar{q})\).

To find points of \(\check{\mathcal {G}}\) that violate Formula (5), we consider points \(\mathbf {w} \in \mathbb {Z}^4 \cap \bar{q} \mathscr {C}(\mathbf {0})\) (or \(\mathbf {w} \in \mathbb {Z}^4 \cap \mathscr {C}(\mathbf {0}) \bar{q}\)) such that \(\mathbf {w} \notin \mathscr {C}(\mathbf {0}) \bar{q}\) (or \(\mathbf {w} \notin \bar{q} \mathscr {C}(\mathbf {0})\)). Then, we verify whether \(\mathbf {w}\) belongs to \(\check{\mathcal {G}}\). The membership verification can be done in two steps. Step 1: we check if Eq. (6) has solutions, while verifying if the following holds:

$$\begin{aligned} a w_1 - b w_2 - c w_3 - d w_4 = 0, \end{aligned}$$

where \(\mathbf {w} = (w_1, w_2, w_3, w_4)\) and \(q = a + b i + c j + d k\). Step 2: we check if Eq. (6) has integer solutions by solving it. This can be done by reducing the matrix \([\mathbf {A}\mid \mathbf {w}]\) to the Hermite normal form. Note that before iterating over points \(\mathbf {w} \in \mathbb {Z}^4 \cap \bar{q} \mathscr {C}(\mathbf {0})\) (or \(\mathbf {w} \in \mathbb {Z}^4 \cap \mathscr {C}(\mathbf {0}) \bar{q}\)), we can first reduce the matrix \(\mathbf {A}\) to its Hermite normal form \(\check{\mathbf {H}}\) and then reduce the augmented matrix \([\check{\mathbf {H}}\mid \mathbf {w}]\), which is computationally less costly, as explained in the following discussion.

All the steps are summarized in Algorithm 1. Figure 3 presents sets of points \(q \mathbf {w} \in q \mathscr {C}(\mathbf {0}) \bar{q} \cup |q|^2 \mathscr {C}(\mathbf {0})\) for some Lipschitz quaternions, which induce bijective digitized rational rotations, while Fig. 4 presents non-bijective cases. Finally, Table 1 lists some examples of Lipschitz quaternions that generate non-simple 3D bijective digitized rotationsFootnote 2.

figure a
Table 1. Examples of Lipschitz quaternions which generate 3D bijective digitized rotations.

The time complexity of Algorithm 1 is given as follows.

Step 1: reduction of the matrix \(\mathbf {A}\) to the Hermite normal form can be done in a polynomial time [18]. For instance, one can apply the algorithm proposed by Micciancio and Warinschi [7] or its more recent, optimized version proposed by Pernet and Stein [15], whose running time complexity for full row rank matrices—with some slight modifications it can handle non-full row rank matrices—is \(\mathcal {O}(m n^4 \log ^2 N(\mathbf {A}))\), where n is the number of rows, m the number of columns and \(N(\mathbf {A})\) stands for a bound on the entries of the matrix \(\mathbf {A}\) [7]. Here \(n = 4\) and \(m = 6\). Thus, the time complexity of Step 1 is \(\mathcal {O}(\log ^2 N(\mathbf {A}))\).

Step 2: the number of points in \(\mathbb {Z}^4 \cap \bar{q} \mathscr {C}(\mathbf {0})\) (resp. \(\mathbb {Z}^4 \cap \mathscr {C}(\mathbf {0}) \bar{q}\)) is bounded by \(|q|^3\). For each point, the time needed to reduce the matrix \([\check{\mathbf {H}} \mid \mathbf {w}]\) to the Hermite normal form is \(\mathcal {O}(n^4 \log ^2 N([\check{\mathbf {H}} \mid \mathbf {w}]))\), where \(n=4\) and \(N([\check{\mathbf {H}} \mid \mathbf {w}])\) is a bound on the entries of the matrix \([\check{\mathbf {H}} \mid \mathbf {w}]\) [7]. Therefore, the time complexity of Step 2 is \(\mathcal {O}(|q|^3 \log ^2 N([\check{\mathbf {H}} \mid \mathbf {w}]))\). Note that determining whether \(\mathbf {w} \notin \mathscr {C}(\mathbf {0}) \bar{q}\) (or \(\mathbf {w} \notin \bar{q} \mathscr {C}(\mathbf {0})\)) can be done in a constant time while checking a set of inequalities.

Finally, we can conclude that the time complexity of Algorithm 1 is given by the complexity of Step 2, namely \(\mathcal {O}(|q|^3 \log ^2 N([\check{\mathbf {H}} \mid \mathbf {w}]))\).

Fig. 3.
figure 3

Visualization of \(q \mathbf {w} \in q \mathscr {C}(\mathbf {0}) \bar{q} \cup |q|^2 \mathscr {C}(\mathbf {0})\) together with \(q \mathscr {C}(\mathbf {0}) \bar{q}\) and \(|q|^2 \mathscr {C}(\mathbf {0})\), for (a) \(q = 3 + k\) and (b) \(q = 3 + 4 i + k\), each of which induce bijective digitized rational rotation. Points \(q \mathbf {w}\) are depicted as blue spheres (Color figure online).

Fig. 4.
figure 4

Visualization of \(q \mathbf {w} \in q \mathscr {C}(\mathbf {0}) \bar{q} \cap |q|^2 \mathscr {C}(\mathbf {0})\) – in blue, \(q \mathbf {w} \in q \mathscr {C}(\mathbf {0}) \bar{q} \setminus |q|^2 \mathscr {C}(\mathbf {0})\) – in red, and \(|q|^2 \mathscr {C}(\mathbf {0}) \setminus q \mathscr {C}(\mathbf {0}) \bar{q}\) – in green, for (a) \(q = 4 + k\) and (b) \(q = 2 - 3 i - 2 j - 5 k\), each of which induces a non-bijective digitized rational rotations (Color figure online).

5 Conclusion

In this article, we showed the existence of non-simple 3D bijective digitized rotations—ones for which a given rotation axis does not correspond to any of the coordinate axes.

The approach is similar to that used by Roussillon and Cœurjolly to prove the conditions for the bijectivity of 2D digitized rotations using Gaussian integers [17]. In our work, we used Lipschitz quaternions, which play a similar role to Gaussian integers. Due to the non-commutative nature of quaternions and their two-to-one relation with 3D rotations, the former approach has not succeeded yet to fully characterize the set of 3D bijective digitized rotations. Nevertheless, we proposed an algorithm that certifies whether a digitized rotation given by a Lipschitz quaternion q is bijective or not. The time complexity of proposed certification algorithm is \(\mathcal {O}(|q|^3 \log ^2 N([\check{\mathbf {H}} \mid \mathbf {w}]))\).

As a part of our future work, we would like to prove Conjecture 1 and find the general solution to Eq. (6), which allows us to characterize the set of 3D bijective digitized rotations. We may also consider images of finite sets (e.g. digital images or pieces of ambient space). The bijective digitized rotations found above will map bijectively any finite subset of \(\mathbb {Z}^3\); but other (non-bijective) rotations may also be bijective when restricted to a given finite subset. Identifying those can be achieved by applying a similar algorithm to the one proposed by the authors in [16] for 2D rigid motions, though at a greater cost.