1 Introduction

Iso-contours or iso-surfaces of scalar fields, defined as the pre-image of an iso-value, play a central role in visualization. There is a large body of work centered around iso-contour computation and analysis with many applications. A prominent example is the contour tree, which keeps track of topological changes of iso-contours when changing the iso-value [5]. It provides a structural overview of the data, see Sect. 2.3 for more details. Complementary information is provided by the continuous histogram, which is an extension of the discrete histogram to encode the distribution of the scalar values of continuous functions, see Sect. 2.1. It can serve as a valuable quantitative signature [2] of a data set. Both structures are frequently used for interaction and filtering, for example, to determine interesting iso-values or for transfer function design [19]. Histograms have also been applied for tensor field visualization and exploration to display the distribution of scalar invariants derived from tensor fields [13]. This distribution can also be understood as statistics of iso-contours. Note that we use the term iso-contour to refer to the complete level set of a 2D scalar field for a given iso-value, not one of its connected component which is the case in some of the related contour tree literature.

Fig. 1
figure 1

An example demonstrating the behavior of the anisotropy field in a simple tensor field given on a triangulated domain. The ellipses at the vertices represent the tensors defining the field. The total rotation of the eigenvector when moving once around the domain is \(2\pi \). The white lines represent iso-contours. a The anisotropy is linearly interpolated within the original mesh. It only has one minimum and no zeros or isotropic points. b The consistent anisotropy assuming linear interpolation of tensor components has three minima and two isotropic points. The respective join trees for the anisotropy fields are shown next to the meshes. All zero-leaves, marked in red, in the tree represent isotropic points of the tensor field. c The histograms for anisotropy using the two approaches in comparison

There are many standard algorithms to compute and analyze iso-contours, which are mostly based on piece-wise linear or multi-linear behavior. This assumption is, however, often violated for tensor invariants when using component-wise tensor interpolation, for example, various anisotropy definitions or the determinant of the tensor. An illustrative example of the behavior of the contours of the anisotropy in piece-wise linear tensor field in comparison to a linear approximation of the anisotropy is shown in Fig. 1. It is important to note that, there is no continuous tensor field interpolating the tensors at the vertices exhibiting the piece-wise linearly interpolated anisotropy in Fig. 1a when assuming that the tensor field is fixed on the boundary of the domain. The number of rotations of the eigenvector field when moving once around the domain (Poincaré index) is a topological invariant that determines the minimum number of isotropic points in the field. In this example, there is a total rotation of 2\(\pi \) of the eigenvectors, which results in two zeros in the anisotropy field. These zeros in the anisotropy field are not present in the linear anisotropy field corrupting its histogram, Fig. 1c. Therefore, it is important to consider an anisotropy field which is consistent with the chosen tensor field interpolation when analyzing its behavior. Here we have chosen a piece-wise linear interpolation of tensor components as an example. In the following we refer to the anisotropy field resulting from this interpolation as the consistent anisotropy. In this chapter, we present the derivation of an exact closed-form expression for continuous histograms for quadratic tensor invariants that is consistent with a piece-wise linear interpolation of a tensor field given over a two-dimensional triangulated domain.

Here, we are especially interested in the analysis of the anisotropy, an important characteristic in many applications, defined as the difference between major and minor eigenvalue. While there are many other definitions of anisotropy, this version has a distinguished meaning when analyzing the stability of the critical points and isotropic points, when perturbing the tensor field using the Frobenius norm to measure the deviation of the tensor field [18]. Further, it is frequently used in mechanical engineering applications to analyze the failure of materials. The join tree, a subset of the contour tree, of this anisotropy can be used for a topology-preserving simplification of 2d tensor fields [11].

Our main contributions are:

  • Framework for the analysis of scalar invariants that is consistent with a piece-wise linear interpolation of the tensor components. This includes topologically correct iso-contours, the contour tree, and continuous histograms.

  • A generic closed-form formulation of histograms for continuous data based on a generalization of the cumulative histogram. This approach neither requires explicit computations of the length of iso-contours nor the computation of the gradient.

  • Explicit solution for the histogram for piece-wise quadratic functions with positive Hessian over a two-dimensional domain. The anisotropy over a piece-wise linear component interpolation provides a relevant example.

  • Comparison to naïve approaches using a linear interpolation of the anisotropy and a discussion of the results.

The relevant context and related work are summarized in Sect. 2, then an overview of the problem and its solution is given in Sect. 3. Fundamental definitions and notations are introduced in Sect. 4. A general expression for the anisotropy is developed in Sect. 5 and used in Sect. 6 to subdivide the domain in monotonous triangles. Section 7 derives the accurate histogram. After some notes on the implementation in Sect. 7.1 the results are discussed in Sect. 8.

2 Context and Related Work

In this section, we first summarize the development of the concept of histograms from a signature of discrete data to continuous fields. Then we summarize some aspects of tensor interpolation and invariants that motivated our work.

2.1 Continuous Histograms

Originally, histograms have been developed for discrete data. They go back to Pearson and refer to a graphical representation displaying the frequency of the data items as bars over the data range [10]. As such, a histogram provides a summary of the data and they are also used to compare and characterize data sets. Formally, the histogram for a discrete set of data values \(F=\{f_i | i \in {1 , \cdots , m}\}\) is a one-dimensional bar chart displaying the frequency of each distinct element \(f\in F\) as a bar with height

$$\begin{aligned} h(f)= \sum _i\delta (f-f_i) \end{aligned}$$

where \(\delta \) is the delta function which is equal to one if \(f=f_i\) and zero otherwise. A related concept applicable to ordered data is the cumulative histogram which counts the cumulative number of data values smaller than a given value \(f\in F\). This results in values

$$\begin{aligned} c(f)= \sum _{f_i\le f}h(f_i). \end{aligned}$$

Today, the term is often not only used for the graphical representation but also for the concept capturing the distribution of function values by binning the function range and counting the frequency of data samples within these bins. The resulting histograms, however, are strongly dependent on the binning size and the sampling strategy of the function in the domain. The continuous nature of the function between the sample points is not represented. For these reasons several concepts to extend histograms to continuous functions have been proposed resulting in a distribution of the function values. Bajaj et al. [2] have introduced the contour spectrum as a data-signature to find interesting iso-values for volume rendering. The contour spectrum assigns the geometric measures of the contour length or surface area to each scalar value. In addition, they consider areas and volumes of regions below or above a given iso-value. Bajaj et al. also propose a method to compute these values exactly under the assumption of a piece-wise linear interpolation and a piece-wise constant gradient. Later Carr et al. [4] investigated the relation between histograms and the contour spectrum based on a nearest-neighbor interpolation. Scheidegger et al. [16] completed this work and introduced a natural generalization of histograms to the continuous setting as the distribution given by the contour spectrum weighted by the local isosurface density expressed as the inverse gradient magnitude. Given a scalar field f and scalar value t the distribution is given as

