\chapter{Related work}\label{two}
Tools dedicated to facial analysis and comparison typically contain only the visualization techniques similar to these already imple\-mented in FIDENTIS Analyst application -- color maps and landmark-based visualizations. Therefore, based on the analysis of drawbacks of these techniques and the typical use cases of the application I conducted a research in other areas of 3D data visualization, comparative visualization as well as visualization and visual analysis of cohort study data that could be applicable in these use cases. According to \cite{gleicher2011visual}, there are three main approaches to visual data comparison: juxtaposition, superposition and explicit encoding. Juxtaposition is a method, which positions the objects next to each other and therefore is not suitable for comparing larger sets of data. The superposition approach is used to place objects one on top of the other and presenting them in the same time and space. This approach is also unusable for displaying larger sets of 3D objects, but is applicable in case of their subsets or cross-sections. The explicit encoding depicts the relationships between objects by encoding them visually and is therefore most suitable for large datasets. In following sections I will discuss several approaches that use both superimposition and explicit encoding principles.

\section{Order Independent Transparency}\label{OIT}
When using superimposition principle on 3D surfaces, trans\-par\-en\-cy plays an important role, since full opacity often covers important details. Unfortunately fixed OpenGL pipeline offers very little control over transparency and requires sorting the geometry in order to achieve correct results. With complex and intersecting objects this is difficult or downright impossible. Therefore several approaches to achieve so called Order Independent Transparency were introduced -- Depth Peeling, Dual Depth Peeling, Approximative techniques or Concurrent Linked Lists. 

Depth Peeling \cite{everitt2001interactive} is technique that works by front-to-back peeling of geometry layers. It is iterative method that requires several passes over geometry. In each pass a depth-map for the front layer is created so in next iteration anything with lower or equal depth can be "peeled". The algorithm blends the colors acquired in each layer with image acquired from previous layers. 

Dual Depth Peeling \cite{bavoil2008order} is an extension of original Depth Peeling algorithm which allows simultaneous peeling of two layers. Since default OpenGL depth buffer doesn't allow testing needed for this, custom depth buffer is necessary for this method and the default buffer is turned off.

Approximative techniques, such as ones presented in \cite{Meshkin2007, bavoil2008order, mcguire2013weighted}, try to avoid the necessity of sorting fragments by adjusting the compositing operator of alpha blending so that it is order independent.

All of the aforementioned techniques are limited in some way, either requiring multiple passes of geometry or providing only approximative results. They are also difficult to extend and modify in order to achieve context dependent results. A solution to this drawbacks provide Concurrent or Per Pixel Linked Lists (PPLL) that are constructed on GPU \cite{yang2010real}. For each pixel a list of fragments is created, each fragment pointing to its neighbors along viewing ray. After the creation of such lists, the task of computing the result by blending in correct order is trivial. 

\section{Opacity modulations}
However, even after solving the problem of correct transparency rendering, the interpretation and understanding of resulting image containing transparent surfaces is often difficult task. Busking et al. \cite{busking2011image} try to solve these issues by introducing a layered rendering pipeline for image-based rendering of intersecting surfaces. In their work they describe several techniques that enhance the understandability of transparently rendered surfaces and distances between them using glyphs, shadow-casting or fog simulation -- see Figure \ref{busking} for examples of their results. 


Other techniques try to improve the understandability of transparent surfaces purely by modifying transparency values. Here belong angle-based transparency \cite{hummel2010iris} -- setting the transparency to the angle between surface normal and viewing direction -- or normal variation transparency \cite{born2009illustrative}. Another technique introduced in \cite{carnecky2013smart} uses geodesic fragment neighbors for transparency modulation and contour rendering. For comparison of these techniques see Figure \ref{trasparency}.
\begin{figure}[h]
\centering
\scalebox{0.35}{\includegraphics{pictures/busking.png}}
\caption{Visualization of intersecting surfaces introduced in \cite{busking2011image}. (a)~Shadow-casting glyphs. (b) Fog simulation. (c) Relevance filtering.} \label{busking}
\end{figure}
\begin{figure}[h]
\centering
\scalebox{0.38}{\includegraphics{pictures/trasparency.png}}
\caption{Transparency modulations according to \cite{carnecky2013smart}. (a) Constant transparency. (b) Angle-based transparency. (c) Normal variation transparency. (d) Geodesic fragment neighbors-based transparency.} \label{trasparency}
\end{figure}