$$\begin{aligned} \pi _f(t) = \int _{f^{-1}(t)}|\nabla f(x)|^{-1}dS \end{aligned}$$

For the derivation of the distributions, they refer to Coarea formula that provides a relationship between the sum of area integrals and a global volume integral as used by Mullen et al. [14]. For piece-wise linear functions, this yields a more or less good approximation of the real distribution.

Similar concepts have also been considered for multivariate fields, for example, generalizations of scatterplotts [1] and parallel coordinates [9] to continuous data. In both cases, the mathematical model is based on mass conservation of a mapping from the function range to the scatterplot space and the parallel coordinates space respectively. The continuous histogram is a special case considering a one-dimensional range. While the mathematical model is generic, the proposed computational algorithms are limited to specific interpolation models in the spatial domain. The algorithm by Bachthaler et al. [1] assumes a linear interpolation in tetrahedral cells.

In our work, we focus on invariants with a quadratic behavior and propose an exact solution pursuing a slightly different approach than most of the previous methods. Instead of directly generalizing the concept of histograms, we start with the generalization of the cumulative histogram. This approach requires neither surface area/length of iso-contours nor gradient approximations and thus makes it possible to compute an accurate distribution for more complex interpolation schemes, demonstrated here for quadratic interpolations. The continuous histogram or scalar value distribution then follows as a derivative of the cumulative histogram.

2.2 Notes on Tensor Field Interpolation

In this section, we briefly summarize some notes related to tensor field interpolation without going much into detail. This has been a frequently discussed topic in many applications and it is agreed that this is a challenging topic.

While many theories and visualization models assume data given as fields on continuous domains, the data-reality are data sets sampled at discrete locations. Depending on the origin of the data this can be voxel-based data from imaging or meshes for simulation data. In any case, it is necessary to approximate and reconstruct the field from these samples. Thereby the most commonly used methods for tensor fields are based on a component-wise interpolation. Similar to other applications and other data types these are linear, bi-, or tri-linear interpolation depending on the grid type. Concerning such interpolations, a frequently discussed topic is the non-linear dependency of most tensor invariants on the tensor components [12]. There have been many methods proposed which explicitly try to preserve certain tensor characteristics [3, 17]. Recently there appeared a survey on interpolation methods for positive definite tensors [8].

We will, however, stay with the most simple interpolation methods, linear component-wise interpolation within tetrahedra which is also often the basis for finite element simulations. The non-linear dependence of the tensor invariants can lead to a non-convex behavior of the invariants inside the cells. An example we are especially interested in is the behavior of the anisotropy, defined as the difference between the maximum and minimum eigenvalue, which is typically decreased inside the cells. Sometimes this is referred to as “swelling-artifact”, but we rather argue that this is a fundamental property of tensor behavior. It reflects the fact that the anisotropy is linked to the directional behavior of the tensor. This is expressed by the fact that the anisotropy is always zero at degenerate points. These are points where the eigenvalues are the same and there is no uniquely determined eigenvector direction. The number of degenerate points is a topological invariant of the field when fixing the boundary and thus determines the minimum number of zeros in the anisotropy field, see Fig. 1 for an example. Therefore the analysis of the anisotropy field must be handled consistently with the chosen interpolation method for the tensor field. This concerns the computation of iso-contours, the contour tree and also histograms.

For our consideration in this work, we assume that we have a continuous tensor field given on a two-dimensional triangulated domain. We further assume a piece-wise linear, component-wise linear interpolation of the tensor field within these triangles. The anisotropy then has a quadratic behavior in the triangle. One can observe similar behavior for other invariants, for example, the determinant too. All the above-proposed methods for histogram computations fail when the interpolation of the data is not convex. Similarly, typical iso-contour or contour tree computation is also based on convex interpolation.

Fig. 2
figure 2

For the scalar field on the left, the join tree, split tree and the contour tree are shown

2.3 Contour Trees, a Topological Summary of Scalar Functions

The contour tree keeps   track of the changes of sub- and super-level sets of a function, bounded by iso-contours, and thus provides a valuable summary of the function, compare Fig. 2. It can be assembled from the join tree tracing the changes in iso-contours when the function value is increased from \(-\infty \) to \(\infty \) and the split tree one where the function value is decreased from \(\infty \) to \(-\infty \). In more detail, the join tree tracks the creation and merging of sub-level sets, which are recorded in a tree. At the local minima of the function, new branches are created. As the function value increases, branches are extended and merged at saddle points where two sub-level sets merge. The global maximum of the function becomes the root of the tree. The split tree is constructed similarly while traversing the field from \(\infty \) to \(-\infty \). The most commonly used algorithm for contour tree computation assumes a piecewise linear interpolation of the scalar field where all critical points are located at the cell vertices [5]. In the case of the anisotropy, we are especially interested in the join tree, a sub-tree of the contour tree, since many of the minima correspond to the degenerate points in the tensor field. The join tree can be used to quantify the stability of these points [18]. For consistent results, assuming a specific interpolation, a join tree computation based on the quadratic behavior or the anisotropy is essential.

3 Problem Statement and Solution Overview

Given a tensor field sampled over a 2D triangular mesh, our goal is to compute the accurate contour-tree and histogram of the tensor anisotropy consistent with linear interpolation of tensor components. Anisotropy is a quadratic function under this interpolation.

Fig. 3
figure 3

Solution overview: First, the coefficients of the quadratic function are determined. Then a transformation is applied such that the minimum is at the origin and the iso-contours are circular, followed by a sub-division into monotonous triangles. For each monotonous triangle, the cumulative anisotropy histogram is computed using sub-level set areas, which are added to get the cumulative histogram for the original triangle. Finally, the derivative of the cumulative histogram yields the anisotropy histogram

Figure 3 gives an overview of our solution approach. For each triangle in the input mesh, we first determine the coefficients of the quadratic function for the anisotropy based on tensor values at the triangle vertices. We show that anisotropy is a special quadratic function which either has a single minimum equal to zero and elliptical iso-contours, or in a degenerate case, minima along a line and the iso-contours are pairs of parallel lines, refer to Sect. 5. The first step is the subdivision of the triangle into monotonous sub-triangles, which is the basis for the iso-contour extraction, the contour tree computation and the derivation of the histogram. We obtain the histogram as the derivative of the cumulative histogram, which is computed first from the area of the sub-level set for the isovalues. To compute the explicit area of the sub-level sets we apply a linear transformation to the coordinate system such that elliptical iso-contours become circular centered at the origin, refer to Sect. 5.1.

4 Background and Notations

In this section, we provide the notations and a brief mathematical background required for the proposed method discussed in sections later. First, in Sect. 4.1 we set up the notations for tensors and the invariant of interest to us that is tensor anisotropy. Then in Sect. 4.2, we describe the barycentric interpolation within a triangle, since this approach is used for linear interpolation of tensors within a triangle. Lastly, in Sect. 4.3, we discuss the general bi-variate quadratic function, its critical point, and the shape of its iso-contours.

4.1 Second Order Symmetric Tensors and Anisotropy

For a second order symmetric tensor, \( T= \begin{pmatrix} e &{} f \\ f &{} g \end{pmatrix} \), the two eigenvalues are:

$$\begin{aligned} \lambda , \mu = \frac{1}{2}(e+g)\pm \sqrt{\frac{(e+g)^2}{4}-(eg-f^2)} \end{aligned}$$

Depending on the application different measures for anisotropy are used. For positive definite tensors, relative measures like the fractional anisotropy are common. In mechanical engineering a typical measure is the difference between the maximum and the minimum eigenvalues \(\alpha (T)= \lambda - \mu = \sqrt{(e+g)^2-4(eg-f^2)}\). It has been shown that this value is also related to the stability of degenerate points in tensor field topology [11] and is the measure we are mostly interested in. In the following, we will however consider the squared value of \(\alpha (T)\), which has the same topological characteristics but simplifies the computations a lot.

$$\begin{aligned} \nu (T)&= \alpha ^2(T) = (\lambda - \mu )^2 \nonumber \\&= (e-g)^2+4f^2 \end{aligned}$$
(1)

4.2 Barycentric Coordinates and Piece-Wise Linear Interpolation

For all our considerations in this paper we use a component-wise linear interpolation of the tensor field. We use barycentric coordinates for interpolation in the triangle. Since we require an explicit representation of the the tensor field for the derivation of the exact histogram we briefly review the main definitions and formulas in this section.

Fig. 4
figure 4

Barycentric coordinates and interpolation. The point p within the triangle \(\Delta p_1p_2p_3\) can be represented using barycentric coordinates \((\beta _1, \beta _2, \beta _3)\), where \(\beta _1=\text {Area}(\triangle pp_2p_3)/\text {Area}(\triangle p_1p_2p_3)\), \(\beta _2=\text {Area}(\triangle pp_1p_3)/\text {Area}(\triangle p_1p_2p_3)\) and \(\beta _3=\text {Area}(\triangle pp_1p_2)/\text {Area}(\triangle p_1p_2p_3)\). Let s be some scalar quantity sampled on the vertices \(p_1, p_2\) and \(p_3\) as \(s_1, s_2\) and \(s_3\) respectively. Then the value of s at any point p inside the triangle is given by \(s(p) = \beta _1s_1+\beta _2s_2+\beta _3s_3\)

Refer to Fig. 4, for a triangle with vertices \(p_1=(x_1,y_1)\), \(p_2=(x_2,y_2)\) and \(p_3=(x_3,y_3)\), the barycentric coordinates \((\beta _1, \beta _2, \beta _3)\) of an arbitrary point \(p=(x,y)\) within a triangle are given by

$$\begin{aligned} \beta _1&= \frac{(y_2-y_3)(x-x_3) + (x_3-x_2)(y-y_3)}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)}, \\ \beta _2&= \frac{(y_3-y_1)(x-x_3) + (x_1-x_3)(y-y_3)}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)}, \\ \beta _3&= \frac{(y_1-y_2)(x-x_2) + (x_2-x_1)(y-y_2)}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)}. \end{aligned}$$

We assume that some scalar function s is sampled at the vertices of the triangle with scalar values \(s_1\), \(s_2\) and \(s_3\) at vertices \(p_1\), \(p_2\) and \(p_3\). Then, the scalar value s at an arbitrary point \(p=(x,y)\) within the triangle can be determined as

$$\begin{aligned} s(x,y)&= \beta _1 s_1 + \beta _2 s_2 + \beta _3 s_3. \end{aligned}$$

This function s(xy) is linear in x and y, and can be alternatively written as

$$\begin{aligned} s(x,y) = s_x x + s_y y + s_c, \end{aligned}$$

with

$$\begin{aligned} s_x&= \frac{(y_2-y_3)s_1 + (y_3-y_1)s_2 + (y_1-y_2)s_3}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)} \\ s_y&= \frac{(x_3-x_2)s_1 + (x_1-x_3)s_2 + (x_2-x_1)s_3}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)} \\ s_c&= \frac{(x_2 y_3 - x_3 y_2)s_1 + (x_3 y_1 - x_1 y_3)s_2 + (x_1 y_2 - x_2 y_1)s_3}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)} \end{aligned}$$

4.3 Bivariate Quadratic Functions and Their Critical Points

As the anisotropy, as defined in Eq. (1), is a quadratic function we summarize some general facts about quadratic functions and define the notation that we will use later in the paper. In the following we assume that the quadratic function is not identical to zero.

A general quadratic function in two variables can be written as \(s(x,y) = Ax^2 + Bxy + Cy^2 + Dx + Ey + F\) or in matrix form as

$$\begin{aligned} s(x,y) = (x,y)\cdot M \cdot \begin{pmatrix} x \\ y \end{pmatrix} + T \cdot \begin{pmatrix} x \\ y \end{pmatrix} +F \end{aligned}$$
(2)

with \(M= \begin{pmatrix} A &{} B/2 \\ B/2 &{} C \end{pmatrix} \) and \( T= \begin{pmatrix} D \\ E \end{pmatrix} \). The critical point of the scalar function s is a point \(p=(x,y)\) where the gradient \(\nabla s(x,y) = 0\) is zero. The partial derivatives of s(xy) with respect to the two variables is:

$$\begin{aligned} {\partial s}/{\partial x}&= 2Ax + By + D \end{aligned}$$
(3)
$$\begin{aligned} {\partial s}/{\partial y}&= 2Cy + Bx + E \end{aligned}$$
(4)
Fig. 5
figure 5

The possible cases for a general quadratic function. a The critical point is a minimum and the iso-contours are elliptical. b The critical point is a maximum and the iso-contours are ellipses. c The critical point is a saddle and the iso-contours are hyperbolas. d The critical point does not exist and the function has a minimum value along a line, while the iso-contours are a pair of parallel lines. e The other case when the iso-contours are a pair of parallel lines, again the critical point does not exist but the function has a maximum value along a line. f The case when the critical point does not exist and the iso-contours are parabolic. We show that only the cases (a) and (d) are possible for the quadratic function for tensor anisotropy, the other four cases shown here are not possible

The location of the critical point \(p_c = (x_c, y_c)\) of s can be obtained after solving the linear equations \(\partial s / \partial x = 0\) and \(\partial s / \partial y = 0\) using Eqs. (3) and (4). The resulting coordinates are

$$\begin{aligned} x_c = \frac{-2CD + BE}{4AC - B^2}, \qquad y_c = \frac{-2AE + BD}{4AC - B^2}. \end{aligned}$$
(5)

The function s and its critical point can be classified based on the sign of the determinant of the Hessian, H

$$\begin{aligned} H = 4AC - B^2. \end{aligned}$$
(6)

If \(H > 0\), then the critical point is either a maximum or minimum and the iso-contours are ellipses, compare Fig. 5a, b. The type of the critical point depends on the sign of A and C. If \(A, C > 0\), then the critical point is a minimum, otherwise it is a maximum. In the other case when \(H < 0\), then the critical point is a saddle and the iso-contours are hyperbolas.

For the case when \(H = 0\), there are no isolated critical points and the iso-contours are either parabolas, parallel or coincident lines. Note that it is possible that there are degenerate lines. The type of the iso-contour when \(H = 0\) depends on the invariant I defined as

$$\begin{aligned} I = BDE-AE^2-CD^2. \end{aligned}$$
(7)

If \(I \ne 0\), the iso-contours are parabolic, compare Fig. 5f, otherwise they are pair of parallel lines, compare Fig. 5d, e.

5 Anisotropy for 2D Piece-Wise Linear Tensor Fields

In this section, we have a closer look at the anisotropy function for a linear tensor field. The main observation is in the non-degenerate case, that the anisotropy always has exactly one minimum with a value of zero. This corresponds to the fact that the tensor field always has exactly one critical point. All iso-contours are ellipses.

Given a triangle with vertices \(p_1=(x_1,y_1)\), \(p_2=(x_2,y_2)\) and \(p_3=(x_3,y_3)\). Let the tensors at these vertices be \(T_1\), \(T_2\) and \(T_3\), respectively. Let the components of the tensors be

$$\begin{aligned} T_1= \begin{pmatrix} e_1 &{} f_1 \\ f_1 &{} g_1 \end{pmatrix} , \quad T_2= \begin{pmatrix} e_2 &{} f_2 \\ f_2 &{} g_2 \end{pmatrix} , \quad T_3= \begin{pmatrix} e_3 &{} f_3 \\ f_3 &{} g_3 \end{pmatrix}. \end{aligned}$$
(8)

The barycentric coordinates can be used for linear interpolation of the tensor field within the triangle. Tensor T at an arbitrary point \(p=(x,y)\) within the triangle can be found as:

$$\begin{aligned} T(p)= T(x,y) = \begin{pmatrix} e(x,y) &{} f(x,y) \\ f(x,y) &{} g(x,y) \end{pmatrix} \end{aligned}$$
(9)

As described earlier in Sect. 4.2, the tensor components ef and g linearly interpolated within the triangle as can be written as

$$\begin{aligned} e(x,y) = e_x x + e_y y + e_c, \end{aligned}$$
(10)
$$\begin{aligned} f(x,y) = f_x x + f_y y + f_c, \end{aligned}$$
(11)
$$\begin{aligned} g(x,y) = g_x x + g_y y + g_c. \end{aligned}$$
(12)

The function, we are interested in is the anisotropy \(\nu \), the explicit expression for which can be obtained by substituting the linear expressions for tensor components in Eq. (1) yielding

$$\begin{aligned} \nu (T) =&\big ((e_x-g_x)^2 + 4f_x^2\big ) x^2 + 2\big ((e_x-g_x)(e_y-g_y) + 4f_xf_y\big ) xy \nonumber \\&+ \big ((e_y-g_y)^2 + 4f_y^2\big ) y^2 + 2\big ((e_x-g_x)(e_c-g_c) + 4f_xf_c\big ) x\nonumber \\&+ 2\big ((e_y-g_y)(e_c-g_c) + 4f_yf_c\big ) y + \big ((e_c-g_c)^2 + 4f_c^2\big ). \end{aligned}$$
(13)

Comparing Eq. (13) with the general quadratic Eq. (2), we obtain the coefficients of the quadratic function in dependence of the tensor components:

$$\begin{aligned} A&= \big ((e_x-g_x)^2 + 4f_x^2\big ) \ge 0 , \end{aligned}$$
(14)
$$\begin{aligned} B&= 2\big ((e_x-g_x)(e_y-g_y) + 4f_xf_y\big ), \end{aligned}$$
(15)
$$\begin{aligned} C&= \big ((e_y-g_y)^2 + 4f_y^2\big ) \ge 0, \end{aligned}$$
(16)
$$\begin{aligned} D&= 2\big ((e_x-g_x)(e_c-g_c) + 4f_xf_c\big ), \end{aligned}$$
(17)
$$\begin{aligned} E&= 2\big ((e_y-g_y)(e_c-g_c) + 4f_yf_c\big ), \end{aligned}$$
(18)
$$\begin{aligned} F&= \big ((e_c-g_c)^2 + 4f_c^2\big ). \end{aligned}$$
(19)

Substituting the above equations in Eq. (6), we derive the determinant of Hessian for the anisotropy to be (for derivation refer to Appendix A):

$$\begin{aligned} H =&16 \big ( f_x(e_y-g_y) - f_y(e_x-g_x) \big )^2 \ge 0. \end{aligned}$$
(20)