\section{Cross-sections and contours}
When using superimposition or juxtaposition principles, displaying big sets of 3D data all at once is ill-advised, because it often causes occlusions and visual clutter, which defeats the primary purpose of good visualization. A possible solution to this is cross-sectional view, an approach widely used in medicinal visualization for volumetric data, e.g. CT images, where a slice along given plane is projected into 2D space -- see Figure \ref{yadiv} for example.
\begin{figure}[h]
\centering
\scalebox{0.4}{\includegraphics{pictures/yadiv.png}}
\caption{Example of cross-sectional visualization in YaDiV software \cite{friese2011yadiv}.} \label{yadiv}
\end{figure}

A similar approach to this is contouring of specific object features followed by projection of contour into 2D space. This is often used when monitoring temporal changes of given feature -- such as cell size or width of molecular tunnel. Contours are also inseparable part of geospatial data visualization.

\section{Color coding and textures}
According to \cite{bertin2000matrix} color is one of the seven basic visual variables. It is therefore not surprising, that it is often used for explicit encoding of information, especially in case of 3D surfaces, where some of the other variables (size, shape, etc.) may not be applicable. I have described in previous chapter how color encoding is used in FIDENTIS Analyst application. Naturally, there are many other applications which use this principle for encoding data -- e.g. YMCA \cite{schmidtymca} and CloudCompare \cite{CCompare}, both of which are dedicated to mesh comparison.

Another example of color encoding are heat plots and dense pixel displays. These techniques are typical for displaying multivariate data, allowing to display large amounts of data at the same time. In combination with interactive options such as thresholding, filtering and data reorganization, they are very effective for discovering data relationships. 

Concerning the enhancement of perception of 3D shapes, a common practice is applying textures. Similarly to color encoding, stroke textures are frequently used to highlight the surface features such as curvature \cite{diewald2000anisotropic, interrante1997conveying} -- see Figure \ref{bunny}. Instead of strokes, various glyphs marking spots of significance can be mapped on the objects as well, often in combination with color mapping or opacity modulations.

\begin{figure}[h]
\centering
\scalebox{0.25}{\includegraphics{pictures/bunny.png}}
\caption{Example of texture indicating principal directions of curvature and color map indicating the curvature values \cite{diewald2000anisotropic}.} \label{bunny}
\end{figure}

\section{Interactive visual analysis}
The visualization techniques I have described are often embedded in large systems as features supporting the numerical or statistical analysis and results. The growth of acquired data in the past years, brought on by constantly evolving technology, increases the demand for effective and efficient data processing tools. In these terms, visual analysis -- an interactive approach combining computational power, numerical analysis and visualization -- has proven to be suitable technique, especially for multivariate, high-dimensional data. The problem with such data, often obtained e.g. by medical cohort studies, is that the data is often defined on domains that only partially overlap. Still, many toolboxes and applications for visual analysis of scientific data have been developed, each tailored to the specific needs of given area. 

Example of such toolbox directly related to my area of focus is aforementioned YMCA -- Your Mesh Comparison Application \cite{schmidtymca}. The original goal of the application was comparison and analysis of different point-cloud reconstruction algorithms -- detection of problematic parts and comparison of performance. However the provided tools are applicable in many areas where mesh comparison is necessary. As is typical for visual analysis tools, it provides several different views of data. In this case, the authors try to overcome the issues of comparing multiple 3D meshes by combining 3D mesh representation -- with color encoding and opacity modulations for displaying mesh variance and detected variance hot-spots -- and 2D view using parallel coordinates for analysis of performance of algorithms on different datasets in terms of global error value -- see Figure \ref{ymca}. The application also contains tools for detail analysis -- so called magic lens tool, which allows user to analyze the error values in selected areas -- and data summarization tools, which serve for quick data categorization. 
\begin{figure}[h]
\centering
\scalebox{0.25}{\includegraphics{pictures/ymca.png}}
\caption{Example of tools provided in YMCA \cite{schmidtymca}. (a) Color map. (b) Detailed view. (c) Parallel coordinates for comparison of algorithms.} \label{ymca}
\end{figure}


Another example of interactive visual analysis tool presented in \cite{angelelli2014interactive} focuses on the problem of analysis of heterogeneous cohort-study data. The authors present a Data-Cube-Based model for representation and aggregation of data defined across different, only partially matching domains. This model serves as basis for interactive selection, matching and filtering of the data in their prototype application, which again uses various techniques of data representation (scatter plots, histograms, atlas view -- modified 3D view, etc.) to provide detailed view as well as relevant summarization.