From Eq. (20), we can conclude that the iso-contours of anisotropy function are never hyperbolic. In most cases, when H is strictly greater than 0, the contours are elliptical. Moreover, in that scenario, from Eqs. (14) and (16), we can deduce that the type of the critical point is always a minimum.

Appendix A contains the detailed analysis of \(\nu \). We show that the bi-variate quadratic function \(\nu \)  is a special function that has elliptical iso-contours or in some cases a pair of parallel lines, ruling out the possibility of hyperbolic or parabolic iso-contours.

5.1 Field Normalization Using Coordinate Transformations

In the following, we derive a coordinate transformation such that the bivariate quadratic scalar function determined for a triangle has a standard format. This allows for the application of a unified strategy for further analysis.

Equation (13) gives the expression of anisotropy in general bivariate quadratic form. We have also established that iso-contours of this function will are elliptical. Therefore we first transform the coordinates such that elliptical iso-contours are centered at the origin and aligned to the axes. This can be achieved by applying a translation and rotation, both rigid-body transformations preserving areas. Then, a transformation is applied such that iso-contours of the bivariate quadratic function become circles rather than ellipses. This can be achieved by applying a non-uniform scaling, a linear transformation which distorts the area by a constant factor given by the determinant of the transformation matrix. The approach described above is illustrated in Fig. 6.

Fig. 6
figure 6

Field normalization using coordinate transformations. a The original quadratic function, \(f(x,y) = x^2+xy+y^2+0.4x+0.5y+0.07\). b The function after applying translation such that the minimum is at the origin, \(f(x_t,y_t) = x_t^2+x_ty_t+y_t^2\). c After applying rotation such that elliptical iso-contours are axes aligned, \(f(x_r,y_r) = 0.5x_r^2+1.5y_r^2\). d After scaling such that elliptical iso-contours are transformed into circular iso-contours, \(f(x_s,y_s) = x_s^2+y_s^2\)

Refer to Eqs. (13)–(19) for the detailed expression of anisotropy and refer to Eq. (2) for the general quadratic equation in matrix form. After translation such that the minimum \(p_c=(x_c, y_c)\) falls into the origin, the expression for anisotropy can be written as

$$\begin{aligned} \nu (x_t,y_t) = (x_t,y_t)\cdot M \cdot \begin{pmatrix} x_t \\ y_t \end{pmatrix} +F_t \end{aligned}$$
(21)

with the translated coordinates \(x_t = x-x_c\), \(y_t = y-y_c\) and \(F_t = F + \frac{(BDE-AE^2-CD^2)}{4AC-B^2}.\) Using Eqs. (14)–(19), it can be shown that \(F_t=0\) for \(\nu \). This implies that minimum value of \(\nu \) is zero at the critical point and this point is a degenerate point in the tensor field. Equation (21) becomes

$$\begin{aligned} \nu (x_t,y_t) = (x_t,y_t)\cdot M \cdot \begin{pmatrix} x_t \\ y_t \end{pmatrix} \end{aligned}$$
(22)

Now, we apply a rotation \(O=(EV_1|EV_2)\) to align the elliptic iso-contours with the axis using the eigenvectors \(EV_1\) and \(EV_2\) of the matrix M

$$\begin{aligned} \begin{pmatrix} x_r \\ y_r \end{pmatrix}= O\cdot \begin{pmatrix} x_t \\ y_t \end{pmatrix}, \end{aligned}$$
(23)

which results in the diagonal representation of the anisotropy

$$\begin{aligned} \nu (x_r,y_r) = \lambda _1 x_r^2 + \lambda _2 y_r^2 \end{aligned}$$
(24)

where \(\lambda _1\) and \(\lambda _2\) are the eigenvalues of M.

Lastly, we apply non-uniform scaling to obtain circular iso-contours:

$$\begin{aligned} \nu (x_s,y_s)&= x_s^2 + y_s^2 \quad \text {where}\quad x_s = \sqrt{\lambda _1} x_r, \quad y_s = \sqrt{\lambda _2} y_r. \end{aligned}$$
(25)

The area distortion because of this scaling is given by the factor \(\sqrt{\lambda _1 \lambda _2}\).

6 Subdivision in Monotonous Sub-triangles

We consider   a triangle with vertices \(p_1=(x_1,y_1)\), \(p_2=(x_2,y_2)\) and \(p_3=(x_3,y_3)\) and the tensors at these vertices are \(T_1\), \(T_2\) and \(T_3\). The tensors are linearly interpolated within the triangle and the anisotropy is a quadratic function. For the extraction of iso-contours, the computation of the contour tree as well as for the histogram we require piece-wise monotonous behavior inside the triangles, which is given in this chapter. Similar, subdivisions have also been proposed by Dillard et al. [6] and by Nucha et al. [15]. There are five different cases depending on the location of the global minima and the local minima at the edges. Especially the cases when the minimum \(p_c\) lies within the triangle or outside the triangle need a different treatment for the computation of the anisotropy histogram.

Fig. 7
figure 7

All the possible cases and the corresponding sub-divisions into monotonous triangles. a, b The case when the minimum is inside the triangle. We can subdivide the triangle into six monotonous triangles. c, d The case when the minimum is outside the triangle, but the function restricted to the triangle edges has a minimum on all the edges. Four monotonous triangles can be generated. e, f The case when two of the edges have minima, three monotonous triangles are generated. g, h The case when only one triangle edge has a minimum, two monotonous triangles are created. i, j The case when none of the edges has a minimum, no triangle subdivision is required. k, l Lastly, the degenerate case when the function does not have a point minimum but has a degenerate minimum along a line. In this case, the iso-contours are a pair of parallel lines

Case A.:

The minimum \(p_c\) is within the triangle. In this case, the input triangle can be partitioned into six sub-triangles such that \(\nu \)  behaves monotonously within the triangle. See Fig. 7b.

Case B.:

The minimum \(p_c\) is outside the triangle. Here, we have four possibilities:

1.:

No triangle edge has an edge minimum. See Fig. 7i.

2.:

One triangle edge has an edge minimum. See Fig. 7g.

3.:

Two triangle edges have edge minima. See Fig. 7e.

4.:

All three triangle edges have edge minima. See Fig. 7c.

In all these cases, the triangle can be sub-divided into an appropriate number of monotonous triangles as described in Lines 14–30 of Algorithm 1. Although these sub-divided triangles are monotonous and look similar to Case A, an important difference is that in general none of the vertices lies at the origin.

7 Computation of the Histogram for \(\nu \)

In this section, we derive the exact continuous histogram of the anisotropy for linearly interpolated tensor fields. We use the term histogram here not strictly as it has been originally introduced but in the sense of the distribution of function values. It can also be considered as the weighted contour spectrum using the terminology of Bajaj et al. [2] as introduced by Scheidegger et al. [16]. In contrast to previous methods, we approach the problem by first computing the cumulative histogram CH and then derive the histogram from it by computing its derivative. This makes the exact computation of the histogram much more feasible.

$$\begin{aligned} CH(\nu _0)=Area(\nu \le \nu _0) = \sum _{\triangle _i}Area_i(\nu \le \nu _0) \end{aligned}$$

where \(Area_i(\nu \le \nu _0)\) is the area of the sublevel set in triangle \(\triangle _i\). Specifically, we consider here the anisotropy with its quadratic behavior, however the method also directly applies for linear fields.

In our derivation of \(Area_i(\nu \le \nu _0)\) we consider the following setting. Given is a triangle \(\triangle ABC\) with vertices \(A=p_1=(x_1,y_1)\), \(B=p_2=(x_2,y_2)\) and \(C=p_3=(x_3,y_3)\) and respective tensors \(T_1\), \(T_2\) and \(T_3\), which are linearly interpolated within the triangle. Further we ordered the vertices such that the anisotropy values are \(\nu _1< \nu _2 < \nu _3\), using simulation of simplicity [7] to resolve the ties if required. To obtain the contribution of the triangle to the cumulative histogram at the value \(\nu \) we compute the area of the sublevel set at \(\nu \) within the triangle. In the following, we assume that anisotropy is monotonous within the triangles resulting from the subdivision introduced in Sect. 6. We further assume that the transformations as described in Sect. 5.1 have been applied. This means that the anisotropy has the form as given in Eq. (25) with a global minimum \(p_c=(0,0)\) at the origin and the level sets that are circles. The area within the transformed triangle is distorted by a constant factor, which can be appropriately multiplied to get the exact areas for the original triangle. We consider two cases depending on whether the vertex A of the triangle vertex lies at the origin or not.

Case 1: The global minimum \(p_c\) lies at one triangle vertex

Let’s assume that the global minimum \(p_c\) lies in vertex \(A=p_1\) of the triangle ABC. Then the shape of the sublevel set for \(\nu \) can have two different types depending on whether \(\nu \) is smaller or larger than \(\nu _2=r_{AB}^2\). If \(\nu \le \nu _2\) the sublevel set is a sector of a circle with radius \(r = \sqrt{\nu }\) and opening angle \(\theta _A\), as shown in Fig. 8. The area of the sublevel set for \(\nu \in [\nu _1 , \nu _2]\) is then given by

$$\begin{aligned} Area(\nu )&= \frac{\theta _{A} \nu }{2} . \end{aligned}$$
(26)

where \(\theta _A\) is angle between the edges AB and AC. The rate of change of the area is given by

$$\begin{aligned} \frac{\partial Area(\nu )}{\partial \nu }&= \frac{\theta _A}{2}, \end{aligned}$$
(27)

which is a constant not depending on the specific value of \(\nu \).

Fig. 8
figure 8

A triangle with monotonous function behaviour where the global minimum \(p_c\) lies on one vertex \(A=p_1\). Due to the normalization of the triangle, \(p_c\) is at the origin and the iso-contours are circular. If \(\nu \le \nu _2\) the sublevel set is a subset of the light blue area. If \(\nu >\nu _2\) the sublevel area is composed of the complete light blue region and the area is highlighted in darker blue

If the isovalue \(\nu \) is greater than \(\nu _2\) and less than \(\nu _3\), the iso-contour is composed of a circular sector and an additional more complex shape DBFE as illustrated in Fig. 8. This region is enclosed by two circular segments DB and EF and two line segments DE and BF and can be computed as

$$\begin{aligned} Area(BDEF)&= Area(BGHF) + Area(FHE) - Area(BGD) \\&= \bigg (\frac{(r_{AB} \sin \theta _{A} + r \sin \theta )(r \cos \theta - r_{AB} \cos \theta _{A})}{2}\bigg ) \\&\quad + \bigg (\frac{\theta r^2}{2} - \frac{r^2 \sin \theta \cos \theta }{2}\bigg ) - \bigg (\frac{\theta _{A} r_{AB}^2}{2} - \frac{r_{AB}^2 \sin \theta _{A} \cos \theta _{A}}{2} \bigg ) \\&= \frac{\theta r^2 - \theta _{A} r_{AB}^2}{2} + r r_{AB} \bigg (\frac{\sin \theta _{A} \cos \theta - \cos \theta _{A} \sin \theta }{2}\bigg ). \end{aligned}$$

With \(r^2 = \nu \) and \(r_{AB}^2 = \nu _2\) this results in

$$\begin{aligned} Area(BDEF)&= \frac{\theta \nu - \theta _{A} \nu _2}{2} + \sqrt{\nu \nu _2} \frac{\sin (\theta _{A} - \theta )}{2} . \end{aligned}$$
(28)

In the expression above, the given value of \(\nu \) determines the values of \(\theta \).

Case 2: The global minimum \(p_c\) does not lie at any triangle vertex

These triangles are the more generic case, we still assume that the anisotropy is monotonous inside the triangle and the vertices such that the anisotropy values are \(\nu _1< \nu _2 < \nu _3\). The triangles look similar to Case 1, but none of the vertices lie at the origin, compare Fig. 9. To compute the area of a sublevel set ABFE within these triangles, we considering the sublevel sets in two triangles where we can use the algorithm of Case 1. In Fig. 9 they are the triangles \(\triangle DBC\) and \(\triangle DHC\). For the final area, we have in addition to consider the area of triangle \(\triangle AHB\) which has to be added or subtracted depending on the exact position of A.

$$\begin{aligned} Area(ABFE)&= Area(DBFG)-Area(DHEG)\pm Area(\triangle AHB) \end{aligned}$$
(29)
Fig. 9
figure 9

A triangle \(\triangle ABC\) with monotonous function behaviour where the global minimum \(p_c\) does not lie on any vertex

7.1 Implementation

We compute the cumulative histogram of anisotropy by computing the sublevel set area. The detailed algorithm is provided in Algorithm 1. For a given tensor mesh, we pre-process all the triangles to determine the coefficients of the quadratic function for anisotropy within the triangle, compare Sect. 5. Each triangle is appropriately subdivided into monotonous triangles, compare Sect. 6. Then for each anisotropy value in the histogram bin, we compute the sublevel set area by adding up the sublevel set area in all monotonous triangles. We also handle triangles with degenerate minimum appropriately.

figure a

Parallelization. The algorithm described in Algorithm 1 has lots of options for parallelization. The loops at Lines 4 and 38 are embarrassingly parallel because each triangle in the mesh can be pre-processed in parallel. Similarly, each bin in the histogram can be computed in parallel. Further, with atomic add operations, the computation of the sublevel set area for anisotropy value \(\nu \) corresponding to a particular histogram bin can be parallelized over the set of monotonous triangles. These are the loops at Lines 41 and 44 in Algorithm 1.

Numerical issues. Since there are a few floating-point operations and checks involved in the Algorithm 1, floating-point errors can be introduced which may propagate to the output resulting in a wrong histogram. We handle these errors by introducing reasonable checks, for example making sure that the cumulative histogram thus obtained is always a monotonically increasing function and sums up to the total area of the domain for the largest value of anisotropy. However, a deeper study of the errors and more robust computation is left for future work. We are confident that using a multi-precision library for computation will remove the floating-point errors.

Run times. We implemented the Algorithm 1 as a prototype in Java 1.8. This proof of concept implementation does not include extensive code and memory optimizations. The experiments reported in following Sect. 8 were performed on a workstation with 12 core Intel Xeon processor and 32 GB of RAM.

The running time depends on the size of the input mesh and the number of bins in the output histogram. For all the experiments we chose 500 as the number of bins in the histogram. The synthetic data used in Sect. 8.1 is a small data set with the mesh containing only 32 triangles. It took about 0.02 s to compute the continuous histogram for the meshes in this ensemble. The histogram computation for the two point load data reported in Sect. 8.2 took 0.2 s. This triangle mesh contained 1682 triangles. The run time improved to 0.1 s when using multi-threading. Lastly, for the DTI data set containing 722 triangles (Sect. 8.3), it took 0.09 and 0.17 s to compute the histogram for brain and noisy regions respectively. The times improved by a factor of 2 for both cases when using multi-threading.

8 Results

We apply the proposed approach of computing anisotropy histograms to three different case studies. We show results for synthetic, simulation and experimental data. For all the case studies we compute the continuous histograms for three different interpolations of the anisotropy.

  • Interpolation [a]: Linear interpolation of the anisotropy within the original triangulation.

  • Interpolation [b]: Linear interpolation of the anisotropy within the sub-divided monotonous triangles, compare Sect. 6.

  • Interpolation [c]: Anisotropy based on the linear interpolation of the tensor components, resulting in a quadratic behavior or the anisotropy, compare Sect. 5. When using the term accurate we always refer to accuracy with respect to this interpolation.

The resulting anisotropy fields are directly shown using a color map where dark blue refers to an anisotropy value of zero and red assigned to the maximum value. We also show a set of iso-contours in these images as white lines. In addition, we computed the join tree for all cases, which are always the same for interpolation [b] and [c]. Finally, we computed the continuous histogram where the results for one data set are plotted in one image, interpolation [a] displayed as a red curve, interpolation [b] as a green curve and interpolation [c] as a black curve.

Fig. 10
figure 10

Comparison of the behavior of the anisotropy field in a synthetic dataset. The anisotropy is linearly interpolated within the original mesh [a], and the subdivided monotonous triangles [b]. The anisotropy assuming linear interpolation of tensor components [c]. The upper row shows the resulting field as a color-map superimposed with contour lines. The ellipses at the vertices represent the tensors defining the field. The second row shows the respective join trees for the three anisotropy fields. The red squares correspond to the zeros inside of the original triangles. All zero-leaves in the tree represent degenerate points of the tensor field topology

8.1 Synthetic Data

The first example is a synthetic data set where tensors with user specified tensor components are placed at grid locations of a \(5\times 5\) grid. This grid is triangulated to provide a mesh with 32 triangles. This simple example is well suited to demonstrate the differences between the histogram of the consistent anisotropy field [b], and the methods utilizing a linear approximation of the anisotropy on the original mesh [a], and on the subdivided mesh with monotonous triangles [b], as shown in Fig. 10. It can immediately be seen that for interpolation [a] the topology of the iso-contours is not in accordance with the tensor field. While the iso-contours based on the tensor interpolation differ between interpolation, they have the same topology [b] and [c]. This is also reflected in the corresponding join trees, which are the same for both fields, for more details see Sect. 8.

Fig. 11
figure 11

Random directions tensor dataset with constant eigenvalues. a The original mesh with anisotropy computed at the mesh vertices and linearly interpolated within the triangles. b The subdivided mesh with monotonous triangles. Anisotropy is linearly interpolated within the monotonous triangles. c The anisotropy resulting from linear interpolation of tensor components. d summarizes all histograms with red curves for interpolation [a], green curves for interpolation [b] and black curves for interpolation [c]

In the next step, we randomly perturb the directions of the tensors at the vertices without changing their eigenvalues to generate an ensemble of four tensor fields. Note that since we do not change the eigenvalues, the anisotropy at the vertices of the mesh remains unchanged after perturbation. Hence, for interpolation [a] all the fields, the iso-contours, the join trees, and their histograms will be the same as evident from Fig. 11a. However, if we use quadratic function resulting form the tensor interpolation [c] of anisotropy, we clearly observe the differences within the ensemble members as shown in Fig. 11c. Similarly, the histograms for the ensemble members are different as shown by black curves in the plots in Fig. 11d. While for interpolation [b], the subdivision into monotonous triangles helps in identifying the differences, Fig. 11b, the histograms are still not accurate and have a bias toward larger anisotropy values, Fig. 11d. The respective contour trees are shown in Fig. 12. The contour tree for the interpolation [a] is the same for all 4 fields and already given in Fig. 11a, so we only show the trees for the sub-division in monotonous triangles. The degenerate points of the tensor field where the anisotropy is zero appear also as minima in the join tree and are highlighted in red. The join trees provide an overview of the possible cancellations of degenerate points and thus their stability [18]. Comparing the trees it can be seen that the four data sets vary significantly for their topological structure and stability of its degenerate points. The join tree for the linear anisotropy, Fig. 11a, has no zero and is thus not consistent with the direction fields given by the tensors.

Fig. 12
figure 12

The join trees for the four ensemble members shown in Fig. 11. The trees summarize the hierarchical structure of the minima in the anisotropy field and the degenerate points in the tensor field topology. Degenerate points inside the triangles are marked as red nodes in the tree

Fig. 13
figure 13

Two-point load data: simulation of the stresses inside a solid block upon applying two forces. a shows a schematic of the set-up of the simulation, b shows the eigenvector directions in one slice, c is a close up with color showing the signed anisotropy using bi-linear interpolation on the original mesh

Fig. 14
figure 14

Two point load simulation data with focus region around one of the loading points. a The original mesh with anisotropy computed at the mesh vertices and linearly interpolated within the triangles. b The subdivided mesh with monotonous triangles. Anisotropy is linearly interpolated within the monotonous triangles. c The anisotropy resulting from linear interpolation of tensor components. The isotropic points in the tensor field are highlighted by small red spheres. d the three cumulative histograms and (e) the histograms. The red curves correspond to (a), the green curves to (b) and the black curve to (c)

Fig. 15
figure 15

Two segments selected from Diffusion Tensor Imaging data. The \(20\times 20\) 2D grid shown in red outline is chosen from noisy region of the data while the selection shown in black outline is chosen from the region occupied by the brain. We plot the histograms for these selections in Figs. 16 and 17 respectively

Fig. 16
figure 16

Anisotropy fields in a small noisy subset of brain dataset. a Linear interpolation in the original mesh. b Linear interpolation within the subdivided mesh with monotonous triangles. c The anisotropy resulting from linear interpolation of tensor components. d The comparison of cumulative histograms under these settings. e The comparison of the corresponding histograms with red (a), green (b), and black (c)

8.2 Simulation Data

The difference between the three different interpolations for the anisotropy field gave significantly different results for the synthetic data. In the next step, we want to investigate the impact of these differences on real-world data. At first, we consider a simulation data set from mechanical engineering. It is a well-known data set, often referred to as two-point load, that represents a stress field in a solid block resulting from the application of two external forces, Fig. 13. The data is given on a cubic mesh. The anisotropy measure used so far corresponds to the squared von Mises stress, which plays an important role in failure analysis of mechanical components. The direction field in one slice is shown in Fig. 13b. In our analysis, we consider a section of this slice, which is shown in Fig. 13c displaying one eigenvector field. Color represents the anisotropy using a bi-linear interpolation in the original mesh. In our analysis, we use a triangulated version of the data.

Figure 14 shows the anisotropy fields using the three different interpolations in comparison. In Fig. 14a one can observe the asymmetry introduced by the triangulation but is similar to Fig. 13c. The anisotropy fields in Fig. 14b, c are both based on the monotonous subdivision and are very similar to each other but differ strongly from Fig. 14a. The asymmetry due to the triangulation is largely reduced. The minima inside the original triangles in the field capture the locations of the degenerate points of the direction field. The corresponding histogram can be seen in Fig. 14d, e. As expected they differ strongly for very small values but are rather similar for large values of the anisotropy.

Fig. 17
figure 17

A small subset of DTI brain dataset is selected within the brain region. a Linear interpolation in the original mesh, b Linear interpolation in monotonous triangles. c The anisotropy resulting from linear interpolation of tensor components. d and e display the respective cumulative histograms and histograms as (a) red, (b) green, (c) black plots

8.3 Measurement Data

As the last example, we examine two sections of a slice of 3D Diffusion Tensor Imaging data. Specifically, we compute and compare the anisotropy histograms of noisy regions outside the brain and a region inside the brain. The 2D slice from the data along with selected regions is shown in Fig. 15.

Figure 16 shows the histograms computed for the noisy region. With the interpolation approach [c] for computing histograms, we can observe a high contribution of anisotropy values near zero, which hints at the existence of a lot of degenerate points in the noisy region. This is not captured by the histogram computed with interpolation approach [a]. It should be noted that interpolation [b] (green plot) although yields better results than interpolation [a] (red plot), it is still quite different than the accurate histogram based on component-wise tensor interpolation (black plot). We did the same experiment for a region that is within the brain and hence contains less noise. The results are shown in Fig. 17. Here we observe, that histograms are very similar whether we use the accurate quadratic function for anisotropy of linearly interpolate it within the triangles.

9 Conclusions

In this paper, we explore the behavior of the anisotropy, as an example for a nonlinear derived tensor invariant, when applying a linear component-wise interpolation of the tensor field. We demonstrate that a linear interpolation of the invariant itself, the interpolation approach [a], leads to a topology of iso-contours that in many cases is not consistent with any tensor interpolation and leads to a bias in the histogram. With this analysis, we want to emphasize the importance of being consistent with the chosen interpolation in all analysis steps. For our analysis, we have chosen a linear interpolation of tensor components, which is the most commonly used method in simulations and provides a valid continuous field. We do not want to make a statement about the quality or suitability of different interpolation methods in specific applications, however we want to point out that the independent interpolation of the direction field and the anisotropy violates in many cases the preservation of topological invariants and does not result in a valid tensor field.

More specifically we have presented a derivation for the computation of iso-contours and histograms in this setting. Component-wise linear interpolation of tensor components results in a quadratic function for anisotropy. The method is based on a subdivision of the mesh into triangles with monotonous behavior. This subdivision with a linear interpolation of the anisotropy, interpolation approach [b], already results in iso-contours that are topologically equivalent to the iso-contours based on the derived anisotropy field. However, the histograms are not accurate and show a bias towards larger anisotropy values. This is especially prominent in regions with many degenerate points. In areas of high anisotropy, interpolation [b] provides a good approximation. The method described in this chapter, the interpolation approach [c], can be used to compute an accurate continuous histogram for anisotropy using component-wise tensor interpolation.

All derivations in this chapter are given for the anisotropy defined as the difference between the major and minor eigenvalue, for 2D tensor fields. Although not trivial, the extension of this work to 3D tensor fields is feasible. An extension to the determinant, which is also quadratic but not elliptic, would be possible in a similar way. A general extension to other non-linear tensor invariants, however, might not be possible in a closed form and will require a good approximation schema. Therefore, we plan to explore methods for efficient approximations to the distributions with clear error bounds. Also, computing continuous scatterplots to visualize the space of multiple invariants at once is an interesting topic and will be subject of future work.