\hypertarget{pageModules_secModuleList}{}\subsection{List of modules currently integrated}\label{pageModules_secModuleList}
The following modules are available in the application\+:


\begin{DoxyItemize}
\item {\bfseries Pre-\/\+Process} 
\begin{DoxyItemize}
\item \hyperlink{modulecheck}{Check Module} \+: checks the H\+B\+M when it is imported.
\end{DoxyItemize}
\item {\bfseries Scale} 
\begin{DoxyItemize}
\item \hyperlink{moduleAnthropometricPersonalization}{Anthropo Module} \+: estimates anthropometric dimensions based on a set of predictors (scaling)
\item \hyperlink{modulescalingconstr}{Scaling Constraint Module} \+: allows building a correspondence between anthropometric dimensions and a H\+B\+M to prepare scaling, and calls the Kriging module to transform the H\+B\+M (scaling)
\end{DoxyItemize}
\item {\bfseries Position} 
\begin{DoxyItemize}
\item \hyperlink{modulePhysPosiInter}{Pre-\/\+Positioning Module} \+: pre-\/position the P\+I\+P\+E\+R model using an interactive physics-\/based simulation (positioning)
\item \hyperlink{modulePhysPosiDeform}{Fine-\/\+Positioning Module} \+: position the H\+B\+M using physics-\/based simulation (refinement of pre-\/position) (positioning)
\end{DoxyItemize}
\item {\bfseries Post-\/\+Process} 
\begin{DoxyItemize}
\item \hyperlink{modulemeshoptim}{Smoothing module} \+: tool to improve the quality of the H\+B\+M by smoothing the mesh or the transformation (post-\/process)
\end{DoxyItemize}
\item {\bfseries Tools} 
\begin{DoxyItemize}
\item \hyperlink{modulekriging}{Kriging Module} \+: transforms the H\+B\+M using Kriging interpolation and sets of control points (tool)
\item \hyperlink{moduleContourDeformation}{Contour Deformation Module} \+: tool to transform the H\+B\+M using contour based approaches (tool, scaling, positioning)
\item \hyperlink{modulePhysShape}{Shaping Module} \+: tool to shape the flesh of you H\+B\+M using a set of point handles (beta version)
\item \hyperlink{modulescalingparameter}{Scaling Parameter Module} \+: tool to modify model parameters (tool, post-\/process)
\end{DoxyItemize}
\item {\bfseries Custom} 
\begin{DoxyItemize}
\item \hyperlink{moduleChildScaling}{Scaling the P\+I\+P\+E\+R child model by age} \+: a small module/function dedicated to the age scaling of the P\+I\+P\+E\+R child model (scaling)
\end{DoxyItemize}
\end{DoxyItemize}

Several modules are typically used (chained) to perform a transformation. An overview of the articulation of the modules and functionalities for positioning and scaling is provided below. A few examples of workflows are also provided in the \hyperlink{pageWorkflow}{Workflow Examples}.


\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{modules_overview.png}
\caption{Overview of the articulation of the modules}
\end{DoxyImage}
\hypertarget{pageModules_secModuleScalingIntro}{}\subsection{Scaling in P\+I\+P\+E\+R\+: overview}\label{pageModules_secModuleScalingIntro}
H\+B\+M Scaling approaches seem more widespread in the literature than positioning approaches. The P\+I\+P\+E\+R framework provides several tools than greatly can help with H\+B\+M scaling mainly based on anthropometric dimensions or landmarks (unfortunately, no module using Statistical Shape Models could be integrated yet) The main modules provided include\+:
\begin{DoxyItemize}
\item a module to estimates anthropometric dimensions based on a set of predictors (\hyperlink{moduleAnthropometricPersonalization}{Anthropo Module}) and three public anthropometric databases from children to elderly. A functionality to predict anthropometric dimensions directly using the G\+E\+B\+O\+D regression is also included.
\item the \hyperlink{modulescalingconstr}{Scaling Constraint Module} to build interactively correspondences between anthropometric dimensions and a H\+B\+M to prepare scaling. The module can also call all required modules to define the target and perform the transformation
\item a geometrical interpolation module to support model morphing (\hyperlink{modulekriging}{Kriging Module}). The module integrates many numerical features useful within the context of H\+B\+M scaling (allows arbitrary number of control points, automatic control point decimation, weighting of the bone and skin, use of surface distance...)
\item a module (\hyperlink{moduleChildScaling}{Scaling the P\+I\+P\+E\+R child model by age}) dedicated to the P\+I\+P\+E\+R Child scaling with age, which allows generating easily models by selecting and age or stature started (based on the G\+E\+B\+O\+D regressions). The functionality to scale the material parameters with age is also included as an experimental feature.
\item a \hyperlink{moduleContourDeformation}{Contour Deformation Module} to transform the H\+B\+M using contour based approaches
\end{DoxyItemize}\hypertarget{pageModules_secModulePositioningIntro}{}\subsection{Positioning in P\+I\+P\+E\+R\+: overview}\label{pageModules_secModulePositioningIntro}
Positioning finite element Human Body Models (H\+B\+M) for safety is a challenging task. To the contrary of dummies, applying a succession of rotations and translations is not possible because the H\+B\+M includes non robotic joints with complex articular contacts because soft tissues need to be deformed along. Because of this, H\+B\+M positioning is typically performed by finite element simulation. These can be time consuming to set up and to run. Beyond that, the properties of the H\+B\+M were typically selected for their response at high acceleration levels and may not be appropriate for physiological motion or low deceleration. Furthermore, postural preferences and muscular reactions also affect the posture .

The P\+I\+P\+E\+R framework aims to propose some alternative methodologies that can be used along current approaches. Positioning in P\+I\+P\+E\+R typically starts with the \hyperlink{modulePhysPosiInter}{Pre-\/\+Positioning Module} (or pre-\/positioning). The H\+B\+M is automatically transformed into a simplified model with a limited number of degrees of freedom that can be used in physics-\/based interactive simulation. Despite being simplified and interactive, the simulation can among others account for collisions between bones (to prevent penetration, limit range of motion, ...) and provide a rough transformation of the soft tissues.

The pre-\/positioning process is the place where the user can input its various constraints, weight them, and compute a plausible posture (for the skeleton in particular). Constraints could also include {\itshape a priori} knowledge such as physiological observations or postural preferences which are not classical mechanical parameters. For now, physiological descriptions of the spinal curvature (called \hyperlink{modulePhysPosiInter_secPhysPosiInterSpine}{Spine controller}) can interact with the model (e.\+g. collision detection on the vertebrae) during postural change.

Several options are then possible to transform the H\+B\+M using this pre-\/position as the target\+:
\begin{DoxyItemize}
\item the \hyperlink{modulePhysPosiDeform}{Fine-\/\+Positioning Module} \+: the pre-\/positioning motion can be repeated (using the constraints or the bone positions) with finer parameters for the simulation. While more time consuming (for the initialization in particular), it can provide a more plausible deformation of the flesh.
\item the \hyperlink{moduleContourDeformation}{Contour Deformation Module} can be applied using the bony landmarks from the preposition as a target. It can also be used independently
\item the pre-\/position can be used to generate a finite element simulation input (though a python script, an example being provided) and a full finite element simulation can be run.
\end{DoxyItemize}

In all cases, the use of the \hyperlink{modulemeshoptim_meshoptimTranssmoothing}{Transformation smoothing} after positioning was found to greatly improve the results. In some cases (for smaller motion), the pre-\/position may be directly used and lead to a plausible and runnable model after smoothing.

In all cases, smoothing functionalities can be used to improve the H\+B\+M quality (\hyperlink{modulemeshoptim}{Smoothing module}). \hypertarget{modulecheck}{}\subsection{Check Module}\label{modulecheck}
\hypertarget{modulecheck_secCheckOverview}{}\subsubsection{Overview}\label{modulecheck_secCheckOverview}
The application starts with this module which checks several elements of the model and outputs a \hyperlink{modulecheck_secCheckDiagnostic}{Diagnostic}, it also offer to explore the model in a 3\+D view.


\begin{DoxyItemize}
\item {\bfseries Parameters\+:} None
\item {\bfseries Metadata\+:} 
\begin{DoxyItemize}
\item Required\+: None
\item Optional\+: Any
\end{DoxyItemize}
\item {\bfseries Target} Input\+: Any
\item {\bfseries Target} Output\+: None
\end{DoxyItemize}

\begin{DoxyAuthor}{Author}
Thomas Lemaire -\/ I\+N\+R\+I\+A
\end{DoxyAuthor}
\hypertarget{modulecheck_secCheckDiagnostic}{}\subsubsection{Diagnostic}\label{modulecheck_secCheckDiagnostic}
In this mode various information on the model and its metadata are displayed.

 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{check01.png}
\caption{Diagnostic in the check module}
\end{DoxyImage}



\begin{DoxyItemize}
\item {\bfseries search\+:} highlight a word in the diagnostic text
\item {\bfseries Anatomical frame\+:} check for anatomical frames availability (these frames are defined in \hyperlink{pageAppendixFrame}{Appendix\+: List of frames})
\item {\bfseries Verbose\+:} print even more information
\end{DoxyItemize}\hypertarget{modulecheck_secCheckHints}{}\subsubsection{Hints}\label{modulecheck_secCheckHints}
If you see warning regarding landmarks, joints, etc, it may be that the name of the entity is not present in the anatomy database (misspelling of other).\hypertarget{modulecheck_secCheck3dView}{}\subsubsection{3\+D View}\label{modulecheck_secCheck3dView}
In this mode the user can explore the model and its metadata using the \hyperlink{pageGui_secDisplay3DVtk}{Generic viewer}. \hypertarget{moduleAnthropometricPersonalization}{}\subsection{Anthropo Module}\label{moduleAnthropometricPersonalization}
\hypertarget{moduleAnthropometricPersonalization_anthrointro}{}\subsubsection{Introduction}\label{moduleAnthropometricPersonalization_anthrointro}
For Human Body Model (H\+B\+M) scaling, example of scenarios include users that would like to generate the most likely subject matching a few characteristics\+:
\begin{DoxyItemize}
\item a given height and weight (e.\+g. average female)
\item one of the height, seating height and shoulder width specified in the E\+C Regulation R129 for child restraint systems
\item the few measurements available on a P\+M\+H\+S in a published validation study
\item ...
\end{DoxyItemize}

Alone, such characteristics may be insufficient to drive the scaling of a H\+B\+M. However, they could be completed by using statistical relationships ({\itshape a priori} knowledge) linking these known characteristics (called predictors) to outputs such as anthropometric dimensions or shapes. The anthropometric dimensions can then be used in other modules such as the \hyperlink{modulescalingconstr}{Scaling Constraint Module} to scale a model. The current module focuses on the prediction of anthropometric dimensions based on a limited but arbitrary set of predictors.\hypertarget{moduleAnthropometricPersonalization_anthrodesc}{}\subsubsection{Description / methodology}\label{moduleAnthropometricPersonalization_anthrodesc}
The Anthropometric Prediction module can be used to generate anthropometric targets (in the sense of the \hyperlink{pageFramework}{P\+I\+P\+E\+R Framework}) based on a set of predictors and anthropometric datasets. The underlying statistical process is based on Parkinson and Reed 2010 (see \hyperlink{moduleAnthropometricPersonalization_anthroref}{References}). It is fully automated.

A regression between selected predictors, such as weight, is first evaluated for a chosen population. A set of targets is then sampled from this regression measurements that can be used in other modules to personalize a model.

Targets can be sampled from the regression by including the regression error or not (sampled\+Output or mean\+Only). Similarly, the values of the predictors can either be forced to a given value or sampled from a statistical distribution (Fixed Predictor/\+Sampled Predictor). That statistical distribution is estimated from a population that can be the same as the one used to generate the regression or from a different one.

Populations are constructed by upsampling through the definition of some bins or subsets of population they consist of. Each bin is defined by a set of criteria. For example, a population could contain a single bin consisting of female subjects between the ages of 20 and 35, or it could consist of two bins of female subjects respectively between the ages of 18 and 35, and the ages of 36 and 65. Please note that you have to define the same amount of criterias in each bins.

The module can deal with multiple datasets. Three publicly released datasets are provided with the release and named as follows\+:
\begin{DoxyItemize}
\item A\+N\+S\+U\+R\+: public dataset with anthropometric measurements on military personnel (almost 4000 subjects, ages\+: 17-\/51. See \hyperlink{moduleAnthropometricPersonalization_anthroref}{References})
\item C\+C\+T\+A\+N\+T\+H\+R\+O\+: dataset released under a C\+C-\/\+B\+Y 4.\+0 Licence with anthropometric measurements on Post Mortem Human Subjects (105 subjects, ages\+: 55-\/94. See \hyperlink{moduleAnthropometricPersonalization_anthroref}{References})
\item S\+N\+Y\+D\+E\+R\+: public data corresponds to anthropometric measurements performed on children (about 3900 subjects, ages\+: 1-\/19, not all measurements available for all subjects. See \hyperlink{moduleAnthropometricPersonalization_anthroref}{References})
\end{DoxyItemize}

\begin{DoxyRemark}{Remarks}
Warning\+: while the process is automated, it is critical to remember the principles of the underlying process. The plausibility of the predicted target is widely dependent on the relationship between the set of predictors and the dataset (how far is the set of predictor from actual data present in the dataset). Depending on the selection of predictors and their value, the predicted target may be based on unrealistic extrapolations. More feedback about this will be added in the future.
\end{DoxyRemark}
\hypertarget{moduleAnthropometricPersonalization_anthroparam}{}\subsubsection{Parameters and Options}\label{moduleAnthropometricPersonalization_anthroparam}

\begin{DoxyItemize}
\item {\bfseries Parameters \+:}~\newline
 Optional\+: none~\newline
 ~\newline

\item {\bfseries Inputs \+:}~\newline
 Interactive menus (opening on the right of the window) help the user selecting the inputs. The set of anthropometric targets are then generated and saved in the results directory by clicking on the \char`\"{}\+Generate Targets\char`\"{} button. The target can be generated when all indicators are in green (all inputs ok)~\newline
 ~\newline

\item {\bfseries Parameters \+:} ~\newline
 Select if you want to generate a New Regression of reuse one that was previously generated and saved.~\newline
 ~\newline

\item {\bfseries Dataset options\+: } ~\newline

\begin{DoxyItemize}
\item Select the dataset (see \hyperlink{moduleAnthropometricPersonalization_anthrodesc}{Description / methodology})
\item Select the variables that will be generate (=target or measure of interest) and predictors. For S\+N\+Y\+D\+E\+R\+: not all measurements are available for all subjects. For A\+N\+S\+U\+R\+: all measurements are generated.
\item Select the population characteristics\+: this is the population you want to base the target generation on. First we need to determine how many bins/subsets of population we want to work with. Once you have defined the number of bins, each bin can be defined with this optional set of criteria\+: \% of population, gender, ethnicity, age
\begin{DoxyItemize}
\item {\bfseries \% of population \+:} Set the percentage of the population described by this bin.
\item {\bfseries Gender \+:} Set the gender of this bin of population.
\item {\bfseries Ethnicity \+:} Set the ethnicity of this bin of population.
\item {\bfseries Age \+:} Set the age range of this bin of population (pre-\/filled with the maximum range) ~\newline

\end{DoxyItemize}
\end{DoxyItemize}
\item {\bfseries Target information}~\newline

\begin{DoxyItemize}
\item {\bfseries Sample Type\+: } ~\newline
 Here you can select if you want the sample type to be mean\+Only type, sampled\+Output type or both. If you desire mean values of the anthropometric measurements for specific values of the predictors, choose \textquotesingle{}mean\+Only\textquotesingle{}. Otherwise, samples will be drawn among the subjects that share the same predictor values and you will select \char`\"{}\+Normal\char`\"{} for \char`\"{}sample output type\char`\"{}, to indicate that the samples use normal distribution.
\item {\bfseries Sample input type\+: } ~\newline
 Here you decide if the values of the predictors you previsously selected in the regression definition, will be sampled or fixed predictor.
\begin{DoxyItemize}
\item {\bfseries Fixed Predictor} ~\newline
 The choice of Fixed Predicators allow you to determine an exact value for each one of the predictors you selected from the predictor list. If you chose \char`\"{}sampled\+Output\char`\"{} as sample type, you will have to determine the number of samples of sets of targets you desire.
\item {\bfseries Sampled Predictor}
\begin{DoxyItemize}
\item {\bfseries Sample input type} Select the type of sample input, only \char`\"{}normal\char`\"{} available
\item {\bfseries Number of samples} Define the number of sampled predictors that will be used for the target generation
\item {\bfseries sample Input reference population Mat file} Define the input reference population mat file that may be used when the statistical distribution is estimated from a population different from the one used in the current regression (upsampled populations are saved in the regression $\ast$.mat files together with the regression information). ~\newline

\end{DoxyItemize}
\end{DoxyItemize}
\item {\bfseries Sample Output type} Select the type of sample output, only \char`\"{}normal\char`\"{} available~\newline
~\newline

\end{DoxyItemize}
\item {\bfseries Output options}~\newline

\begin{DoxyItemize}
\item Select where and under which name the target files will be saved. The files will be numbered automatically when there are several
\item (optional) Select where the regression will be saved if you would like to re-\/use it later.
\end{DoxyItemize}
\end{DoxyItemize}

\begin{DoxyRemark}{Remarks}
The functionalities are implemented into a set of Octave scripts called by a G\+U\+I in the P\+I\+P\+E\+R application. Some parameters are not implemented in the G\+U\+I and are available in the code.
\end{DoxyRemark}
\hypertarget{moduleAnthropometricPersonalization_anthroref}{}\subsubsection{References}\label{moduleAnthropometricPersonalization_anthroref}

\begin{DoxyItemize}
\item A\+N\+S\+U\+R\+: Gordon C\+C, Bradtmiller B, Churchill T, Clauser C\+E, Mc\+Conille J\+T, Tebbetts I, Walker R\+A. 1988 anthropometric survey of U.\+S. army personnel\+: methods and summary statistics. Technical Report N\+A\+T\+I\+C\+K T\+R-\/89 044. Natick, M\+A\+: U.\+S. Army Natick Research, Development, and Engineering Center. 1989. Data downloaded from \href{http://mreed.umtri.umich.edu/mreed/}{\tt http\+://mreed.\+umtri.\+umich.\+edu/mreed/}
\item C\+C\+Tantrho\+: database released under C\+C-\/\+B\+Y-\/4.\+0 by C\+E\+E\+S\+A\+R in 2017 and distributed by P\+I\+P\+E\+R. Publication pending.
\item Parkinson, M. and Reed, M.\+P. Creating virtual user populations by analysis of anthropometric data. International Journal of Industrial Ergonomics, 2010, 40, 106–111
\item S\+N\+Y\+D\+E\+R\+: Snyder, R, L Schneider, C Owings, H Reynolds, D Golomb, M Sckork. (1977) Anthropometry of infants, children, and youths to age 18 for product safety design. U\+M-\/\+H\+S\+R\+I-\/77-\/17, C\+P\+S\+C, Bethesda, M\+D. Data downloaded from \href{http://mreed.umtri.umich.edu/mreed/}{\tt http\+://mreed.\+umtri.\+umich.\+edu/mreed/} 
\end{DoxyItemize}\hypertarget{modulescalingconstr}{}\subsection{Scaling Constraint Module}\label{modulescalingconstr}
\hypertarget{modulescalingconstr_scalconstrintro}{}\subsubsection{Introduction}\label{modulescalingconstr_scalconstrintro}
To scale a Human Body Model (H\+B\+M) a set of anthropometric target dimension values can be defined, using for example \hyperlink{moduleAnthropometricPersonalization}{Anthropo Module}. However, those set of target values are not sufficient to provide constraints for transformation module (like \hyperlink{modulekriging}{Kriging Module}). This module aims to interpret this set of anthropometric target dimension values into geometrical constraints to define the scaling H\+B\+M transformation. For example, a anthropometric dimension that defines a length is defined using a segment between two landmarks on H\+B\+M. This interpretation is performed with help of a Simplified Scalable model. To construct this simplified scalable model, this current provides tools to interactively describe geometrically anthropometric dimensions on H\+B\+M and measure anthropometric dimension value. The simplified scalable model is composed of all defined dimensions, organized in tree-\/like structure to establish relationships between anthropometric dimensions. Applying appropriate scaling transformation according to target value for each dimension following this tree-\/like structure, equivalent target dimensions are defined geometrically (the position of the target segment). Thus, on both dimensions (defined on H\+B\+M and target dimensions), a set of control points can be defined to fully specify a kriging transformation to scale the H\+B\+M according to a set of anthropometric dimension target values.\hypertarget{modulescalingconstr_scalconstrdesc}{}\subsubsection{Description / methodology}\label{modulescalingconstr_scalconstrdesc}
Following types of anthropometric dimension can be defined on H\+B\+M using a Simplified Scalable model\+:
\begin{DoxyItemize}
\item Length
\item Multilength
\item Circumference
\item Width
\item Depth
\end{DoxyItemize}

{\bfseries Length} and {\bfseries Multilength\+:} a \hyperlink{modulescalingconstr_secSegmentScalConstr}{Segment Component} needs to be defined on H\+B\+M.

{\bfseries Circumference}, {\bfseries Width} and {\bfseries Depth\+:} a \hyperlink{modulescalingconstr_secSectionScalConstr}{Section Component} can be defined on H\+B\+M.

A Simplified Scalable model is composed of\+:
\begin{DoxyItemize}
\item a list of \hyperlink{modulescalingconstr_secComponentsScalConstr}{Component} organized in tree-\/like structure.
\item a list of \hyperlink{modulescalingconstr_secDimensionsScalConstr}{Anthropometric Dimensions} to link dimensions to components.
\end{DoxyItemize}\hypertarget{modulescalingconstr_secComponentsScalConstr}{}\paragraph{Component}\label{modulescalingconstr_secComponentsScalConstr}
To measure dimensions on H\+B\+M, geometrical components can be defined interactively on H\+B\+M using this current module.

Common properties of component\+:
\begin{DoxyItemize}
\item a type\+: \hyperlink{modulescalingconstr_secSegmentScalConstr}{Segment Component} or \hyperlink{modulescalingconstr_secSectionScalConstr}{Section Component}
\item a name
\item a parent name (optional)\+: by defining a parent, parent transformation is applied first, before the component scaling transformation.
\end{DoxyItemize}\hypertarget{modulescalingconstr_secSegmentScalConstr}{}\subparagraph{Segment Component}\label{modulescalingconstr_secSegmentScalConstr}
A segment component is defined by a list of via-\/point (minimum 2). Via-\/point coordinates are defined as the barycenter of a selection of H\+B\+M landmarks (at least one landmark per via-\/point). The length dimension is computed by the Euclidean distance between the last and the first via-\/points. The Multilength dimension is defined as the cumulative sum of Euclidean distances between successive via-\/points that composed the segment component. A local frame is associated to each component to define the scaling transformation. Z axis correspond to the normalized vector defined from the first via-\/point to the last one.

 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{scalconstraint_segment.png}
\caption{Example of segment to measure the buttock to knee length, defined from landmarks in yellow}
\end{DoxyImage}
\hypertarget{modulescalingconstr_secSectionScalConstr}{}\subparagraph{Section Component}\label{modulescalingconstr_secSectionScalConstr}
The section is defined as the intersection between a plane and en entity 2\+D envelop (can be a skin entity, a bone...). To define the plane, a relative position along a parent segment has to be defined and Z axis of the parent segment defines the normal of intersection plane. For section, Z axis is defined as the normal of the section plan. X and Y axis are interactivly defined. Circumference dimension is computed as the length of the intersection contour. The width is computed as the difference between the maximal Y value and the minimal one in the local section frame. For depth dimension, X direction is considered.

 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{scalconstraint_section.png}
\caption{Example of a section define on thigh, cirumference, width or depth dimension can be measured on this section.}
\end{DoxyImage}
\hypertarget{modulescalingconstr_secDimensionsScalConstr}{}\paragraph{Anthropometric Dimensions}\label{modulescalingconstr_secDimensionsScalConstr}
A name is defined for each dimension. The name of anthropometric dimension must correspond to the anthropometric target name to be applied. To compute the scale factor associated to the target value, a reference component is selected. The scaling factor is computed as the ratio between target value and value measured on H\+B\+M on the reference component according to the dimension type. Depending of the dimension type, a scaling transformation is defined. Then, this scaling transformation is applied to a list of selected components in their own local frame, after applying parent transformation.

 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{scalconstraint_example.png}
\caption{Example of a simplified scalable model defined to represent a selection of A\+N\+S\+U\+R database anthropometric measurements and the corresponding target.}
\end{DoxyImage}
\hypertarget{modulescalingconstr_scalconstrparam}{}\subsubsection{Parameters and Options}\label{modulescalingconstr_scalconstrparam}

\begin{DoxyItemize}
\item {\bfseries Parameters\+:} None
\item {\bfseries Metadata\+:} 
\begin{DoxyItemize}
\item Required\+: entities, landmarks used used in the construction of the Simplified Scalable Model.
\item Optional\+: None
\end{DoxyItemize}
\item {\bfseries Target} Input\+: Target of type anthropometric and landmarks
\item {\bfseries Target} Output\+: Target of type anthropometric and landmarks
\item {\bfseries Inputs\+:} 
\begin{DoxyItemize}
\item The simplified scalable model can be imported from a xml file.
\end{DoxyItemize}
\item {\bfseries Outputs\+:} 
\begin{DoxyItemize}
\item The simplified scalable model can be exported in a xml file. 
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{modulePhysPosiInter}{}\subsection{Pre-\/\+Positioning Module}\label{modulePhysPosiInter}
This module implements a physics simulation with a reduced number of degrees of freedom.

Hence the user can {\itshape interactively} position the Human Body Model. The main focus of this module is to define the target bones position of the H\+B\+M. The final deformation can be obtained with the \hyperlink{modulePhysPosiDeform}{Fine-\/\+Positioning Module} or the \hyperlink{moduleContourDeformation}{Contour Deformation Module}. Please refer to \hyperlink{pageModules_secModulePositioningIntro}{Positioning in P\+I\+P\+E\+R\+: overview} for a general introduction.


\begin{DoxyItemize}
\item {\bfseries Metadata\+:} The skin and skeleton must be defined by \hyperlink{pageFramework_secFrameworkMetadataEntity}{Entity}, the kinematics of the H\+B\+M is constructed from \hyperlink{pageFramework_secFrameworkMetadataJoint}{Joint} and \hyperlink{pageFramework_secFrameworkMetadataContact}{Contact}. More details are given in the \hyperlink{modulePhysPosiInter_secModulePhysPosiInterMetadata}{Metadata} section.
\item {\bfseries Input Targets}\+:
\begin{DoxyItemize}
\item any user defined target (fixed bone, joint, frame to frame, landmark), see also \hyperlink{pageFramework_secFrameworkTarget}{Target}
\end{DoxyItemize}
\item \hyperlink{modulePhysPosiInter_secModulePhysPosiInterTarget}{Output Targets} \+:
\begin{DoxyItemize}
\item the current user defined targets
\item all bones inertia frame position (world frame to inertia frame targets), to work with the \hyperlink{modulePhysPosiDeform}{Fine-\/\+Positioning Module}
\item all landmarks position
\end{DoxyItemize}
\item {\bfseries Output}\+:
\begin{DoxyItemize}
\item \hyperlink{modulePhysPosiInter_secModulePhysPosiInterUpdate}{Model nodes update}
\item \hyperlink{modulePhysPosiInter_secModulePhysPosiInterScripting}{Scripting}
\end{DoxyItemize}
\item {\bfseries Bibliography\+:} \char`\"{}\+Stable Constrained Dynamics\char`\"{}, Maxime Tournier, Matthieu Nesme, Benjamin Gilles, François Faure, A\+C\+M Transactions on Graphics, Proceedings of S\+I\+G\+G\+R\+A\+P\+H, 2015
\end{DoxyItemize}

\begin{DoxyAuthor}{Author}
Thomas Lemaire -\/ I\+N\+R\+I\+A
\end{DoxyAuthor}
\hypertarget{modulePhysPosiInter_secModulePhysPosiInterMetadata}{}\subsubsection{Metadata}\label{modulePhysPosiInter_secModulePhysPosiInterMetadata}

\begin{DoxyItemize}
\item \hyperlink{pageFramework_secFrameworkMetadataEntity}{Entity}
\begin{DoxyItemize}
\item {\bfseries \mbox{[}R\+E\+Q\+U\+I\+R\+E\+D\mbox{]}} {\itshape Bones} and a single {\itshape Skin} or a set of skin entities including {\itshape Skin\+\_\+of\+\_\+head, Skin\+\_\+of\+\_\+body\+\_\+proper, Skin\+\_\+of\+\_\+\{left,right\}\+\_\+free\+\_\+upper\+\_\+limb and Skin\+\_\+of\+\_\+\{left,right\}\+\_\+free\+\_\+lower\+\_\+limb} (see the \hyperlink{modulePhysPosiInter_secModulePhysPosiInterHowTo}{How to...}).
\item {\itshape Articular capsules} can be defined to make the flesh slide on the bone around a joint. This prevents flesh 3d elements close to the joints to suffer large deformation and quality degradation when the joint moves. Normals at the capsule surface must point outwards the flesh, hence toward the joint center. In conjunction with capsules, the corresponding bony regions included in the capsule must be defined (see below)
\item {\itshape Ligaments} must be defined when a capsule is defined, to prevent them from penetrating into the bones.
\item For constraints such that bone, and ligament collision or sliding contacts, the normals of the meshes must be properly defined pointing outside.
\end{DoxyItemize}
\item \hyperlink{pageFramework_secFrameworkMetadataJoint}{Joint}, \hyperlink{pageFramework_secFrameworkMetadataAnatJoint}{Anatomical Joint} and \hyperlink{pageFramework_secFrameworkMetadataContact}{Contact} are used to create the kinematics model for the positioning.
\item \hyperlink{pageFramework_secFrameworkMetadataLandmark}{Landmark}
\begin{DoxyItemize}
\item Some landmarks are required for the \hyperlink{modulePhysPosiInter_secModulePhysPosiInterPredictorsSpine}{Spine predictor}
\item Based on available landmarks, the I\+S\+B Bone Coordinate System (B\+C\+S) and Joint Coordinate System (J\+C\+S) will be available in the frame controller (\hyperlink{pageAppendixFrame}{Appendix\+: List of frames})
\item The landmarks can also be controlled with the \hyperlink{modulePhysPosiInter_secPhysPosiInterLandmark}{Landmark controller}
\end{DoxyItemize}
\item \hyperlink{pageFramework_secFrameworkMetadataNamedMetadata}{Named Metadata}
\begin{DoxyItemize}
\item {\itshape custom\+\_\+affine} named metadata define positions where custom affine frames can be added to a deformable entity like skin, capsule or ligament, the naming scheme is {\itshape custom\+\_\+affine\+\_\+\+\_\+\+Name\+\_\+of\+\_\+entity} -\/ example\+: {\itshape custom\+\_\+affine\+\_\+\+\_\+\+Skin\+\_\+of\+\_\+left\+\_\+arm} 
\item {\itshape bone\+\_\+region} named metadata define the bone region which is included in a given capsule, the naming scheme is {\itshape bone\+\_\+region\+\_\+\+\_\+\+Name\+\_\+of\+\_\+bone\+\_\+\+\_\+\+Name\+\_\+of\+\_\+capsule} -\/ example\+: {\itshape bone\+\_\+region\+\_\+\+\_\+\+Left\+\_\+femur\+\_\+\+\_\+\+Articular\+\_\+capsule\+\_\+of\+\_\+left\+\_\+knee\+\_\+joint} 
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{modulePhysPosiInter_secModulePhysPosiInterSimu}{}\subsubsection{Simulation model}\label{modulePhysPosiInter_secModulePhysPosiInterSimu}
The simulation model is built using the geometry defined in the P\+I\+P\+E\+R model, the metadata information is used as follow \+:
\begin{DoxyItemize}
\item {\itshape bones} \hyperlink{pageFramework_secFrameworkMetadataEntity}{Entity} are simulated as rigid bodies, collision constraints are created with consecutive bones (can be disabled)
\item the material inside the {\itshape skin} \hyperlink{pageFramework_secFrameworkMetadataEntity}{Entity} is simulated as a uniform elastic material
\item the \hyperlink{pageFramework_secFrameworkMetadataJoint}{Joint} and \hyperlink{pageFramework_secFrameworkMetadataAnatJoint}{Anatomical Joint} are added as cinematic constrained
\item the \hyperlink{pageFramework_secFrameworkMetadataContact}{Contact} defined between bones are also simulated, the distance between the two contact surfaces tries to be maintained
\item capsules and ligaments are simulated and collision constraints are created with related bones (can be disabled)
\end{DoxyItemize}

The time needed to build the simulation is typically between less than 1 minute and a few minutes depending on the size of the H\+B\+M and the speed of your machine. The simulation is then run in the \href{https://www.sofa-framework.org/}{\tt S\+O\+F\+A Framework}.\hypertarget{modulePhysPosiInter_secModulePhysPosiInterParam}{}\subsubsection{Parameters}\label{modulePhysPosiInter_secModulePhysPosiInterParam}
the Pre-\/\+Position module can be controlled by parameters, they have reasonable default values and can be defined in the \hyperlink{pageGui_secGuimoduleParam}{Module parameters} dialog. These parameters let degrade the precision of the deformation field, which is not of first interest in this module, in favor of loading time and interactivity.\hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamBoneColEnabled}{}\paragraph{bone collision}\label{modulePhysPosiInter_secModulePhysPosiInterParamBoneColEnabled}
Enable/disable bone collision \hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamCapsuleEnabled}{}\paragraph{articular capsule}\label{modulePhysPosiInter_secModulePhysPosiInterParamCapsuleEnabled}
Enable/disable articular capsule simulation, which includes \+: adding {\itshape affine frames} to the capsule to better deform them, the same for ligaments entities, and lastly enable collisions between the capsule surface, the ligaments and the bones involved in that articular joint. \hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamBoneColNbVertex}{}\paragraph{Number of collision vertices}\label{modulePhysPosiInter_secModulePhysPosiInterParamBoneColNbVertex}
Default number of closest vertices considered in bone, capsule and ligaments collision, if this number is too low bones can {\itshape oscillate} between two collisions. The value can also be changed during the positioning in \hyperlink{modulePhysPosiInter_secPhysPosiInterControl}{Simulation control}. A value of 0 means all vertices are considered. \hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamCapsuleNbFrames}{}\paragraph{Frames per capsule}\label{modulePhysPosiInter_secModulePhysPosiInterParamCapsuleNbFrames}
Set the number of {\itshape affine frames} sampled for each capsule, increase this number if you think the capsules do not have enough degrees of freedom to react to collisions. \hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamCustomAffine}{}\paragraph{custom affine}\label{modulePhysPosiInter_secModulePhysPosiInterParamCustomAffine}
Enable/disable additionnal affines define in \hyperlink{modulePhysPosiInter_secModulePhysPosiInterMetadata}{Metadata} \hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamVoxelSize}{}\paragraph{voxel size}\label{modulePhysPosiInter_secModulePhysPosiInterParamVoxelSize}
The input H\+B\+M geometry is rasterized in a 3\+D grid to prepare the simulation model. This parameter controls the size of the voxels of this grid. This value can be decreased if you encounter {\itshape topological} problems in the interactive model (such as close parts being attached one to each other). This value can be increased to make the module loading faster. \hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamVoxelCoarsening}{}\paragraph{voxel coarsening}\label{modulePhysPosiInter_secModulePhysPosiInterParamVoxelCoarsening}
After the rasterization, various computations can be run on a coarser grid to speed up even ore the module loading. A value of n means 2$^\wedge$n times less voxels, so 1 means no coarsening. \hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamAffineDensity}{}\paragraph{affine density}\label{modulePhysPosiInter_secModulePhysPosiInterParamAffineDensity}
This parameter controls the density of {\itshape affine} (deformable) degrees of freedom in the flesh. For this Interactive module it can be kept to 0. \hypertarget{modulePhysPosiInter_secModulePhysPosiInterParamTibiaPatella}{}\paragraph{tibia/patella constraint}\label{modulePhysPosiInter_secModulePhysPosiInterParamTibiaPatella}
Enable/disable a distance constraint between the patella (center of gravity) and the tibial tuberosity landmark (which then must be defined in the metadata)\hypertarget{modulePhysPosiInter_secModulePhysPosiInterGUI}{}\subsubsection{User interface}\label{modulePhysPosiInter_secModulePhysPosiInterGUI}
This module U\+I is composed of a \hyperlink{pageGui_secDisplay3D}{3\+D Display} and several toolbox windows which are described in the following sections. On the right side a set of buttons let the user select the active mouse interaction, an other set to show/hide the different toolbox windows.


\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{modulePhysPosi_overview.png}
\caption{3\+D view, bone frames are displayed}
\end{DoxyImage}
\hypertarget{modulePhysPosiInter_secModulePhysPosiInterPositioning}{}\subsubsection{Interactive positioning}\label{modulePhysPosiInter_secModulePhysPosiInterPositioning}
\hypertarget{modulePhysPosiInter_secPhysPosiInterControl}{}\paragraph{Simulation control}\label{modulePhysPosiInter_secPhysPosiInterControl}

\begin{DoxyItemize}
\item The positioning process can be started, stopped and reset
\item The simulation time step can be adjusted, increase it if you are in a hurry, reduce it when the simulation gets unstable
\item The \hyperlink{modulePhysPosiInter_secModulePhysPosiInterParamBoneColNbVertex}{Number of collision vertices} can be changed,
\item If \hyperlink{modulePhysPosiInter_secModulePhysPosiInterParamBoneColEnabled}{bone collision} are enabled, they can be turn on and off on the fly, to increase simulation frame rate.
\item The {\itshape Run script} switch triggers the execution of the lastly run python script after each simulation step (see \hyperlink{modulePhysPosiInter_secModulePhysPosiInterScripting}{Scripting}).
\end{DoxyItemize}


\begin{DoxyImage}
\includegraphics[width=0.4\textwidth]{modulePhysPosi_simulationController.png}
\caption{Positioning controller}
\end{DoxyImage}


A set of controllers allow the user to drive the positioning process, they are described in the following sections.\hypertarget{modulePhysPosiInter_secPhysPosiInterBone}{}\paragraph{Fixed bone controller}\label{modulePhysPosiInter_secPhysPosiInterBone}
Select the bones which remain fixed during the simulation in the bones tree, several bones can be selected at once when a body region is selected. Fixed bones can also be selected using the {\itshape Fixed bone} mouse interaction. At least one bone should be fixed, if not your model is likely to \char`\"{}fly around\char`\"{}. 
\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{modulePhysPosi_fixedBonesController.png}
\caption{Fixed bones appear in red}
\end{DoxyImage}
\hypertarget{modulePhysPosiInter_secPhysPosiInterLandmark}{}\paragraph{Landmark controller}\label{modulePhysPosiInter_secPhysPosiInterLandmark}
The landmark controller let the user add constraints on any set of landmark coordinates \mbox{[}x,y,z\mbox{]}. Using the mouse interaction, clicking on a {\itshape yellow} landmark select it to add a controller on it. Clicking on a {\itshape green} target makes appear a manipulator according to the controlled Do\+F of that landmark, the target can then be moved interactively.


\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{modulePhysPosi_landmarkController.png}
\caption{Landmarks are displayed in yellow, targets in green. One target is being set interactively}
\end{DoxyImage}
\hypertarget{modulePhysPosiInter_secPhysPosiInterJoint}{}\paragraph{Joint controller}\label{modulePhysPosiInter_secPhysPosiInterJoint}
The cinematic joints defined in the H\+B\+M can be controlled (according to their degrees of freedom). Joint frames can be displayed individually for each controller. 
\begin{DoxyImage}
\includegraphics[width=0.4\textwidth]{modulePhysPosi_jointController.png}
\caption{Joint controller}
\end{DoxyImage}
\hypertarget{modulePhysPosiInter_secPhysPosiInterFrame}{}\paragraph{Frame to frame controller}\label{modulePhysPosiInter_secPhysPosiInterFrame}
A frame controller is created either\+:
\begin{DoxyItemize}
\item between a reference frame and a bone entity, then the relative transformation of that entity in the reference frame is constrained
\item or between two frames, in that case the absolute transformation between the 2 frames is constrained.
\end{DoxyItemize}

If $ target $ is the target transformation value, the objective is to get $ frame_1 \circ target = frame_2 $ The available frames are\+:
\begin{DoxyItemize}
\item the anatomical frames defined by landmarks (automatically created when landmarks are defined on the)
\item the world frames, prefixed by {\ttfamily W\+\_\+} 
\item the bone inertia frames (automatically created for each bone entity), prefixed by {\ttfamily B\+\_\+} Also, frames can be displayed individually for each controller. \begin{DoxyWarning}{Warning}
Either all or none rotation parameters can be controlled.
\end{DoxyWarning}

\begin{DoxyImage}
\includegraphics[width=0.4\textwidth]{modulePhysPosi_frameController.png}
\caption{Frame to frame controller}
\end{DoxyImage}

\end{DoxyItemize}\hypertarget{modulePhysPosiInter_secPhysPosiInterSpine}{}\paragraph{Spine controller}\label{modulePhysPosiInter_secPhysPosiInterSpine}
The spine controller enables the user to draw a target Bezier curve for the spine shape. Before creating the controller, a set of vertebrae has to be selected, they are used as Bezier control points (their center of gravity) and the initial curve is computed to go through these points. Using the spine mouse interaction, the curve can be freely modified in 3\+D. To ease this task you can show/hide disrupting objects in the \hyperlink{modulePhysPosiInter_secModulePhysPosiInterDisplay}{Display settings}.


\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{modulePhysPosi_spineController.png}
\caption{Interactive spine controller, the target Bezier curves and controlled points are drawn in green, also the distance from the vertebra to the curve}
\end{DoxyImage}
\hypertarget{modulePhysPosiInter_secModulePhysPosiInterPredictorsSpine}{}\paragraph{Spine predictor}\label{modulePhysPosiInter_secModulePhysPosiInterPredictorsSpine}
The predictors exploit {\itshape a priori} knowledge (statistical, bibliography study,...) to produce realistic positioning targets. These targets are then used to drive the positioning process.


\begin{DoxyItemize}
\item {\bfseries Parameters\+:} {\itshape Posture A, Posture B, Target posture, thoraco-\/lumbar lateral flexion angle, cervical lateral flexion angle, Align on gravity, gravity vector, Stiffness}
\item {\bfseries Metadata\+:} 
\begin{DoxyItemize}
\item the I\+S\+B landmarks required to compute the vertebrae and the pelvis body coordinate system needs to be defined on the model (see \hyperlink{pageAppendixFrame}{Appendix\+: List of frames}). You can obtain a list of these landmarks by using the {\ttfamily print\+Frame\+Landmarks.\+py} standard script, running it with arguments {\itshape \char`\"{}\+Spine I\+S\+B\+\_\+\+B\+C\+S\char`\"{}} and {\itshape \char`\"{}\+Pelvic\+\_\+skeleton I\+S\+B\+\_\+\+B\+C\+S\char`\"{}}
\item the {\itshape Pelvic\+\_\+skeleton} entity is required
\item the {\itshape gravity} vector
\end{DoxyItemize}
\item {\bfseries Intended use}\+:
\begin{DoxyItemize}
\item The spine predictor is to be used as a quick and easy physiological pre-\/positioning tool for the spine segment.
\item A possible workflow may be e.\+g. to use the spine predictor to predict a flexed forward posture and to use any other option (e.\+g. direct Joint angle definition or frame controller control followed by positioning) to modify the orientation of the head or cervical spine (e.\+g. to ensure horizontal vision), or to adapt the spinal shape locally (e.\+g. to a given seat).
\end{DoxyItemize}
\end{DoxyItemize}

Authors\+: Thomas L\+E\+M\+A\+I\+R\+E -\/ I\+N\+R\+I\+A / Bertrand F\+R\+E\+C\+H\+E\+D\+E -\/ U\+C\+B\+L/\+I\+F\+S\+T\+T\+A\+R

{\bfseries Overview} 

The spine predictor computes a likely shape of the spine by interpolating splines between known physiological end-\/postures. These end-\/postures represent average postures obtained from published postural in-\/vivo data in the sagittal plane. As of Piper version 1.\+0.\+0 the following end-\/postures can be chosen by the user\+: supine, standing erect, standing slouch, seated erect, seated driving, forward-\/flexed (seated). Lateral bending is controlled separately by the user by defining target angles, but relies on similar interpolations between a reference sagittal posture and published in-\/vivo Range of Motion (Ro\+M) in lateral bending.

{\bfseries Using the tool}

Upon opening the tool the user selects (i) two end-\/postures ({\itshape Posture A} and {\itshape Posture B}) and (ii) a postural parameter ({\itshape Target posture} cursor in the range \mbox{[}-\/0.\+2 1.\+2\mbox{]}). This parameter represents a percentage of transformation between the two known physiological end-\/postures. As the end-\/postures’ global orientation (as defined by their pelvis orientation) is defined relative to the gravity vector, so is the resulting posture by default ({\itshape align on gravity} option {\itshape on}). In practice, this is performed automatically by adding a \hyperlink{modulePhysPosiInter_secPhysPosiInterFrame}{Frame to frame controller} to constrain the pelvis absolute orientation and by rotating the pelvis by its target interpolated value between the two end postures. The vertical is taken as the gravity vector.

Alternatively, the spine resulting from the {\itshape Target posture} value can be aligned to the initial L5 vertebra ({\itshape align on gravity} option {\itshape off}). In this case, the resulting posture is not ‘likely’ in the sense that the spinal shape is not associated with a likely global orientation of the pelvis. Nevertheless, it remains a physiologically acceptable solution among others, thus allowing to define a range of possible spinal postures while keeping the pelvis in its initial orientation.


\begin{DoxyImage}
\includegraphics[width=0.6\textwidth]{modulePhysPosi_spinePredictor.png}
\caption{Spine predictor input parameters and output target spline in green}
\end{DoxyImage}


Lateral flexion is controlled independently by entering angles in the {\itshape thoraco-\/lumbar} and {\itshape cervical} fields. Max. values for these angles are constrained by the physiological lateral (Ro\+M) of the spine. Thoraco-\/lumbar and cervical curvature prediction are based on published kinematic coordination laws (ratios between the cervical, thoracic and lumbar angles) for the spine in lateral flexion. However results of this prediction (including when used in combination with the above presented interpolation in the sagittal plane) are not considered to be more ‘likely’ than others as they do not rely on reference postural knowledge but only on maximum Ro\+M distribution within the spine.

Additionally, a visual cue (colored circle) and text information is provided to the user as an indicative level of confidence for the prediction, as follows\+:
\begin{DoxyItemize}
\item Green circle / ‘high confidence prediction’\+: this is the case when the transformation is applied in the sagittal plane, within the \mbox{[}0 1\mbox{]} interval for {\itshape Target posture} interpolation.
\item Orange circle / ‘medium confidence prediction’\+: this is the case if\+:
\begin{DoxyItemize}
\item The transformation is applied in the sagittal plane within the \mbox{[}-\/0.\+1 0\mbox{]} or \mbox{[}1 1.\+1\mbox{]} intervals for {\itshape Target posture} interpolation,
\item O\+R The transformation is applied outside of the sagittal plane within the following lateral flexion Ro\+M limits\+: +/-\/ 7.\+4° for the cervical angle and +/-\/ 27.\+7° for the T\+L angle.
\end{DoxyItemize}
\item Red circle / ‘low confidence prediction’\+: this is the case if\+:
\begin{DoxyItemize}
\item The transformation is applied in the sagittal plane within the \mbox{[}-\/0.\+2 -\/0.\+1\mbox{[} or \mbox{]}1.\+1 1.\+2\mbox{]} intervals for {\itshape Target posture} interpolation,
\item O\+R Any other combination.
\end{DoxyItemize}
\end{DoxyItemize}

If the {\itshape align on gravity} option is {\itshape off}, these levels of confidence concern only the resulting curvature of the spine and the fact that those are within measured Ro\+Ms. If it is {\itshape on}, they will also give an indication on the likeliness of the posture (i.\+e. including spinal curvatures and rotation of the pelvis) based on the source and target end-\/postures.

{\bfseries Limitations}
\begin{DoxyItemize}
\item The computation of a prediction based on changes between known, absolute physiological postures, requires that any H\+B\+M’s spine in input will be transformed to a reference posture in the sagittal plane (as defined by the pelvis bones). This is achieved by performing an initial positioning in this posture prior to computing the transformation from {\itshape Posture A} to {\itshape Posture B}. This step is transparent for the user. However it means that subject-\/specific curvatures (e.\+g. aged/scoliotic subject) that would exist in the H\+B\+M or Piper model prior to the use of the spine predictor will be lost through the process. Alternate octave scripts are provided as part of the release that allow applying predicted transformations directly to the input spine without going through the initial positioning phase.
\item The user’s target/chosen parameters are not saved as part of the history.
\end{DoxyItemize}\hypertarget{modulePhysPosiInter_secModulePhysPosiInterDisplay}{}\subsubsection{Display settings}\label{modulePhysPosiInter_secModulePhysPosiInterDisplay}
The display toolbox enables to show/hide (and even draw in wireframe) several items\+:


\begin{DoxyItemize}
\item the skin envelop of the model in semi translucent pink if the skin entity has been defined in metadata \hyperlink{pageFramework_secFrameworkMetadataEntity}{Entity}.
\item the bones geometry in white (for bones \hyperlink{pageFramework_secFrameworkMetadataEntity}{Entity} defined in the P\+I\+P\+E\+R model)
\item environment objects
\item landmarks, joints frames, anatomical and bone inertia frames, world attached frames
\item contact violation as yellow lines
\item mesh normals
\end{DoxyItemize}


\begin{DoxyImage}
\includegraphics[width=0.4\textwidth]{modulePhysPosi_displaySettings.png}
\caption{Display settings, bones displayed as wireframe}
\end{DoxyImage}
\hypertarget{modulePhysPosiInter_secModulePhysPosiInterTarget}{}\subsubsection{Output Targets}\label{modulePhysPosiInter_secModulePhysPosiInterTarget}
Several types of targets can be created in the application target list\+:
\begin{DoxyItemize}
\item the currently defined {\bfseries user targets}, the main interest interest is to replay the same positioning later, or on an other model, or using batch mode
\item all H\+B\+M \hyperlink{pageFramework_secFrameworkMetadataLandmark}{Landmark} metadata, these targets can then be used in the \hyperlink{moduleContourDeformation}{Contour Deformation Module}
\item all {\bfseries bones} inertia frames absolute position, these targets can be used to deform the model in the \hyperlink{modulePhysPosiDeform}{Fine-\/\+Positioning Module} 
\begin{DoxyImage}
\includegraphics[width=0.4\textwidth]{modulePhysPosi_targetController.png}
\caption{Target creation and loading}
\end{DoxyImage}

\end{DoxyItemize}\hypertarget{modulePhysPosiInter_secModulePhysPosiInterUpdate}{}\subsubsection{Model nodes update}\label{modulePhysPosiInter_secModulePhysPosiInterUpdate}
The computation of model nodes must be activated first, then the P\+I\+P\+E\+R model nodes coordinate can be updated.


\begin{DoxyImage}
\includegraphics[width=0.2\textwidth]{modulePhysPosi_nodesUpdate.png}
\caption{H\+B\+M nodes update}
\end{DoxyImage}


This module main functionality is {\bfseries not} to compute a precise deformation field for the H\+B\+M, consider using the \hyperlink{modulePhysPosiDeform}{Fine-\/\+Positioning Module} or the \hyperlink{moduleContourDeformation}{Contour Deformation Module} for this purpose.

The {\itshape Deformation} button sends you directly to the \hyperlink{modulePhysPosiDeform}{Fine-\/\+Positioning Module} executing the following sequence\+:
\begin{DoxyEnumerate}
\item the current user-\/defined targets are saved to the application target list
\item the \hyperlink{modulePhysPosiDeform}{Fine-\/\+Positioning Module} is started
\item the previously saved targets are loaded in the Deformation module
\end{DoxyEnumerate}\hypertarget{modulePhysPosiInter_secModulePhysPosiInterScripting}{}\subsubsection{Scripting}\label{modulePhysPosiInter_secModulePhysPosiInterScripting}
The module supports specific scripting functions to access intermediate states during the positioning process and export any data that could drive an external simulation to achieve the full H\+B\+M positioning.\hypertarget{modulePhysPosiInter_secModulePhysPosiInterScriptingSpecific}{}\paragraph{Specific python objects}\label{modulePhysPosiInter_secModulePhysPosiInterScriptingSpecific}
In addition to the regular P\+I\+P\+E\+R scripting (see \hyperlink{pageScripting}{Scripting and Batch mode}), a script run along with this module can access the currently defined controllers with these 3 python objects\+: {\ttfamily joint\+Controller, landmark\+Controller, frame\+Controller}.


\begin{DoxyCodeInclude}
1 \textcolor{comment}{# Print information for a controller.}
2 \textcolor{comment}{# Support landmark, joint and frame controllers}
3 \textcolor{comment}{#}
4 \textcolor{comment}{# arguments:}
5 \textcolor{comment}{#  controller\_name}
6 
7 \textcolor{comment}{# author: Thomas Lemaire date: 2017}
8 
9 \textcolor{keyword}{import} piper.app
10 
11 \textcolor{keywordflow}{if} (2 != len(sys.argv)):
12     \textcolor{keywordflow}{raise} RuntimeError(\textcolor{stringliteral}{"Invalid arguments"})
13 \textcolor{keywordflow}{else}:
14     controllerName = sys.argv[1]
15     controller = \textcolor{keywordtype}{None}
16     \textcolor{keywordflow}{if} controllerName \textcolor{keywordflow}{in} landmarkController.getControllerNames():
17         controller = landmarkController
18     \textcolor{keywordflow}{elif} controllerName \textcolor{keywordflow}{in} jointController.getControllerNames():
19         controller = jointController
20     \textcolor{keywordflow}{elif} controllerName \textcolor{keywordflow}{in} frameController.getControllerNames():
21         controller = frameController
22     \textcolor{keywordflow}{if} \textcolor{keywordflow}{not} controller \textcolor{keywordflow}{is} \textcolor{keywordtype}{None}:
23         piper.app.logInfo(\textcolor{stringliteral}{"Controller: \{0\} - target: \{1\} - mask: \{2\} - position: \{3\}"}.format(controllerName
      , controller.getTarget(controllerName), controller.getMask(controllerName), controller.getCurrentPosition(
      controllerName)))
24     \textcolor{keywordflow}{else}:
25         piper.app.logInfo(\textcolor{stringliteral}{"Controller \{0\} does not exist"}.format(controllerName))
\end{DoxyCodeInclude}


Also the current position of the H\+B\+M can be saved in the \hyperlink{pageFramework_secFrameworkHistory}{Model history} using the {\ttfamily simulation\+Controller} 


\begin{DoxyCodeInclude}
1 \textcolor{comment}{# Add HBM current nodes position into the history.}
2 \textcolor{comment}{# This script requires that "all nodes" update is activated}
3 \textcolor{comment}{#}
4 \textcolor{comment}{# arguments:}
5 \textcolor{comment}{#  history\_name\_prefix}
6 
7 \textcolor{comment}{# author: Thomas Lemaire date: 2017}
8 
9 \textcolor{keyword}{import} \hyperlink{namespacepiper_1_1hbm}{piper.hbm}
10 \textcolor{keyword}{import} piper.app
11 
12 model = piper.app.Context.instance().project().model()
13 
14 \textcolor{comment}{# if the model is empty, we can do nothing}
15 \textcolor{keywordflow}{if} model.empty():
16     piper.app.logWarning(\textcolor{stringliteral}{"Model is empty"})
17 \textcolor{keywordflow}{elif} \textcolor{keywordflow}{not} simulationController.isAllNodesActivated():
18     piper.app.logWarning(\textcolor{stringliteral}{"\(\backslash\)"all nodes\(\backslash\)" update is not activated"})
19 \textcolor{keywordflow}{elif} (2 != len(sys.argv)):
20     \textcolor{keywordflow}{raise} RuntimeError(\textcolor{stringliteral}{"Invalid arguments"})
21 \textcolor{keywordflow}{else}:
22     historyPrefix = sys.argv[1]
23     \textcolor{keyword}{global} historyPrefixCounter
24     \textcolor{keywordflow}{if} \textcolor{keywordflow}{not} \textcolor{stringliteral}{"historyPrefixCounter"} \textcolor{keywordflow}{in} globals():
25         \textcolor{comment}{# global variable to keep track of number, must be created only once}
26         historyPrefixCounter = dict()
27     \textcolor{keywordflow}{if} \textcolor{keywordflow}{not} historyPrefix \textcolor{keywordflow}{in} historyPrefixCounter:
28         historyPrefixCounter[historyPrefix] = 0
29     historyName = \textcolor{stringliteral}{"\{0\}\_\{1\}"}.format(historyPrefix, historyPrefixCounter[historyPrefix])
30     piper.app.Context.instance().addNewHistory(historyName)
31     historyPrefixCounter[historyPrefix]+=1
32     simulationController.updateModelNodes()
33     piper.app.logInfo(\textcolor{stringliteral}{"Current HBM nodes position saved in \{0\}"}.format(historyName))
34     
35                                   
36     
\end{DoxyCodeInclude}
\hypertarget{modulePhysPosiInter_secModulePhysPosiInterHowTo}{}\subsubsection{How to...}\label{modulePhysPosiInter_secModulePhysPosiInterHowTo}
\hypertarget{modulePhysPosiInter_secModulePhysPosiInterHowToRelativeFixBones}{}\paragraph{How to fix one bone with respect to an other one ?}\label{modulePhysPosiInter_secModulePhysPosiInterHowToRelativeFixBones}

\begin{DoxyItemize}
\item If there is a robotic joint defined between the two bones, you can add a {\itshape joint controller} which constraints the relative bones position to stay the same
\item In the general case you can add a {\itshape frame controller} between both bones (either 3 rotations, or 3 translations or both) to achieve it
\end{DoxyItemize}\hypertarget{modulePhysPosiInter_secModulePhysPosiInterHowToSequence}{}\paragraph{How to reach a complex position ?}\label{modulePhysPosiInter_secModulePhysPosiInterHowToSequence}
You can concentrate on positioning a sub part of the H\+B\+M, then fix the corresponding bones and continue the positioning task on an other sub part of the H\+B\+M.\hypertarget{modulePhysPosiInter_secModulePhysPosiInterHowToSkin}{}\paragraph{The skin of the arm looks attached to the body, how to fix it ?}\label{modulePhysPosiInter_secModulePhysPosiInterHowToSkin}
Depending of the initial position of your H\+B\+M, the rasterization process used to set up the simulation might {\itshape attach} close parts of the skin. To get rid of this kind of problems you can split your skin entity in several entities, at least close skin parts should be put in separate entities.\hypertarget{modulePhysPosiInter_secModulePhysPosiInterHowToUnstable}{}\paragraph{The simulation is unstable even with no target}\label{modulePhysPosiInter_secModulePhysPosiInterHowToUnstable}
If you have bone collision enabled try to disable it in the \hyperlink{pageGui_secGuimoduleParam}{Module parameters}, if this fixes the problem it is likely that you have wrongly defined normals for some bone meshes. You can check the normals using the \hyperlink{modulePhysPosiInter_secModulePhysPosiInterDisplay}{Display settings} in this module, or the \hyperlink{pageGui_secDisplay3DVtk}{Generic viewer} in the \hyperlink{modulecheck}{Check Module}, and fix them in your favorite preprocessor software. \hypertarget{modulePhysPosiDeform}{}\subsection{Fine-\/\+Positioning Module}\label{modulePhysPosiDeform}
\hypertarget{modulePhysPosiDeform_secPhysPosiDeformOverview}{}\subsubsection{Overview}\label{modulePhysPosiDeform_secPhysPosiDeformOverview}
This module implements the same simulation as in the \hyperlink{modulePhysPosiInter}{Pre-\/\+Positioning Module}. Compared to it, more degrees of freedom are added to simulate the soft tissue so as to get a high quality deformation of the model. As a consequence the simulation runs slower and is not interactive.


\begin{DoxyItemize}
\item {\bfseries Parameters\+:} voxel\+Size, affine density (voxel\+Coarsening is 1)
\item {\bfseries Metadata\+:} same as \hyperlink{modulePhysPosiInter}{Pre-\/\+Positioning Module}
\item {\bfseries Target Input}\+: any user defined target (fixed bone, joint, frame to frame, landmark) can be loaded, however the standard workflow is to load bones inertia position created in the \hyperlink{modulePhysPosiInter}{Pre-\/\+Positioning Module}.
\item {\bfseries Target Output}\+: None
\item {\bfseries Output}\+: updated model nodes
\end{DoxyItemize}

\begin{DoxyAuthor}{Author}
Thomas Lemaire -\/ I\+N\+R\+I\+A
\end{DoxyAuthor}
\hypertarget{modulePhysPosiDeform_secModulePhysPosiDeformParam}{}\subsubsection{Parameters}\label{modulePhysPosiDeform_secModulePhysPosiDeformParam}

\begin{DoxyItemize}
\item {\bfseries voxel size}\+: decrease this value to have more precise deformation field, increase it to have faster loading time
\item {\bfseries affine density}\+: increase this value to get a better quality deformation, decrease it to have faster loading and faster simulation
\end{DoxyItemize}\hypertarget{modulePhysPosiDeform_secModulePhysPosiDeformGUI}{}\subsubsection{User interface}\label{modulePhysPosiDeform_secModulePhysPosiDeformGUI}
This module U\+I has a lot in common with the \hyperlink{modulePhysPosiInter}{Pre-\/\+Positioning Module} U\+I, with less components since it does not provide user interaction with the model. The available toolbox windows are described in the following sections.


\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{modulePhysPosiDeform_overview.png}
\caption{3\+D view, model nodes are computed, affine frames are displayed}
\end{DoxyImage}
\hypertarget{modulePhysPosiDeform_secPhysPosiDefoControl}{}\subsubsection{Simulation control}\label{modulePhysPosiDeform_secPhysPosiDefoControl}
See \hyperlink{modulePhysPosiInter_secPhysPosiInterControl}{Simulation control}\hypertarget{modulePhysPosiDeform_secModulePhysPosiDefoDisplay}{}\subsubsection{Display settings}\label{modulePhysPosiDeform_secModulePhysPosiDefoDisplay}
See \hyperlink{modulePhysPosiInter_secModulePhysPosiInterDisplay}{Display settings}\hypertarget{modulePhysPosiDeform_secModulePhysPosiDefoTarget}{}\subsubsection{Targets}\label{modulePhysPosiDeform_secModulePhysPosiDefoTarget}
This tool windows let the user load targets in the simulation. The {\itshape Import targets...} button is a shortcut for the menu {\itshape Target {$\rightarrow$} Import targets} to import targets from a target file into the project. The {\itshape Load} button loads the project targets, a status message is printed in the log. While the simulation is running the targets accumulated error can be checked, and target stiffness can be adjusted \+:
\begin{DoxyItemize}
\item decrease the value if the simulation becomes unstable
\item increase the value if the targets are not reached closely enough
\end{DoxyItemize}


\begin{DoxyImage}
\includegraphics[width=0.3\textwidth]{modulePhysPosiDeform_target.png}
\caption{Targets loading and monitoring}
\end{DoxyImage}
 \hypertarget{modulemeshoptim}{}\subsection{Smoothing module}\label{modulemeshoptim}
\hypertarget{modulemeshoptim_meshoptimmoduleoverview}{}\subsubsection{Overview}\label{modulemeshoptim_meshoptimmoduleoverview}
After some transformations (positioning in particular), it is frequent that the element quality is degraded compared to the original model. This can occur on the surface or inside the mesh (3\+D elements) and it can lead to inverted elements (negative volume or negative jacobian) which prevent the simulation from starting. This module provides different tools to try to help with this problems.

First, the element quality needs to be assessed. There are many metrics and definitions used to define element quality depending on the F\+E solver and pre-\/processor. It is assumed that the user can always export the H\+B\+M and to compute its favorite quality metrics in another pre-\/processor (which P\+I\+P\+E\+R does not aim to replace). Within P\+I\+P\+E\+R, two libraries are used to compute quality metrics\+:
\begin{DoxyItemize}
\item \hyperlink{modulemeshoptim_meshoptimVtktoolkit}{V\+T\+K toolkit Quality metrics}, which is used for the transformation smoother.
\item \hyperlink{modulemeshoptim_mesquitetoolkit}{M\+E\+S\+Q\+U\+I\+T\+E Quality metrics}, which support the mesh smoothing in the Mesquite library
\end{DoxyItemize}

They will provide results different results. In both cases, the variation of element quality (before and after transformation) can be computed which can be helpful to detect problematic regions for smoothing and assess the quality of the transformation (independently from the quality of the original model).

Then to try to improve the quality, three methods are provided. Their principles are summarized below\+:
\begin{DoxyItemize}
\item \hyperlink{modulemeshoptim_meshimprover}{Improving mesh quality using Mesquite metrics} \+: a 3\+D mesh optimizer (using the Mesquite library) attempts to optimize the quality metrics within a 3\+D mesh without changing its boundaries. As a result, if the problems are located on the surface of the mesh, the problem cannot be completely solved.
\item \hyperlink{modulemeshoptim_surfacesmooth}{Smoothing the surface of an entity} \+: a simple Taubin smoothing algorithm is available to smooth the surface of entities. It is often useful for the skin after positioning. A \hyperlink{modulemeshoptim_creasedetection}{Surface crease detection} algorithm can be used in preparation to detect the regions of interest for smoothing. As only the surface is smoothed, another smoothing methods for the 3\+D mesh is typically required after.
\item \hyperlink{modulemeshoptim_meshoptimTranssmoothing}{Transformation smoothing} \+: the geometrical transformation between two models is smoothed. This is not a mesh smoothing method per say (the method is not aware of the mesh). This approach attempts to maintain the original element quality by minimizing the local distortions. In practice, it can solve many of the local problems resulting from the transformations without generating unwanted penetrations (e.\+g. after positioning).
\end{DoxyItemize}

Overview of the smoothing methods \begin{TabularC}{3}
\hline
\rowcolor{lightgray}{\bf Method }&{\bf Applies to }&{\bf Strength and usage scenario  }\\\cline{1-3}
Mesquite Mesh optimizer &3\+D mesh (inside) &Optimize mesh. Use alone or after the others. \\\cline{1-3}
Surface smoother &Surface mesh &Local defects (on skin). Use first. \\\cline{1-3}
Transformation smoother &All (not mesh aware) &Minimize distortion without generating penetrations. Use second. \\\cline{1-3}
\end{TabularC}
All three methods can be applied even if the model transformation was not made in P\+I\+P\+E\+R (the transformation smoother can smooth between two arbitrary models).\hypertarget{modulemeshoptim_meshoptimmodulegui}{}\subsubsection{Module G\+U\+I}\label{modulemeshoptim_meshoptimmodulegui}
There are currently four different methods available in this module. Only one can be active at a time. To switch between them, use the buttons in the right panel, marked by number \char`\"{}1\char`\"{} in the Figure \hyperlink{modulemeshoptim_I}{Module Main Window}. Clicking them will also open a window with options of the given method. See below for details on the individual methods.~\newline
 The results display has two modes -\/ information grid and 3\+D view. The mode can be changed using the two buttons on the right panel marked by number \char`\"{}2\char`\"{} in the Figure \hyperlink{modulemeshoptim_I}{Module Main Window}.~\newline
The information grid mode is currently used only by the \hyperlink{modulemeshoptim_mesquitetoolkit}{M\+E\+S\+Q\+U\+I\+T\+E Quality metrics} method. It displays the amounts of low quality elements in individual parts of the F\+E model as text.~\newline
The second mode switches to a standard 3\+D view of the model. Most of the quality methods have a way to mark the low quality or otherwise interesting elements in the 3\+D view. Also, standard 3\+D view tools such as metadata showing/hiding, picking etc. are of course available in this mode and can be used e.\+g. to select which parts of the model to apply a mesh optimization to.~\newline
 ~\newline
{\ttfamily Hint\+: Most of the mesh optimization methods work with the entire, \char`\"{}full\char`\"{}, model (including all nodes and elements). The visualization of finite element model will therefore be activated by default and the entity visualization (P\+I\+P\+E\+R model) automatically switched off. If needed, you can switch it back via the \char`\"{}\+Display -\/$>$ Entity\char`\"{} window, using the checkboxes on the bottom of the window. But keep in mind that if you have both modes turned on, you will likely see the model twice, once as a full model, once as entities.}

\label{modulemeshoptim_I}%
\hypertarget{modulemeshoptim_I}{}%
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{meshoptim1.png}
\caption{Module Main Window}
\end{DoxyImage}
\hypertarget{modulemeshoptim_meshoptimVtktoolkit}{}\subsubsection{V\+T\+K toolkit Quality metrics}\label{modulemeshoptim_meshoptimVtktoolkit}
The \href{http://www.vtk.org}{\tt V\+T\+K toolkit} integrates quality metrics defined in the \href{http://www.csimsoft.com/download?file=Documents/sand20071751.pdf}{\tt Verdict Library}. The metrics are computed on 2\+D and 3\+D elements (pyramid and penta element metrics are not available in the \href{http://www.csimsoft.com/download?file=Documents/sand20071751.pdf}{\tt Verdict Library}).~\newline
These metrics are not used for any optimization. It is possible to display them in every module that utilizes the 3\+D view. You can bring it up using the \char`\"{}\+Element Quality\char`\"{} button in the right panel.~\newline
Figure \hyperlink{modulemeshoptim_II}{Color by Quality} shows the options window for this method. You can choose from a number of quality metrics and set-\/up up to three quality ranges, each of which will be colored by a different color scheme. Upon pressing the \char`\"{}\+Display\char`\"{} button, the quality will be computed for each element for which the metric is defined and the elements will be colored. You can save the results to a file using the \char`\"{}\+Save Quality\char`\"{} button.~\newline
Setting up the ranges is simple -\/ tick a checkbox for each range you want to use, then enter the desired thresholds. The extremes of the ranges will be automatically modified so that no two ranges overlap.~\newline
The two comboboxes after the range values are used to set up which color will be used with which range. By default, as in the Figure \hyperlink{modulemeshoptim_II}{Color by Quality}, only the first combobox has some value. In such a case, each element that belongs to this range will be colored by this value. If you specify a second color of the range, the color associated with the element will be a linear interpolation of the two colors. E.\+g. if you specify a range from 0 to 1 and set colors from green to red, an element with a quality 0.\+5 will be yellow.

{\ttfamily Hint\+: you can easily create a range that goes from dark to light tones of your favourite color. Simply specify black as the second color to create a range that goes darker with increasing values, or white to create a range that grows lighter. Or use your color as the second one and white/black as first for a similar, yet different effect.}~\newline
 To select elements within some range, use the \char`\"{}\+Select\char`\"{} button. The checkboxes next to it let you specify which range to include in the selection. Note that using the selection, the 3\+D viewer automatically switch to rendering the elements based on the selection, not based on the quality, i.\+e. you will see selected elements in green color, deselected in white. You can then click the \char`\"{}\+Compute\char`\"{} button again to switch back to coloring the elements by the quality, but the selected elements will remain selected (only not \char`\"{}highlighted\char`\"{}).~\newline
 If you check the \char`\"{}\+Use relative quality\char`\"{} checkbox, you can specify a \char`\"{}baseline\char`\"{} model, i.\+e. a different version of your current model (the node and element counts must match!), e.\+g. before some deformation. You can either specify the model from file or from the Model History, i.\+e. use the version of the model before you applied some other P\+I\+P\+E\+R operation on it. The quality will then be computed as a difference between the quality of the current model and the baseline one. This way, you can easily see if the deformation you created increased or decreased the element quality of the model. \label{modulemeshoptim_II}%
\hypertarget{modulemeshoptim_II}{}%
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{meshoptimVTKColor.png}
\caption{Color by Quality}
\end{DoxyImage}
\hypertarget{modulemeshoptim_mesquitetoolkit}{}\subsubsection{M\+E\+S\+Q\+U\+I\+T\+E Quality metrics}\label{modulemeshoptim_mesquitetoolkit}
\href{https://trilinos.org/oldsite/packages/mesquite/}{\tt M\+E\+S\+Q\+U\+I\+T\+E Quality metrics} are defined on 2\+D and 3\+D elements but only 3\+D elements metrics are considered in this module. Inverse mean ratio metric and untangle Beta metric (to detect inverted elements) are computed.

To perform a quality analysis using Mesquite, the user has to\+: 
\begin{DoxyItemize}
\item Open the Mesquite Options window using the \char`\"{}\+Mesquite\char`\"{} button on the right panel (see number 1 in Figure \hyperlink{modulemeshoptim_I}{Module Main Window} -\/ this opens the window \char`\"{}4\char`\"{} in the same figure) 
\item Activate/\+Deactivate the option to include bones in the analysis -\/ use the \char`\"{}\+Compute Quality for Skeleton\char`\"{} checkbox 
\item Click on \char`\"{}\+Compute Quality\char`\"{} button. When computation is done, results are presented in the table (see Figure \hyperlink{modulemeshoptim_I}{Module Main Window}, part 3) 
\item Alternatively, a \char`\"{}baseline\char`\"{} model can be specified, either from a file or from the model history. If a baseline model is used, the results are not absolute values of the quality metric, but instead values relative to this baseline model, computed as quality of the current model minus the quality of the baseline model. 
\end{DoxyItemize}

Results of the quality evaluation are presented in a table with each line corresponds to part defined in the Finite Element Model and the following columns\+: 
\begin{DoxyItemize}
\item The Part Id 
\item The Part Name (if defined in Finite Element Model) 
\item For each quality metric, the number of elements that do not respect current quality criteria value 
\item If optimization is applied to the mesh, additional columns with the number of elements that do not respect current quality criteria value after the optmization are added 
\end{DoxyItemize}

The button \char`\"{}\+Save Quality\char`\"{} export the quality metrics for all elements of the model.~\newline
The button \char`\"{}\+Apply Mesh Optimization\char`\"{} launches the optimisation process -\/ see \hyperlink{modulemeshoptim_meshimprover}{Improving mesh quality using Mesquite metrics}\hypertarget{modulemeshoptim_meshimprover}{}\subsubsection{Improving mesh quality using Mesquite metrics}\label{modulemeshoptim_meshimprover}
The second part of the Mesquite Options window allows you to perform some mesh optimization. The G\+U\+I for optimization is enabled only if quality is computed and up to date -\/ you have to use the \char`\"{}\+Compute Quality\char`\"{} button before the optimization.~\newline
The optimization is applied on each part (list in the table) with elements that not respect quality criteria. When mesh optimization is applied, each part is optimized individually. Nodes at the free surface of the part are defined as fixed nodes. When an element with quality that does not respect a specified criterion has nodes that are used in the entities that make the skin (use the provided \char`\"{}\+Select skin entities\char`\"{} box to defines which entities belong to skin), these nodes are not set fixed to allow improvement of this element. The criteria to use can be modified in the \char`\"{}\+Optimization options\char`\"{} part of the Mesquite Options window (see Figure \hyperlink{modulemeshoptim_I}{Module Main Window}, window labeled by 4), namely you can specify to improve the mean ratio metric and also set the threshold that should be used to determine what is an acceptable quality; and you can specify whether to attempt to remove inverted elements or not (this is only a binary choice with no further parameters).~\newline
You can use the \char`\"{}\+Select elements below threshold\char`\"{} button to perform a selection of elements. If you need to select elements above the threshold instead, simply use the \char`\"{}invert element selection\char`\"{} from the standard {\ttfamily Picking} menu.~\newline
If you specified that you want to use the relative quality in the \char`\"{}\+Quality options\char`\"{} part of the Mesquite Options window, the value of the mean ratio threshold will also be relative -\/ value of 0 will mean elements that have the same quality both in the current and baseline mesh, negative values will be elements that have lower quality now than in the baseline mesh and positive values mean elements that improve their quality in comparison to the baseline mesh.\hypertarget{modulemeshoptim_surfacesmooth}{}\subsubsection{Smoothing the surface of an entity}\label{modulemeshoptim_surfacesmooth}
The surface smoothing method uses a windowed sinc function interpolation filter to relax the node positions on a surface of an entity (also known as Taubin smoothing). This means that only 2\+D elements (triangles, quadrilaterals...) will be take into account for the smoothing. Therefore, this method is useful in preprocessing surfaces that you intend to use as targets for \hyperlink{modulemeshoptim_meshoptimTranssmoothing}{Transformation smoothing} or similar purposes, or fixing small defects, but will not increase the quality of the model too much in terms of its suitability for F\+E simulation as problems are often in the 3\+D elements.~\newline
After the smoothing is finished, a new model history is always added, so you can undo the smoothing at will. Apart from starting the smoothing process by pressing the \char`\"{}\+Smooth surface\char`\"{} button, there are three options you can change in the G\+U\+I of the method\+:~\newline

\begin{DoxyItemize}
\item Processed entity\+: the table in the top half of the window (see Figure \hyperlink{modulemeshoptim_IIIa}{Surface smoothing}) allows you to set which entities to smooth. An entity named \char`\"{}\+Skin\char`\"{} will be selected as default if it exists, if it does not, nothing will be selected. Again, keep in mind that only 2\+D elements will be smoothed for any of the entity you select. The selected entities are merged into one surface before the process. This ensure correct behaviour even on \char`\"{}seams\char`\"{} between entities. That is useful if you have for example the skin of your model defined as several entities. 
\item Smoothing parameters\+: there are two parameters of the smoothing algorithm that can be changed\+: 
\begin{DoxyEnumerate}
\item The number of iterations, which in essence specifies the degree of the polynomial used for the interpolation -\/ see the \href{http://www.vtk.org/doc/nightly/html/classvtkWindowedSincPolyDataFilter.html}{\tt documentation of the smoothing filter} for details. The higher, the smoother will the result be. A small amount of iterations ($<$ 5) should be avoided to get good results. 
\item The \char`\"{}pass band value\char`\"{}, a number between 0 and 2, which specifies what node valence distribution to consider smooth. The lower, the smoother (i.\+e. more regular) will the resulting mesh be. 
\end{DoxyEnumerate}The default values, number of iterations 20 and pass band value 0.\+1, are a reasonable setting which will be sufficient in the most usual cases. The Figures \hyperlink{modulemeshoptim_IIIa}{Surface smoothing, before} and \hyperlink{modulemeshoptim_IIIb}{Surface smoothing, after} shows an example of the smoothing with those settings applied to the skin in a shoulder area. 
\item Smooth only selected\+: the checkbox in the bottom of the option window allows to specify whether the smoothing shall be applied to the whole entity or only the nodes that are selected. Node picking tools are available in the standard \char`\"{}\+Picking\char`\"{} toolbox. As Figure \hyperlink{modulemeshoptim_IIIa}{Surface smoothing, before} shows, the picked nodes are highlighted as green spheres on the models. Only the selected nodes will be smoothed if this checkbox is ticked. The crease detection method described below can be especially useful to select the regions of interest for surface smoothing~\newline
 {\ttfamily Hint\+: Note that the filter operates only on selected {\bfseries nodes}, not elements! However, if you want to smooth an area that you selected using element selection, you can simply use the \char`\"{}\+Select nodes of selected elements\char`\"{} button in the \char`\"{}\+Picking\char`\"{} toolbox to select the appropriate nodes and then run the smoothing.} 
\end{DoxyItemize}

\label{modulemeshoptim_IIIa}%
\hypertarget{modulemeshoptim_IIIa}{}%
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{meshoptimSurfSmoothPre.png}
\caption{Surface smoothing, before}
\end{DoxyImage}


\label{modulemeshoptim_IIIb}%
\hypertarget{modulemeshoptim_IIIb}{}%
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{meshoptimSurfSmoothPost.png}
\caption{Surface smoothing, after}
\end{DoxyImage}


More details can be found in the \href{http://www.vtk.org/doc/nightly/html/classvtkWindowedSincPolyDataFilter.html}{\tt documentation of the smoothing filter} or in the original paper\+: Optimal Surface Smoothing as Filter Design, G. Taubin, T. Zhang and G. Golub, I\+B\+M tech report R\+C-\/20404, 3/12/96.\hypertarget{modulemeshoptim_creasedetection}{}\paragraph{Surface crease detection}\label{modulemeshoptim_creasedetection}
One of the most common types of unwanted deformation that happens to an F\+E mesh after positioning is that unnaturally sharp creases appear around areas that were bent. This method, which require to specify a baseline model, automatically detects those areas and selects them. It does not have any tool to remove this damage, but the selection can be carried over and used as a target for other optimization methods, such as \hyperlink{modulemeshoptim_meshoptimTranssmoothing}{Transformation smoothing} and \hyperlink{modulemeshoptim_surfacesmooth}{Smoothing the surface of an entity}.~\newline
The method uses a simple algorithm that divides the mesh into a set of clusters of elements based on the change of the dihedral angle of elements (the angle between two neighboring elements) before and after a deformation. If the change of dihedral angle between two elements is larger than a specified threshold, each of those elements is added to a different cluster. In the example in Figure \hyperlink{modulemeshoptim_IV}{Surface crease damage detection}, elbow was extended. Ideally, this will put elements in the forearm and the rest of the body to two different clusters, as the change of dihedral angle around the elbow will be large. However, in practice, the positioning methods will likely not be able to create a smooth transition in this area, instead some unnaturally sharp transitions will appear around the elbow, as we can see in the Figure. Using the clustering algorithms, elements that form these sharp transitions will create narrow clusters, only few or even one element \char`\"{}thick\char`\"{}, i.\+e. most of the elements of the given cluster will be on its boundary. This method detects and selects those clusters.~\newline
 \label{modulemeshoptim_IV}%
\hypertarget{modulemeshoptim_IV}{}%
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{meshoptimCreaseDet.png}
\caption{Surface crease damage detection}
\end{DoxyImage}


The options window of the crease detection method is divided into these four parts, going from top to bottom (please refer to Figure \hyperlink{modulemeshoptim_IV}{Surface crease damage detection})\+: 
\begin{DoxyEnumerate}
\item The Compute Quality button\+: performs the detection and selects the elements and points that belong to clusters that are evaluated as damaged. Note that this will reset all selection that you might have made previously! The button will not be available until you load a model and select a baseline model. \label{modulemeshoptim_baselineSelect}%
\hypertarget{modulemeshoptim_baselineSelect}{}%

\item Baseline model selection\+: this section allows you to either load a baseline model from a P\+I\+P\+E\+R project file (the button will open a standard \char`\"{}open file\char`\"{} dialog), or select an entry from the current model history, i.\+e. choose a version of the current model before you applied some P\+I\+P\+E\+R action to it (the button will open a dialog where you select one of the model history names and confirm). The name of the currently chosen model -\/ either a model history name or path to the file -\/ is written below the two buttons. Note that the baseline model is shared among all other methods, so you do not have to re-\/load the file / re-\/select the history when you go to another mesh optimization method. 
\item Detection options\+: this section contains the main settings of the algorithm. First, you need to select which entities to process. As was the case with \hyperlink{modulemeshoptim_surfacesmooth}{Smoothing the surface of an entity}, the crease detection works only on the surface of the mesh. The \char`\"{}\+Skin\char`\"{} entity is selected by default if it exists, nothing is selected if it does not exist. The selected entities are merged into one surface before the process. This ensure correct behaviour even on \char`\"{}seams\char`\"{} between entities. That is useful if you have for example the skin of your model defined as several entities, but also please realize that if you select multiple entities that are disjoint, the result might not be very useful to you. ~\newline
Below the entity selection are two sliders that change the parameters of the algorithm\+: angle threshold, which decides whether two elements are added to the same or different clusters -\/ the lower it is, the less tolerant will the algorithm be -\/ for threshold 0, it will put any two elements to different clusters; and the percentage of elements that must be on the boundary for the cluster to be considered narrow -\/ the lower it is, the more clusters will be evaluated as damage (although in practice, the really damaged clusters have very high percentage, $>$ 90\%, while the non-\/damaged cluster have very low, $<$ 10\%, so in most cases, changing the value of this slider will not have a large impact).~\newline
Lastly, the two checkboxes below the sliders serve to automatically create selection boxes around the damaged areas, which is especially helpful for \hyperlink{modulemeshoptim_meshoptimTranssmoothing}{Transformation smoothing}. If you check the \char`\"{}\+Generate boxes\char`\"{} checkbox, boxes around the damaged clusters will be created and all points inside them will be selected. This will likely widen the area selected by the detector -\/ Figure \hyperlink{modulemeshoptim_V}{Selection by box} shows a box created around the areas selected in Figure \hyperlink{modulemeshoptim_IV}{Surface crease damage detection}. The second checkbox allows you to specify whether overlapping boxes shall be merged or not. Non-\/merged boxes will contain less elements and nodes, but \hyperlink{modulemeshoptim_meshoptimTranssmoothing}{Transformation smoothing} is more effective if the area of effect has at least a few hundred elements, so if you want to create the boxes for this purpose, it is recommended to check the merge boxes option. {\ttfamily Hint\+: you can work with the boxes created with crease detector just like with any other boxes you created with the \char`\"{}\+Picking\char`\"{} toolbox using the box manager inside \char`\"{}\+Picking\char`\"{} toolbox.} 
\item Visualization options\+: currently, there is only one option for convenience -\/ you can turn on or off visualization of boxes (you can do the same from the \char`\"{}\+Picking\char`\"{} toolbox). 
\end{DoxyEnumerate}

\label{modulemeshoptim_V}%
\hypertarget{modulemeshoptim_V}{}%
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{meshoptimCreaseDetBoxSelect.png}
\caption{Surface crease damage detection, selection by box}
\end{DoxyImage}
\hypertarget{modulemeshoptim_meshoptimTranssmoothing}{}\subsubsection{Transformation smoothing}\label{modulemeshoptim_meshoptimTranssmoothing}
\hypertarget{modulemeshoptim_meshoptimTranssmoothingoverview}{}\paragraph{Overview}\label{modulemeshoptim_meshoptimTranssmoothingoverview}
Mesh smoothing algorithms usually smooth the mesh based on some general quality metrics. However, smoothing disconnected groups of elements independently could lead to penetrations between them if the boundary is not kept, and to insufficient correction if it is. In the case of positioning and personalization, the user has access to the mesh before the deformation that potentially caused the damaged (assuming the initial model quality is acceptable). This transformation smoothing method takes this \char`\"{}baseline model\char`\"{} and the target model obtained from positioning or personalization and creates a smooth transformation of the former to the latter. This has the advantage of working with the entire model at once while not generating penetrations (as long as the transformation is smooth). A publication on this approach is being prepared. P\+I\+P\+E\+R currently provides two algorithms to perform this transformation smoothing. One is based on dual Kriging interpolation (see \hyperlink{modulekriging}{Kriging Module}) and the other on averaging local displacements of the smoothed points. ~\newline
Regardless of the method, the first step is always to select a baseline model (from file or model history; please refer to the Surface crease detection section \hyperlink{modulemeshoptim_baselineSelect}{above} for details) as the transformation will be smoothed between the baseline and the current model.

\begin{DoxyRemark}{Remarks}

\begin{DoxyItemize}
\item It is advised to use other techniques such as \hyperlink{modulemeshoptim_surfacesmooth}{Smoothing the surface of an entity} or external surface editing to pre-\/process the surface of the entities selected for target until they are deemed acceptable (as transformation smoothing will not affect them)
\item For transformation smoothing after positioning, bones should be selected to ensure they are kept rigid.
\item If you only want to smooth the soft tissues between the bones and the skin, then both have to be selected as targets.
\item The \char`\"{}\+Smooth\char`\"{} button will not be available until both current and baseline model are specified.
\end{DoxyItemize}
\end{DoxyRemark}
\hypertarget{modulemeshoptim_meshoptimTranssmoothingKrigBox}{}\paragraph{Transformation smoothing by Kriging}\label{modulemeshoptim_meshoptimTranssmoothingKrigBox}
In case of transformation by kriging, the region in which the transformation is smoothed is solely based on selection boxes. You can create the selection boxes manually using the \char`\"{}\+Picking\char`\"{} toolbox or with the \hyperlink{modulemeshoptim_creasedetection}{Surface crease detection}. When using the \char`\"{}\+Picking\char`\"{} toolbox, it does not matter whether you are creating the boxes in the node selection or element selection mode -\/ only the boxes themselves will be considered. If you see the message \char`\"{}\+Smoothing not processed, check if all required parameters are set\char`\"{}, it may mean, among other things, mean that there is no selection box.~\newline
{\itshape Hint\+: check the \char`\"{}\+See selection boxes\char`\"{} in order to visualize them. Hold C\+T\+R\+L when drawing the box to activate the de-\/selection mode. This way, nothing inside the box will actually be selected.}~\newline
~\newline
Surfaces of entities selected with \char`\"{}\+Select target entities\char`\"{} are used to constrain the transformation, i.\+e. taken as a target. This means that nodes on the selected entities will be considered as control points for the kriging (but of course only those that are in a selection box) and all other nodes will be transformed according to them.~\newline
Once target entities and selection boxes have been selected, you can start the smoothing by pushing the \char`\"{}\+Smooth\char`\"{} button. {\bfseries Please note that for larger models and/or selected areas, this action can take up to several minutes.}\hypertarget{modulemeshoptim_meshoptimTranssmoothingadvanced}{}\subparagraph{Details and advanced parameters}\label{modulemeshoptim_meshoptimTranssmoothingadvanced}
Advanced parameters are related to (1) the \char`\"{}strength\char`\"{} of the smoothing allowed on both parts that are smoothed and on the entities selected for targets (\char`\"{}nugget\char`\"{} parameter), and (2) the strategy to deal with the large amount of control points typically used in the process (computing cost issues). The parameters and options are described below. Experimenting with a small model or region can be helpful to better understand their effects.

The first three lines of controls (see Figure \hyperlink{modulemeshoptim_VI}{Smooth transformation}) serve to set up \hyperlink{modulekriging_secKrigingNugget}{Nugget} of skin control points and bone control points.
\begin{DoxyItemize}
\item You can either check the \char`\"{}\+Compute nuggets of skin control points based on distance\char`\"{} to set the nuggets automatically (nugget will be equal to a negation of square of the shortest distance to a bone), or set it manually (if you uncheck the box) in the text box below. Note that the \hyperlink{modulekriging_secKrigingNugget}{Nugget} must be a negative number. The skin control points are nodes of all skin entities from among the selected targets. By default, the nugget is set to be computed according to the distance to bones. Therefore, the skin nodes will be allowed to move a bit in order to improve the global result of the interpolation. However, if you pre-\/processed the skin somehow and you want the skin nodes to be preserved, set the nugget to zero.~\newline

\item The bone control points are the surface nodes of all selected bony target entities. By default it is zero, so the kriging will not change the coordinates of bone nodes at all. Setting this to a non-\/zero value can be useful if you are smoothing the results of some scaling process that changed the skeleton.
\item Progressive kriging\+: this checkbox controls how are treated nodes that belong to more than one box, you can read the explanation directly in the G\+U\+I. In most cases, this option will not have a large impact on the results, but feel free to experiment with it.
\end{DoxyItemize}

\begin{DoxyRemark}{Remarks}
Box splitting options (available in the \hyperlink{pageGui_secGuimoduleParam}{Module parameters})\+: the computation cost of the kriging grows rapidly with the number of control points, which makes the \char`\"{}divide and conquer\char`\"{} paradigm fit to apply here. By splitting a box that is too large, the computation time can be greatly enhanced without sacrificing much in terms of quality of the interpolation. This box splitting is automatic and should not be confused with the selection boxes. Parameters controlling this splitting are in the global parameter menu. The first two input text boxes allow you to specify a number of control points and total points allowed in a box. If the box has more, it will be recursively split into two until those thresholds are satisfied.~\newline
The slider below allows to set some overlap between those split boxes. This was initially used to ensure that there are no large discrepancies on their boundary, i.\+e. so that the interpolation still behaves more or less as if it was only a single box. However, this can significantly increase the computation time. Therefore, a different method for preserving the smoothness across boxes was introduced in version 0.\+99 of Piper\+: a small, fixed number (although relative to the size of the box) of control points near the boundary of the box from surrounding boxes are added to each box. For now, it is still possible to use the overlap parameter, but its default value is now zero and it is expected that it will be removed in future version, once more thorough testing is done and it is confirmed that the continuity is sufficiently preserved using only the new method.
\end{DoxyRemark}
\label{modulemeshoptim_VI}%
\hypertarget{modulemeshoptim_VI}{}%
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{meshoptimKrigInBox.png}
\caption{Kriging in a box G\+U\+I}
\end{DoxyImage}
\hypertarget{modulemeshoptim_meshoptimTranssmoothingMoveAvg}{}\paragraph{Transformation smoothing by moving average}\label{modulemeshoptim_meshoptimTranssmoothingMoveAvg}
W\+A\+R\+N\+I\+N\+G -\/ This method has not been tested thoroughly yet (as of version 1.\+0.\+0), it might not work as expected in some cases. ~\newline
This method smooths directly the displacement of each point that was imposed by the transformation. Points that belong to entities selected as targets are not smoothed. For each other point, a specified number of nearest neighbors (based on the source positions) is found. Then, an average displacement within this neighborhood is computed and the current displacement of the point is replaced by this average. This is done in several iterations. Figure \hyperlink{modulemeshoptim_VII}{Moving average G\+U\+I} shows the parameters that can be set\+:~\newline

\begin{DoxyItemize}
\item Maximum iterations\+: how many iterations of the displacement smoothing will be performed. Note that in conjuction with the automatic stopping (see below), less than this maximum can in theory be made.
\item Number of neighbours\+: the number of closest points that are used when computing the average displacement.
\item Automatic stop\+: If turned on, the magnitude of the previous and new displacements are compared in each iteration. If the difference is smaller than the specified threshold, the point will no longer be updated in the next iterations. This can significantly speed-\/up the process in case a large number of iterations is used. It is recommended to always use it at least with 0 as the threshold -\/ that will make sure that points that did not move at all during the transformation (in case of very local transformation) will not be needlesly updated.
\end{DoxyItemize}The moving average method currently works over the whole mesh, so no boxes, as in case of the previous method, are needed.

\label{modulemeshoptim_VII}%
\hypertarget{modulemeshoptim_VII}{}%
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{meshoptimMoveAvg.png}
\caption{Moving average G\+U\+I}
\end{DoxyImage}
 \hypertarget{modulekriging}{}\subsection{Kriging Module}\label{modulekriging}
\hypertarget{modulekriging_secKrigingOverview}{}\subsubsection{Overview}\label{modulekriging_secKrigingOverview}
The kriging module allows to deform the P\+I\+P\+E\+R model or the full F\+E based to a set of source and associated target control points. More generally Kriging is an interpolation method commonly used to deform geometrical models (along with Radial Basis Function, R\+B\+F and Moving Least Square M\+L\+S, Jolivet et al., Stapp 2015). Kriging has a lots of similarities with R\+B\+F (cost, ability to relax the transformation, etc) and with specific parameters, the formulations are equivalent.

The deformation proposed is based on Dual Krigging formulation with generalized covariance (3\+D Euclidian distance) as detailed by Trochu (F. Trochu\+: “\+A contouring program based on Dual Kriging interpolation”, Engineering With Computers, Vol. 9, pp. 160-\/177, 1993).

The implementation that is proposed aims to help a number of issues related to Kriging\+:
\begin{DoxyItemize}
\item size of the problem\+: Kriging typically becomes challenging in terms of computing costs when the number of control points becomes large (e.\+g. over 20000, size of the square matrix to invert). The implementation uses an automatic moving box strategy allowing to use arbitrary numbers of control points (e.\+g. up to 300000 tested) without noticeable effect on the results.
\item cost\+: several approaches are used to reduce the computing cost. First, the process is parallelized then a sampling strategy is used to select and remove control points which affect the least the interpolation (hereby reducing the computing time without affecting widely the result). The downsampling parameters are accessible by the user.
\item distance formulation\+: the interpolation can use a surface distance instead of an euclidian distance to drive the scaling. This is especially relevant for regions that are close in the euclidian space (e.\+g. arm and torso) but far away on the skin surface (and anatomically independent). It is based on an approximation of the geodesic distance on a surface and can be used to improve the realism of the skin. The formulation used by Piper is the Biharmonic Distance (Yaron Lipman, Raif Rustamov, Thomas Funkhouser\+: \char`\"{}\+Biharmonic distance\char`\"{}, A\+C\+M Transactions on Graphics 29, issue 3, 2010). Piper uses the \char`\"{}approximate distance\char`\"{} formulation, which uses only a small subset of eigenvalues of the linear system that is being solved to compute the distance. The \char`\"{}\+Topological distance precision\char`\"{} parameter in \hyperlink{pageGui_secGuimoduleParam}{Module parameters} can be modified to change this number of eigenvalues -\/ it is computed as \mbox{[}the parameter value\mbox{]} / \mbox{[}number of nodes\mbox{]}.
\item to scale independently the skin, the bones, and then use their surfaces to scale the whole model (called dense scaling in the application).
\item change as estimate the relaxation parameter (called nugget) globally or depending on the variability of the interpolation field in a zone and the relative motion of the bones and skin.
\end{DoxyItemize}

Combined, this provides the user a flexibility and adaptability not typically found in existing \char`\"{}morphing\char`\"{} approaches (publications are in preparation). The same approaches are also used to smooth the transformation field.\hypertarget{modulekriging_secKrigingDesc}{}\subsubsection{Description}\label{modulekriging_secKrigingDesc}

\begin{DoxyItemize}
\item {\bfseries Parameters\+:} None
\item {\bfseries Metadata\+:} 
\begin{DoxyItemize}
\item Required\+: None
\item Optional\+: Control points defined on H\+B\+M
\end{DoxyItemize}
\item {\bfseries Target} Input\+: target of type Control\+Point
\item {\bfseries Target} Output\+: target of type Control\+Point
\item {\bfseries Outputs\+:} 
\begin{DoxyItemize}
\item a deformed model according to control point and associated target points using Kriging.
\end{DoxyItemize}
\end{DoxyItemize}

Next figure illustrates the Kriging Module G\+U\+I, composed of three set of tools\+:
\begin{DoxyEnumerate}
\item Control points tools to define \hyperlink{modulekriging_secKrigingControlPoints}{Control Points} and \hyperlink{modulekriging_secKrigingTargetPoints}{Target Points}
\item \hyperlink{modulekriging_secKrigingDeformation}{Deformation Tools}
\item \hyperlink{modulekriging_secKrigingDisplay}{Display}
\end{DoxyEnumerate}

 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{kriging_Overview.png}
\caption{Kriging Module G\+U\+I Overview}
\end{DoxyImage}
\hypertarget{modulekriging_secKrigingControlPoints}{}\subsubsection{Control Points}\label{modulekriging_secKrigingControlPoints}
Select set of \hyperlink{pageFramework_secFrameworkMetadataInteractiveControlPoint}{Control Points} to be used for the Kriging deformation. The name and the number of control points of the control points set is displayed.

 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{kriging_Controlpoints.png}
\caption{Control Points module tool}
\end{DoxyImage}


A set of control point coordinates can be imported from a text file\+:

Example of control points file\+: \begin{DoxyVerb}-163.87512 -188.34157 -497.91904
-163.87512 188.34157 -497.91904
-249.919373518425 0 -231.471675832181
-48.5283182585665 0 -325.381867183739
-168.1071016685 -170.31156382101 -269.621364726814
-168.1071016685 170.31156382101 -269.621364726814
....
\end{DoxyVerb}


To generate target points associated with the current set of control points, a octave cript an be defined (T\+O\+D\+O\+: describe octave A\+P\+I for script)\hypertarget{modulekriging_secKrigingTargetPoints}{}\subsubsection{Target Points}\label{modulekriging_secKrigingTargetPoints}
Select target points existing in the project and define the association with a set of control points.

 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{kriging_Targetpoints.png}
\caption{Target Points module tool}
\end{DoxyImage}


A set of target point coordinates can be imported from a text file\+:

Example of target points file\+: \begin{DoxyVerb}-163.87512 -188.34157 -497.91904
-163.87512 188.34157 -497.91904
-249.919373518425 0 -231.471675832181
-48.5283182585665 0 -325.381867183739
-168.1071016685 -170.31156382101 -269.621364726814
-168.1071016685 170.31156382101 -269.621364726814
....
\end{DoxyVerb}


For each target point set, select the control point set to define the deformation. The number of control and target points should match, otherwise an error occurs during deformation. Control points should not be duplicated -\/ duplicates will be automatically removed.

 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{kriging_TargetpointsAssociation.png}
\caption{Associate Target Points with Control Points}
\end{DoxyImage}
\hypertarget{modulekriging_secKrigingDeformation}{}\subsubsection{Deformation Tools}\label{modulekriging_secKrigingDeformation}
To apply the deformation, open the \char`\"{}\+Perform Deformation\char`\"{} tool window. There are two modes available\+: kriging with or without intermediate targets. On the very bottom of the tool window there are two \char`\"{}\+Apply -\/ ...\char`\"{} buttons, one for each of the modes. Clicking them will deform the loaded H\+B\+M model and create a new history node for it (see \hyperlink{pageGui_secGuiMenuHistory}{Model History menu}).\hypertarget{modulekriging_secKrigingIntermediates}{}\paragraph{Kriging with intermediate targets}\label{modulekriging_secKrigingIntermediates}
Kriging with intermediate targets does not use the input control points to directly deform the entire model, but rather to create two intermediate targets -\/ one for skin and one for bones. This means that only nodes of entites marked as skin in the anatomy database (see \hyperlink{pageHbmPreparation_entity}{\char`\"{}entity\char`\"{} element}) will be deformed separately and so will nodes marked as bone. Results of this deformation are temporarily stored and used as the intermediate targets, i.\+e. all nodes of bones and skin are used as control points, with targets defined by the input set of control points.~\newline
There are numerous options that allow for different workflows when the intermediate targets are used. The following list describes them as they are placed in the tool window, top to bottom\+:
\begin{DoxyItemize}
\item {\bfseries Skin target options\+:}
\begin{DoxyItemize}
\item Topology-\/aware distance\+: This allows toggling the distance formulation as discussed in the \hyperlink{modulekriging_secKrigingOverview}{Overview}. Computing the topology-\/aware distance will take usually around 10-\/30 seconds, but in some cases may significantly improve the result and also, once it is related only to the source, so until it changes (model changes, control points are added or removed), it does not have to be recomputed again for different targets.
\item Used for skin threshold\+: Only nodes that have the \char`\"{}use for skin\char`\"{} (see \hyperlink{modulekriging_secKrigingAssociation}{Skin/bone association}) parameter equal to or higher than this threshold will be used to create the skin intermediate target.
\item Preview\+: A preview of the skin after kriging can be visualized as a semi-\/transparent red surface (see the Figure below). Note that neither selection, blanking or quality computation are possible on the preview surface -\/ it is intended only to provide a quick overview. Changing any parameters relevant to the deformation, such as position of target points, will automatically disable the visualization. Upon ticking the preview box again, it will recompute it using the updated input.  
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{kriging_Preview.png}
\caption{Deformation Preview}
\end{DoxyImage}

\end{DoxyItemize}
\item {\bfseries Bones target options\+:}
\begin{DoxyItemize}
\item Used for bones threshold\+: Only nodes that have the \char`\"{}use for bones\char`\"{} (see \hyperlink{modulekriging_secKrigingAssociation}{Skin/bone association}) parameter equal to or higher than this threshold will be used to create the bones intermediate target.
\item Fix bones\+: Enabling this option will prevent any nodes that belong to bone entities to move during the deformation. Note that they will still be used as control points in order to constrain the movement of the surrounding flesh, but their position will not change, even if some nugget is assigned to them.
\item Preview\+: Bone preview is visualized as a semi-\/transparent yellow surface. It behaves the same way as the skin preview (see description above).
\end{DoxyItemize}
\item {\bfseries Decimation\+:} In order to decrease the computation time of the deformation, an automated algorithm for control points decimation is employed. For each control point on the intermediate target (i.\+e. each node of the intermediate target), a deviation of that nodes source to target displacement from the distance-\/weighted average of displacement of all surrounding nodes is computed. If that deviation is lower than a specified threshold, the node is considered to be insignificant -\/ it\textquotesingle{}s surroundings describe the same motion, so it is not needed -\/ and will not be used for the kriging. The following list describes the options for this tool\+:
\begin{DoxyItemize}
\item Influence radius\+: the aforementioned surroundings is a sphere around the node that is being processed. This parameter describes how large that sphere is. Note that even though there is no button to explicitly turn off the automated decimation, setting the radius to 0 will effectively do it.
\item Maximum deviation\+: this is the deviation threshold. Here deviation means the distance between the actual target and the target that would be obtained if the processed point used the average displacement.
\item Decimate control points\+: pressing this button will do the decimation. Note that this is useful only for the visualization -\/ upon pressing the \char`\"{}\+Apply\char`\"{} deformation button, the decimation will be done anyway if it wasn\textquotesingle{}t done already.
\item Visualize control points on intermediate targets\+: after decimation, the remaining control points can be visualized as blue spheres on the preview of intermediate targets (the preview has to be turned on).
\end{DoxyItemize}
\item {\bfseries Automatic nugget computation\+:} There are currently three ways to set the \hyperlink{modulekriging_secKrigingNugget}{Nugget} of control points\+: define it in the input files (see \hyperlink{pageHbmPreparation_secHbmControlpoints}{\char`\"{}\+Control Points\char`\"{} element}), use the default nugget, or use the automatically computed nugget. The automatic computation works on the same principle as the decimation algorithm described above -\/ if all points in the vicinity of a given control point \char`\"{}move the same way\char`\"{}, it is not needed. But in the other case, where points in close proximity have very different displacements, high nugget will probably be needed to avoid penetrations and other artifacts. The nugget is therefore set based on the deviation from the average displacement in a given surrounding of each point. Several parameters, described in the list below, are introduced in order to scale this result. ~\newline
 One difference between the look-\/up of surrounding between the decimation and nugget algorithms is that the decimation algorithms searches for points that are close to the other point in terms of their source positions, while the nugget uses the target positions instead. The assumption that led to this arrangement is that the most common type of artifact that can be removed by an appropriate nugget is penetration of elements. Therefore, it is more important to track points that are close to each other after the deformation which can signify a potential penetration. Of course, if the penetration is larger than the influence radius, the penetration will not be discovered. ~\newline
 Note that this feature has not been tested thoroughly yet and probably will work as intended only in some cases.
\begin{DoxyItemize}
\item Influence radius\+: raidus of a sphere around the processed point to consider as surroundings.
\item Skin scale\+: The computed nugget will be multiplied by this number if it belongs to a skin node.
\item Bones scale\+: The computed nugget will be multiplied by this number if it belongs to a bone node.
\item Bone-\/skin distribution ratio\+: this parameter allows to enforce the constraints defined either on skin, or bone. The average displacement is computed separately for nodes in the surroundings that belong to bones (D\+E\+Vb) and separately for those that belong to skin (D\+E\+Vs). The nugget is then computed using this parameter (D\+I\+S\+T\+R) as\+: {\itshape Nugget = D\+I\+S\+T\+R $\ast$ D\+E\+Vb + (1 -\/ D\+I\+S\+T\+R) $\ast$ D\+E\+Vs}. For example, setting it to 0 means only deviation from skin will be considered in setting the nugget, effectively saying that displacement of bone is not relevant and should be suppressed, while displacement of skin should be respected. If the processed point is a skin point itself, it will therefore be assigned no nugget, because it will have similar displacement as the average of skin nodes displacement, whereas bone node will have a different displacement and therefore will be assigned a high nugget.
\item Compute nuggets\+: this will perform the computation. As with the \char`\"{}\+Decimate control points\char`\"{} button, this is relevant only for visualization -\/ the computation will be done before the final Kriging deformation whether this button was pressed or not. If you don\textquotesingle{}t want to use this option, check the \char`\"{}use default nugget\char`\"{}.
\item Visualize nuggets\+: once the automatic nugget is computed, it can be visualized on the preview surfaces (they must be enabled). The nugget is visualized on a continuous scale from 0 to the highest (negative) nugget value by transition of blue to red color, respectively. As of current Piper version (1.\+0.\+0), there is no visualization of the numerical values of the scale, only the highest nugget is written in the console. If decimation was performed, points that have been decimated obviously have no nugget, so they are assigned white color.
\end{DoxyItemize}
\item {\bfseries Intermediate target selection\+:} In some workflow, it will be better to use only one of the intermediate targets to transform the model. Either one can be disabled using the check boxes on the bottom of the tool window.
\end{DoxyItemize}\hypertarget{modulekriging_secKrigingAssociation}{}\subparagraph{Skin/bone association}\label{modulekriging_secKrigingAssociation}
These two parameters express how much should a given control point affect bone or skin entities. It is a number between 0 and 1, where 0 means the point does not affect skin/bone at all and 1 is interpreted as \char`\"{}is an actual point of point/skin\char`\"{}. This enables to have plausible deformation for both intermediate targets without introducing artifacts coming from control points that are too far away from the points they deform (e.\+g. control points for spine affecting the skin etc.).\hypertarget{modulekriging_secKrigingDomain}{}\subparagraph{Domain decomposition of H\+B\+M}\label{modulekriging_secKrigingDomain}
Although some artifacts of the deformation can be mitigated by using the aforementioned tools, there can still be issues in some scenarios. Namely, when several significantly different constraints (control points\textquotesingle{} targets) are used, the resulting deformation field might be different from what is needed\+: Kriging will always try to create a single, smooth interpolation based on the provided constraints. Imagine a simple 2\+D example\+: let\textquotesingle{}s assume two control point sets, points A and left of them points B, relatively close to each other. Points A move right, away from points B while points B remain stationary, i.\+e. their target position is equal to their source position. If a single smooth interpolation is defined based on these control points, then on the right side of points B, this interpolation will be represented by a displacement proportional to the displacement by which points B are moved. But since points B do not move, i.\+e. their displacement is zero, the deformation field on the left side of points B will be a displacement in the opposite direction. This will often not be intended, in fact, the non-\/moving constraint is probably intended as \char`\"{}everything behind it should also not move\char`\"{} -\/ but that will not be the case in a single smooth field is imposed on the area. ~\newline
 To mitigate this drawback, it is possible to decompose the model into \char`\"{}domains\char`\"{}, i.\+e. areas that are expected to move in a uniform way so that the assumption that the deformation can be represented by a single smooth deformation field is more or less upheld. For most cases, it will be beneficial to decompose the model into parts that are individually, i.\+e. at each major joint. To minimize the effort needed to do this decomposition, the only metadata that needs to be defined is a set of nodes that create a closed polyline on the skin of the model. This polyline represents the boundary between two domains. Any number of such boundaries can be defined. Piper will subdivide the model into domains and perform kriging on each domain separately and in the end assemble the results back as a single H\+B\+M. ~\newline
 To define the boundary point sets (\char`\"{}rings\char`\"{}), use \hyperlink{pageFramework_secFrameworkMetadataNamedMetadata}{Named Metadata} following these rules\+:
\begin{DoxyItemize}
\item The name can be an arbitrary string ending with \char`\"{}\+\_\+decomposition\char`\"{}. For example, \char`\"{}\+Left\+\_\+arm\+\_\+decomposition\char`\"{}, \char`\"{}\+Left\+\_\+knee\+\_\+decomposition\char`\"{} etc.
\item Each ring must be made of nodes that are on the skin, i.\+e. are part of entities that are defined as skin in the anatomy database (see \hyperlink{pageHbmPreparation_entity}{\char`\"{}entity\char`\"{} element})
\item Each ring must form a closed polyline, i.\+e. for a ring with N nodes, there exists exactly N edges and each node has exactly two neighbors among the other points on the ring to which it is connected by those edges. However, the nodes do not have to sorted in any particular order in the input file.
\item Each edge in the ring must be manifold and non-\/boundary, i.\+e. exactly two elements must share that edge.
\end{DoxyItemize}Rings that do not follow the aforementioned rules will simply be ignored (a warning will be written in the Piper console). ~\newline
 This option can be turned off with a check box on the bottom of the tool window. If it is turned on and the required metadata are not present in the model, the option will be ignored and the transformation will be perfomed as if the option was turned off.\hypertarget{modulekriging_secKrigingDirect}{}\paragraph{Direct Kriging}\label{modulekriging_secKrigingDirect}
The \char`\"{}direct\char`\"{} kriging does not use any preprocessing of the control points -\/ the loaded control points are directly used to define the deformation. In case there is only a small amount of control points (relative to the number of the model\textquotesingle{}s nodes), it will likely lead to some artifacts. For this reason, direct kriging should be used only for a dense network of control points or in conjuction with some model specific knowledge. For other cases, the \hyperlink{modulekriging_secKrigingIntermediates}{Kriging with intermediate targets} should be preffered.~\newline
Note that even though the intermediate targets will not be used for Direct Kriging, one can still use the previews of intermediate targets to get a fast assessment of the effects of the deformation.\hypertarget{modulekriging_secKrigingNugget}{}\subsubsection{Nugget}\label{modulekriging_secKrigingNugget}
A nugget is a \char`\"{}relaxation weight\char`\"{} one can assign to a kriging control point. I represents the uncertainty (variance) of the target position for a given point. A non-\/zero nugget will allow the control point to violate the target position by at most the nugget value distance in order to make the global transformation more smooth. It is useful in situations where it is not necessarry to follow the target perfectly.~\newline
You can specify a global nugget in the \hyperlink{pageGui_secGuimoduleParam}{Module parameters} menu. This value will be used for all control points for any P\+I\+P\+E\+R tool that utilizes kriging (e.\+g. the Kriging module or the scaling tools in Anthropometry module), unless the nugget is explicitly specified to some other value, as it is for example in the \hyperlink{modulemeshoptim_meshoptimTranssmoothing}{Transformation smoothing} tool or by the \hyperlink{pageHbmPreparation_secHbmControlpoints}{control points definition when imported from a file}. The default value is 0, meaning the target positions of control points will be maintained perfectly.~\newline
\hypertarget{modulekriging_secKrigingDisplay}{}\subsubsection{Display}\label{modulekriging_secKrigingDisplay}
T\+O\+D\+O? \hypertarget{moduleContourDeformation}{}\subsection{Contour Deformation Module}\label{moduleContourDeformation}
This module implements a Contour based approach to position the Human Body Model.

The G\+B\+P method of mesh modification is based on the use of contours that envelop the body. The module has primarily two aspects\+: (1) positioning and (2) personalization.

The method of mesh modification is based on the use of contours that envelop the body. The contour based deformation (personalization as well as repositioning) method has 4 steps
\begin{DoxyEnumerate}
\item Contour Generation
\item Delaunay Mapping
\item Contour Transformation
\item Remapping.
\end{DoxyEnumerate}

In the first step, we load the contour\+C\+L.\+xml file from the positioning window. The cotnour Control Line(contour\+C\+L) is a yellow line structure made up by joining the anatomical landmarks on the Human Body Model. With the help of this contour\+C\+L contours are generated all around the G\+H\+B\+M\+C model. These contours and some typical key points (for instance the nodes of the bones in some cases) are used to generate Delaunay Tetrahedrons which cover whole model. ~\newline
All the mesh nodes of the model are then mapped to these Delaunay Tetrahedrons using volume coordinates. Third step consist of transformation of these contours as per the desired input (for instance personalization / repositioning parameters). It is expected that the key points (for instance the bone nodes) are also transformed using the same parameters. Figure 1 shows a set of contours for the G\+H\+B\+M\+C model.~\newline
At the end of third step final positions for all contour points as well as all the key points will be available in the final position. Using these transformed contours and key points, the mapped mesh nodes are remapped and their new positions are determined. This completes the deformation process. ~\newline
{\bfseries Target Input \+:} For target based personalization and positioning Contour Deformation module handles the following targets\+:
\begin{DoxyItemize}
\item For positioning it handles the Landmark Targets
\item For personalization it can handle G\+E\+B\+O\+D target and A\+N\+S\+U\+R targets generated in the Anthropometric Module.
\end{DoxyItemize}\hypertarget{moduleContourDeformation_secContourDeformationMetadata}{}\subsubsection{Metadata}\label{moduleContourDeformation_secContourDeformationMetadata}
The required metadata for positioning and personalization are \+:
\begin{DoxyItemize}
\item Required \+: contour\+C\+L, Landmarks needed to define contour\+C\+L, Skin Entity, Flesh Generic\+Metadata, Contours
\item contour\+C\+L \+: contour control line is formed from the D\+M\+A landmarks. It contains the body region and joint information.
\item Contours \+: Contours are typically closed curves like circle, ellipse, polyline or cubic splines. The contour modification routines shall modify them accordingly.
\item Landmarks (defined to create contour\+C\+L)
\item The bones entities (as defined in \hyperlink{pageAppendixEntity}{Appendix\+: List of entities})
\item Genericmetadata
\end{DoxyItemize}\hypertarget{moduleContourDeformation_secModuleContourDeformationUI}{}\subsubsection{U\+I for Contour Deformation Module}\label{moduleContourDeformation_secModuleContourDeformationUI}
\hypertarget{moduleContourDeformation_POSITIONING}{}\paragraph{P\+O\+S\+I\+T\+I\+O\+N\+I\+N\+G}\label{moduleContourDeformation_POSITIONING}
Allows the user to carry out the Positioning process. The U\+I of the P\+O\+S\+I\+T\+I\+O\+N\+I\+N\+G Window consists of the following features \+:
\begin{DoxyItemize}
\item Load Contour\+C\+L file \+: It loads the contour\+C\+L metadata. It is required for generation of contours around the body and the information required to reposition the model at a specified joint by giving a specific angle wih respect to the current position of the model. In current piper application contour\+C\+L is the yellow highlighted line segment. It is basically made up by joining the anatomical landmarks of the human body.
\item Load Contours (for hip positioning) File icon \+: User can externally load the contours. Curently It is used when one wants to the the repositioning at hip joint. User needs to load the contours from following path \+: \{model\+\_\+path\}/\+G\+H\+B\+M/metadata/contours\+\_\+for\+\_\+hip/\+Contour\+\_\+\+Input.txt . Deform Contours button will remain disabled for Hip Joint unless user loads the required contours from the specified path.
\item Module Opacity \+: It controls the opacity of human body model.
\item Contour C\+L opacity \+: It controls the opacity of contour\+C\+L and generated contours.
\item Repositioning Parameters \+: This section takes input from the user about the joint at which he wants to do the positioning, the type of movement, the side(left/right) and the angle(with respect to the current position).
\item Select joint \+: Select the joint from a list of joints-\/ Knee, Ankle, Hip, Neck, Elbow or Wrist
\item Select side \+: Left or Right Side
\item Select type \+: Type of movement-\/ Flexion/\+Extension, Inversion/\+Aversion, Lateral Rotation or Lateral Flexion etc.
\item Angle \+: Angle must be given with respect to the current position. eg. A value of 10 degree at L\+E\+F\+T K\+N\+E\+E joint shall do a flexion of knee by an angle of 10 degree.
\item Generate Contours \+: Contours are typically closed non-\/intersecting curves like circle, ellipse or a polyline enveloping the H\+B\+M. In some cases they can also be open cubic splines. The contour modification routines shall modify them accordingly. Typically, the contours should not be on the skin but slightly bigger and away from surface of mesh. Generate contour will create these contours.
\item Deform Contours \+: Contours will be deformed by the input angle at the selected joint.
\item Reposition \+: The model will be repositioned.
\item Use Landmark Switch \+: If the positioning is to be done using the landmark targets import the target file from the file menu and click on this switch to start the positioning through landmark targets
\item Process Landmark Targets \+: Click on this button to compute the input required to do the positioning.
\item Continue \+: Click on this button to continue with the process of landmark target positioning till a prompt of positioning complete comes up
\end{DoxyItemize}\hypertarget{moduleContourDeformation_PERSONALIZATION}{}\paragraph{P\+E\+R\+S\+O\+N\+A\+L\+I\+Z\+A\+T\+I\+O\+N}\label{moduleContourDeformation_PERSONALIZATION}
Allows the user to personalize the model using a number of parameters.~\newline
{\bfseries  The Personalization window U\+I \+: }
\begin{DoxyItemize}
\item Load Personalization Contours \+: User needs to load the contours for personalization. The path for the Personalization\+\_\+\+Contours is \char`\"{}\{model\}\textbackslash{}\+G\+H\+B\+M\textbackslash{}metadata\textbackslash{}contour\+\_\+input\+\_\+for\+\_\+personalization\char`\"{}
\item Load Body Data \+: Load Body\+Data.\+txt file from the path \+: \char`\"{}\{model\}\textbackslash{}\+G\+H\+B\+M\textbackslash{}metadata\textbackslash{}\+Body\+Data\char`\"{} to enable the personalization process
\item Load Anthropometric Target File \+: Load the target file generated from the anthropometric module, it contain the values corresponding to A\+N\+S\+U\+R body dimensions. Load this file when you need to do the personalization using the target A\+N\+S\+U\+R body dimensions.
\item Options \+: At present the user can populate the 35 G\+E\+B\+O\+D dimension values by selecting among 5th,50th,75th or 95th percentile or by selecting the generated G\+E\+B\+O\+D or A\+N\+S\+U\+R target dimensions. G\+E\+B\+O\+D \& A\+N\+S\+U\+R target dimensions can be generated through Anthorpometric Module.
\item Personalize \+: Personalize button will start the personalization for the full G\+H\+B\+M\+C model for the given 35 parameter values
\end{DoxyItemize}

{\bfseries G\+E\+B\+O\+D Body Dimension Descriptions\+:}
\begin{DoxyItemize}
\item 1. W\+E\+I\+G\+H\+T\+: Subject stands on scales (nude or wearing lightweight undergarments) with feet parallel and weight distributed equally on both feet.
\item 2. S\+T\+A\+N\+D\+I\+N\+G H\+E\+I\+G\+H\+T\+: Subject stands erect, head in the Frankfort plane, heels together, and weight distributed equally on both feet. With the arm of the anthropometer firmly 64 M\+A\+D\+Y\+M\+O Utilities Manual Release 7.\+5 touching the scalp, measure the vertical distance from the standing surface to the top of the head.
\item 3. S\+H\+O\+U\+L\+D\+E\+R H\+E\+I\+G\+H\+T\+: Subject stands erect looking straight ahead, heels together, and weight distributed equally on both feet. With an anthropometer, measure the vertical distance from the standing surface to the right acromial landmark.
\item 4. A\+R\+M\+P\+I\+T H\+E\+I\+G\+H\+T\+: Measurement derived by subtracting Scye Circumference divided by $ \pi $. from Shoulder Height (see above). Scye Circumference\+: Subject stands erect looking straight ahead. The right arm is abducted sufficiently to allow placement of a tape into the axilla. With a tape passing through the axilla, over the anterior and posterior vertical scye landmarks and over the right acromial landmark, measure the circumference of the scye. The axillary tissue is not compressed.
\item 5. W\+A\+I\+S\+T H\+E\+I\+G\+H\+T\+: Subject stands erect, his head in the Frankfort plane.\+Using an anthropometer, measure the distance from the standing surface to the omphalion landmark. The subject must not pull in his stomach.
\item 6. S\+E\+A\+T\+E\+D H\+E\+I\+G\+H\+T\+: Subject sits erect, head in the Frankfort plane, upper arms hanging relaxed, forearms and hands extended forward horizontally. With the anthropometer arm firmly touching the scalp, measure the vertical distance from the sitting surface to the top of the head.
\item 7. H\+E\+A\+D L\+E\+N\+G\+T\+H\+: Subject sits. With a spreading calliper, measure in the midsagittal plane the maximum length of the head between the glabella landmark and the occiput.
\item 8. H\+E\+A\+D B\+R\+E\+A\+D\+T\+H\+: Subject sits. With a spreading calliper measure the maximum horizontal breadth of the head above the level of the ears.
\item 9. H\+E\+A\+D T\+O C\+H\+I\+N H\+E\+I\+G\+H\+T\+: Subject stands under the headboard looking straight ahead. The headboard is adjusted so that its vertical and horizontal planes are in firm contact with the back and the top of the head. Positioning the head in the Frankfort plane and using the special gauge, measure the vertical distance from the horizontal plane to the menton landmark.
\item 10. N\+E\+C\+K C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject sits erect, head in the Frankfort plane. A piece of dental tape is placed around the neck, passing over all four neck landmarks. The measurer marks off with her thumbnail a length of tape corresponding to the subject’s neck circumference, and then measures this tape segment with a standard tape.
\item 11. S\+H\+O\+U\+L\+D\+E\+R B\+R\+E\+A\+D\+T\+H\+: Subject sits erect looking straight ahead, upper arms hanging relaxed, forearms and hands extended forward horizontally. With a beam calliper, measure the distance between the acromial landmarks.
\item 12. C\+H\+E\+S\+T D\+E\+P\+T\+H\+: Subject stands erect looking straight ahead, heels together, and weight distributed equally on both feet. With a beam calliper, measure the horizontal depth of the trunk at the level of the bustpoint landmarks. The reading is made at the point of maximum quiet inspiration. 65 Release 7.\+5 M\+A\+D\+Y\+M\+O Utilities Manual
\item 13. C\+H\+E\+S\+T B\+R\+E\+A\+D\+T\+H\+: Subject stands erect looking straight ahead with arms slightly abducted. With a beam calliper, measure the horizontal distance across the trunk at the level of the bustpoint landmarks.
\item 14. W\+A\+I\+S\+T D\+E\+P\+T\+H\+: Subject stands erect looking straight ahead, arms at sides heels together, and weight distributed equally on both feet. With a beam calliper, measure the horizontal depth of the trunk at the level of the waist landmarks. The reading is made at the point of maximum quiet inspiration. The subject must not pull in her stomach.
\item 15. W\+A\+I\+S\+T B\+R\+E\+A\+D\+T\+H\+: Subject stands erect looking straight ahead with arms slightly abducted. With a beam calliper, measure the horizontal breadth across the trunk at the level of the waist landmarks.
\item 16. B\+U\+T\+T\+O\+C\+K D\+E\+P\+T\+H\+: Subject stands erect, heels together and weight distributed equally on both feet. With a beam calliper, measure the horizontal depth of the trunk at the level of the buttock landmark.
\item 17. H\+I\+P B\+R\+E\+A\+D\+T\+H, S\+T\+A\+N\+D\+I\+N\+G\+: Subject stands erect, heels together and weight distributed equally on both feet. With a beam calliper, measure the maximum horizontal breadth of the hips.
\item 18. S\+H\+O\+U\+L\+D\+E\+R T\+O E\+L\+B\+O\+W L\+E\+N\+G\+T\+H\+: Subject stands erect looking straight ahead and with arms relaxed. With a beam calliper held parallel to the long axis of the right upper arm, measure the distance from the acromial landmark to the radiale landmark.
\item 19. F\+O\+R\+E\+A\+R\+M-\/\+H\+A\+N\+D L\+E\+N\+G\+T\+H\+: Measurement derived by summing Radiale-\/ Stylion Length and Hand Length. Radiale-\/\+Stylion Length\+: Subject stands erect with arms relaxed. With a beam calliper held parallel to the long axis of the right forearm, measure the distance from the radiale landmark to the stylion landmark. Hand Length\+: Subject sits, right forearm and hand raised with palm up. The fingers are together and straight but not hyper-\/extended. With the bar of a sliding calliper parallel to the long axis of the hand, measure the distance from the wrist landmark to the dactylion.
\item 20. B\+I\+C\+E\+P\+S C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject stands with right arm slightly abducted. With a tape held in a plane perpendicular to the long axis of the upper arm, measure the circumference of the arm at the level of the biceps landmark.
\item 21. E\+L\+B\+O\+W C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject stands, right upper arm raised so that its long axis is horizontal, elbow flexed 90 degrees, fist tightly clenched and biceps strongly contracted. With a tape passing over the tip and through the crotch of the elbow, measure the circumference of the elbow.
\item 22. F\+O\+R\+E\+A\+R\+M C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject stands erect with right arm slightly abducted and hand relaxed. With a tape held in a plane perpendicular to the long axis of the forearm, measure the circumference of the arm at the level of the forearm landmark.
\item 23. W\+R\+I\+S\+T C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject stands with right arm slightly abducted. With a tape held in a plane perpendicular to the long axis of the forearm and hand, measure the circumference of the wrist at the level of the stylion landmark. 66 M\+A\+D\+Y\+M\+O Utilities Manual Release 7.\+5
\item 24. K\+N\+E\+E H\+E\+I\+G\+H\+T, S\+E\+A\+T\+E\+D\+: Subject sits with his feet resting on a surface adjusted so that the knees are bent at about right angles. Using an anthropometer, measure the vertical distance from the footrest surface to the suprapatella landmark on the right knee.
\item 25. T\+H\+I\+G\+H C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject stands erect, heels approximately 10 cm apart, and weight distributed equally on both feet. With a tape held in a plane perpendicular to the long axis of the right thigh measure the circumference of the thigh at the level of the lowest point on the gluteal furrow. Where the furrow is deeply indented, the measurement is made just distal to the furrow.
\item 26. U\+P\+P\+E\+R L\+E\+G C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Measurement derived by summing the Thigh Circumference (see above) and the Knee Circumference (see below) and dividing the sum by two to obtain the average.
\item 27. K\+N\+E\+E C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject stands erect, heels approximately 10 cm apart, and weight distributed equally on both feet. With a tape held in a plane perpendicular to the long axis of the right leg, measure the circumference of the knee at the level of the mid patella landmark. The subject must not tense her knee during the measurement.
\item 28. C\+A\+L\+F C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject stands erect, heels approximately 10 cm apart, and weight distributed equally on both feet. With a tape held in a plane perpendicular to the long axis of the right lower leg, measure the circumference of the calf at the level of the calf landmark.
\item 29. A\+N\+K\+L\+E C\+I\+R\+C\+U\+M\+F\+E\+R\+E\+N\+C\+E\+: Subject stands erect with weight distributed equally on both feet. With a tape held in a plane perpendicular to the long axis of the right lower leg, measure the circumference of the leg at the level of the ankle landmark.
\item 30. A\+N\+K\+L\+E H\+E\+I\+G\+H\+T, O\+U\+T\+S\+I\+D\+E\+: Subject stands with weight distributed equally on both feet. With the special measuring block, measure the vertical distance from the standing surface to the lateral malleolus landmark on the right leg.
\item 31. F\+O\+O\+T B\+R\+E\+A\+D\+T\+H\+: Subject stands erect, right foot in the measuring box, left foot on a board of equal height, and weight distributed equally. The right foot is positioned so that its long axis is parallel to the side of the box, the heel touches the rear of the box, and the medial metatarsal-\/phalangeal joint touches the widest part of the foot, measure on the scale of the box the breadth of the foot.
\item 32. F\+O\+O\+T L\+E\+N\+G\+T\+H\+: Subject stands erect, right foot in the measuring box, left foot on a board of equal height, and weight distributed equally. The right foot is positioned so that its long axis is parallel to the side of the box, the heel touches the rear of the box, and the medial metatarsal-\/phalangeal joint touches the side of the box. With the measuring block touching the tip of the most protruding toe, measure on the scale of the box the length of the foot.
\item 33. H\+A\+N\+D B\+R\+E\+A\+D\+T\+H\+: Subject sits with right hand resting on a table, palm up, fingers extended and together. The thumb is held away from the hand. Using the sliding caliper, measure the maximum breadth from Metacarpale I\+I to Metacarpale V. 67 Release 7.\+5 M\+A\+D\+Y\+M\+O Utilities Manual
\item 34. H\+A\+N\+D L\+E\+N\+G\+T\+H\+: Subject sits with his right hand resting flat on a table, palm up, fingers extended and together. With the bar of the sliding caliper parallel to the long axis of the hand, measure the distance from the wrist landmark to the tip of the finger.
\item 35. H\+A\+N\+D D\+E\+P\+T\+H\+: Subject.\+s right hand is held palm down with fingers extended and together, narrow profile towards the measurerer. Maintaining light pressure on the spreading caliper, measure the thickness of the hand at the metacarpalphalangeal joint of the third finger.
\end{DoxyItemize}\hypertarget{moduleContourDeformation_secModuleContourDeformationDisplayTab}{}\paragraph{Display Tab}\label{moduleContourDeformation_secModuleContourDeformationDisplayTab}
Allows the user to selectively display of entities, landmarks, generic metadatas, frames, joints, contours and targets.\hypertarget{moduleContourDeformation_secModuleContourDeformationLimitations}{}\subsubsection{Limitations}\label{moduleContourDeformation_secModuleContourDeformationLimitations}
The current repositioning works for full G\+H\+B\+M\+C Model. So to proceed with the repositioniong one has to import the F\+U\+L\+L G\+H\+B\+M\+C.
\begin{DoxyItemize}
\item For repositioniong at pelvis joint one has to first load the Contour\+\_\+\+Input.\+txt file from the \char`\"{}\{model\+\_\+path\}/\+G\+H\+B\+M/metadata/contours\+\_\+for\+\_\+hip/\char`\"{} folder. After loading the Contour\+\_\+\+Input.\+txt file the contours will be generated for the model.
\item Hip repositioning will then require the basic inputs like type of movement(flexion/extension,internal/external rotation or abduction/aduction), angle and left/right side.
\end{DoxyItemize}\hypertarget{moduleContourDeformation_secModuleContourDeformationReposProcedure}{}\subsubsection{P\+O\+S\+I\+T\+I\+O\+N\+I\+N\+G Procedure}\label{moduleContourDeformation_secModuleContourDeformationReposProcedure}
{\bfseries  Steps to re-\/position the model using the contour deformation module \+:}
\begin{DoxyItemize}
\item 1. Open Repositioning window by clicking on the \char`\"{}\+Positioning\char`\"{} button on the right panel
\item 2. Load the contour\+C\+L from contour\+Deformation Module
\item 3. Select the joint to be re-\/positioned and \& type of movement intended \+:
\begin{DoxyItemize}
\item 3a) Knee \+: type of repositioning \mbox{[}flexion/extension\mbox{]}
\item 3b) Ankle \+: type of repositioning \mbox{[}flexion/extension, inversion/aversion\mbox{]}
\item 3c) Neck \+: type of repositioning \mbox{[}flexion/extension, lateral rotation, lateral flexion/extension\mbox{]}
\item 3d) Elbow \+: type of repositioning \mbox{[}flexion/extension, pronation/supination\mbox{]}
\item 3e) Wrist \+: type of repositioning \mbox{[}flexion/extension\mbox{]}
\item 3f) Hip \+: type of repositioning \mbox{[}flexion/extension, abduction/adduction, internal/external rotation\mbox{]}
\begin{DoxyItemize}
\item 3fa) Click on the button with the \char`\"{}\+File icon\char`\"{} and load the contour file present in piper\+\_\+model/\+G\+H\+B\+M/metadata/contours\+\_\+for\+\_\+hip folder
\end{DoxyItemize}
\end{DoxyItemize}
\item 4. Enter the angle by which you want to do the selected movement at the selected joint
\item 5. Click on the \char`\"{}\+Generate contours\char`\"{} button to create the contours and wait for the contours to be generated
\item 6. Click on the \char`\"{}\+Deform Contours\char`\"{} button to deform the contours.
\item 7. Click on the \char`\"{}\+Reposition\char`\"{} button to re-\/position the model to the new position and wait for the re-\/positioning to be completed.
\end{DoxyItemize}
\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{moduleContourDeformationReposSteps.png}
\caption{Positioining U\+I with stepwise description to do repositioning}
\end{DoxyImage}


{\bfseries  Steps to re-\/position the model using the contour deformation module using landmark targets \+:}
\begin{DoxyEnumerate}
\item Import the target file using Target Menu
\item Go to Contour Deformation Module
\item Press Positioning button on the side bar. This will open a new window having controls for re-\/positioning the H\+B\+M
\item Press \char`\"{}\+Load Contour\+C\+L file\char`\"{} button to open the contour\+C\+L.\+xml. This step will cause yellow colored control lines to appear with the model display. These control lines provide a guiding structure for the generation of Contours around the H\+B\+M. It is also used in the Target Based Repositioning for traversal around the various Body Regions and to find the joint angles.
\item Press \char`\"{}\+Use Landmark Targets\char`\"{} switch to go into re-\/positioning based on Targets mode.
\item The target processing is an iterative process. The body regions are traversed along the contour\+C\+L structure. In order to start this iterative process follow the instructions below\+:
\begin{DoxyEnumerate}
\item Press \char`\"{}\+Process Landmark Targets button\char`\"{}. Please note as of now only Landmark Targets are supported.
\item The immutable fields Joint,Side, Type and Angle will get populated automatically. Please note, currently only flexion-\/extension is supported in this Mode.
\item Press \char`\"{}\+Generate Contours\char`\"{} button in order to generate the contours around the H\+B\+M.
\item Press \char`\"{}\+Deform Contours\char`\"{} button in order to deform the contours according to the computed Joint,Side,Type and Angle computed in the Step 6-\/b.
\item Press \char`\"{}\+Reposition\char`\"{} button. This will run the contour based repositioning algo to deform the model, based on information synthesized from Landmark Targets.
\item Press \char`\"{}\+Continue\char`\"{} button to move on to the next target for the remaining body regions, until all the body regions are processed.
\item If the computed angle is zero, stop.
\end{DoxyEnumerate}
\end{DoxyEnumerate}
\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{moduleContourDeformationReposUsingTargetsSteps.png}
\caption{Positioining U\+I with stepwise description to do repositioning using Landmark Targets}
\end{DoxyImage}


{\bfseries Steps to personalize the model using the contour deformation module \+:}
\begin{DoxyItemize}
\item 1. Open up P\+I\+P\+E\+R and load the G\+H\+B\+M\+C model.
\item 2. Open Personalization window by clicking on the "Personalization" button on the right panel.
\item 3. Click on the "Load personalization contours" button and select the Personalization\+\_\+\+Input.\+txt file to load the personalization contours.
\item 4. Click on the "Load body data file" button and select the Body\+Data.\+txt file to load the personalization ratios.
\item 5. Choose a percentile from the option tab or G\+E\+B\+O\+D body dimension targets or generate the A\+N\+S\+U\+R targets.
\item 6. Click on the start button to personalize the model.
\end{DoxyItemize}


\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{moduleContourDeformationPersonalizationSteps.png}
\caption{Personalization U\+I with steps to perform personalization}
\end{DoxyImage}


{\bfseries  Steps to reposition the module in case of absence of a required entity (eg. Skin\+Head\+Neck for positioning at cervical region) \+: }
\begin{DoxyItemize}
\item 1. Open Repositioning window by clicking on the \char`\"{}\+Positioning\char`\"{} button on the right panel
\item 2. Load the contour\+C\+L from contour\+Deformation Module from the path \+: \char`\"{}\{model\}\textbackslash{}\+G\+H\+B\+M\textbackslash{}metadata\textbackslash{}\+Meta\+Editor\+Work\+Flow\+Entity\+Editor\char`\"{} folder.
\item 3. A pop window will propmpt about missing Skin\+Head\+Neck entity.
\item 4. Goto Meta\+Editor Module. Click on Complete contour\+C\+L button. A window will pop up showing the missing Skin\+Head\+Neck metadata in the list.
\item 5. Click on the missing metadata from the list and click on Create Object button.
\item 6. Entity editor will pop up, now proceed as follows \+:
\begin{DoxyItemize}
\item 6a) Select the entity picker from the picker options displayed in the entity editor window
\item 6b) Open up the Entity display window and selectively display Skin\+\_\+\+Of\+\_\+\+Head and Skin\+\_\+\+Of\+\_\+\+Neck entities
\item 6c) Click on shift and select the Skin\+\_\+\+Of\+\_\+\+Head and Skin\+\_\+\+Of\+\_\+\+Neck entities.
\item 6d) Click on add in the entity editor window to create the new entity Skin\+Head\+Neck.
\end{DoxyItemize}
\item 7. Now go to contour Deformation Module.
\item 8. Open the Positioning window from the right tab.
\item 9. Load the contour\+C\+L from contour\+Deformation Module from the path \+: \char`\"{}\{model\}\textbackslash{}\+G\+H\+B\+M\textbackslash{}metadata\textbackslash{}\+Meta\+Editor\+Work\+Flow\+Entity\+Editor\char`\"{} folder.
\item 10. Select the following options in the Repositioning Parameters \+:
\begin{DoxyItemize}
\item 10a) Select Neck in the Joint options
\item 10b) Select among the following movements \+: flexion/extension, lateral rotation, lateral flexion/extension
\item 10c) Enter the angle by which you want to do the selected movement at the selected joint
\end{DoxyItemize}
\item 11. Click on the \char`\"{}\+Generate contours\char`\"{} button to create the contours and wait for the contours to be generated
\item 12. Click on the \char`\"{}\+Deform Contours\char`\"{} button to deform the contours.
\item 13. Click on the \char`\"{}\+Reposition\char`\"{} button to re-\/position the model to the new position and wait for the re-\/positioning to be completed.
\end{DoxyItemize}

{\bfseries  Steps to reposition the module in case of absence of a required landmark(eg. footl\+\_\+distal1 for positioning at ankle joint) \+: }
\begin{DoxyItemize}
\item 1. Open Repositioning window by clicking on the \char`\"{}\+Positioning\char`\"{} button on the right panel
\item 2. Load the contour\+C\+L from contour\+Deformation Module from the path \+: \char`\"{}\{model\}\textbackslash{}\+G\+H\+B\+M\textbackslash{}metadata\textbackslash{}\+Meta\+Editor\+Work\+Flow\+Landmark\+Editor\char`\"{} folder.
\item 3. A pop window will propmpt about missing controlpoint landmark footr\+\_\+distal1.
\item 4. Goto Meta\+Editor Module. Click on Complete contour\+C\+L button. A window will pop up showing the missing footr\+\_\+distal1 metadata in the list.
\item 5. Click on the missing metadata from the list and click on Create Object button.
\item 6. Landmark editor will pop up, now proceed as follows \+:
\begin{DoxyItemize}
\item 6a) Select the single node picker from the picker options displayed in the landmark editor window
\item 6b) Open up the Entity display window and selectively display Right\+\_\+foot\+\_\+\+Skeleton entity
\item 6c) Click on second distal phalange of the Right\+\_\+foot\+\_\+\+Skeleton entity
\item 6d) Click on add in the landmark editor window to create the new landmark footr\+\_\+distal1.
\end{DoxyItemize}
\item 7. Now go to contour Deformation Module.
\item 8. Open the Positioning window from the right tab.
\item 9. Load the contour\+C\+L from contour\+Deformation Module from the path \+: \char`\"{}\{model\}\textbackslash{}\+G\+H\+B\+M\textbackslash{}metadata\textbackslash{}\+Meta\+Editor\+Work\+Flow\+Entity\+Editor\char`\"{} folder.
\item 10. Select the following options in the Repositioning Parameters \+:
\begin{DoxyItemize}
\item 10a) Select Ankle in the Joint options
\item 10b) Select among the following movements \+: flexion/extension, inversion/aversion
\item 10c) Select Right in the Side options
\item 10d) Enter the angle by which you want to do the selected movement at the selected joint
\end{DoxyItemize}
\item 11. Click on the \char`\"{}\+Generate contours\char`\"{} button to create the contours and wait for the contours to be generated
\item 12. Click on the \char`\"{}\+Deform Contours\char`\"{} button to deform the contours.
\item 13. Click on the \char`\"{}\+Reposition\char`\"{} button to re-\/position the model to the new position and wait for the re-\/positioning to be completed.
\end{DoxyItemize}\hypertarget{moduleContourDeformation_secModuleContourDeformationContourPerso}{}\subsubsection{Contour Personalization}\label{moduleContourDeformation_secModuleContourDeformationContourPerso}
\hypertarget{moduleContourDeformation_secModuleContourDeformationContourPersoOverview}{}\paragraph{Overview}\label{moduleContourDeformation_secModuleContourDeformationContourPersoOverview}
This module provides various tools for performing personalization on the Human Body Model (H\+B\+M) with the help of dynamic contour\+C\+L. The main approach of this module is to use contour\+C\+L as reference in order to perform personalization routine. The process can be performed in various ways such as Custom Personalization or Target Based Personalization.\hypertarget{moduleContourDeformation_secModuleContourDeformationContourPersoCustom}{}\paragraph{Custom Personalization}\label{moduleContourDeformation_secModuleContourDeformationContourPersoCustom}
This tools aims to provide the user to control the dimensions of the H\+B\+M in order to perform personalization. Two major tools being \+:
\begin{DoxyItemize}
\item 1. Circumference Scaling Tool
\item 2. Length Scaling Tool
\end{DoxyItemize}\hypertarget{moduleContourDeformation_secModuleContourDeformationContourPersoCustomCircum}{}\subparagraph{Custom Personalization\+: Circumference Tool}\label{moduleContourDeformation_secModuleContourDeformationContourPersoCustomCircum}
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{moduleContourDeformationCustomPersonalizationCircum.png}
\caption{Custom Personalization Window\+: Circumference Tab}
\end{DoxyImage}


The above snapshot shows the Custom Personalization\+: Circumference Tool which is used to scale the circumference of the selected contour. The procedure for using this tools is as follows\+:

-\/1. Click on \char`\"{}\+Load Contour\+C\+L File\char`\"{} button and select the valid contour\+C\+L xml file. -\/2. Click on \char`\"{}\+Generate Contours\char`\"{} button in order to Genrate the Contours in the display. -\/3. Select the contour to be scaled from the provided table. -\/4. Change the value of \char`\"{}\+Scale Contour\char`\"{} spinbox and view the results in the display. -\/5. Click on \char`\"{}\+Reset Contours\char`\"{} incase of any error and perform the previous step again. -\/6. Click on \char`\"{}\+Personalize\char`\"{} button to perform personalization.\hypertarget{moduleContourDeformation_secModuleContourDeformationContourPersoCustomLength}{}\subparagraph{Custom Personalization\+: Length Tool}\label{moduleContourDeformation_secModuleContourDeformationContourPersoCustomLength}
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{moduleContourDeformationCustomPersonalizationLength.png}
\caption{Custom Personalization Window\+: Length Tab}
\end{DoxyImage}


The above snapshot shows the Custom Personalization\+: Length Tool which is used to scale the length of the selected contour body region. The procedure for using this tools is as follows\+:

-\/1. Click on \char`\"{}\+Load Contour\+C\+L File\char`\"{} button and select the valid contour\+C\+L xml file. -\/2. Click on \char`\"{}\+Generate Contours\char`\"{} button in order to Genrate the Contours in the display. -\/3. Select the contour body region to be scaled from the provided table. -\/4. Change the value of \char`\"{}\+Scale Body Region Length\char`\"{} spinbox and view the results in the display. -\/5. Click on \char`\"{}\+Reset Contours\char`\"{} incase of any error and perform the previous step again. -\/6. Click on \char`\"{}\+Personalize\char`\"{} button to perform personalization.\hypertarget{moduleContourDeformation_secModuleContourDeformationContourPersoTarget}{}\paragraph{Target Personalization}\label{moduleContourDeformation_secModuleContourDeformationContourPersoTarget}
 
\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{moduleContourDeformationTargetPersonalization.png}
\caption{Target Personalization Window}
\end{DoxyImage}


The above snapshot shows the Target Personalization window. this tool provides the user the user to load the Anthrometric Targets generated from the \hyperlink{moduleAnthropometricPersonalization}{Anthropo Module} . The procedure for using this tools is as follows\+:

-\/1. Click on \char`\"{}\+Load Contour\+C\+L File\char`\"{} button and select the valid contour\+C\+L xml file. -\/2. Click on \char`\"{}\+Generate Contours\char`\"{} button in order to Genrate the Contours in the display. -\/3. Click on \char`\"{}\+Load Target File\char`\"{} button if the targets have not been loaded yet. The values of the targets will be updated in the table below that button. -\/4. Click on \char`\"{}\+Preview\char`\"{} to preview the modified contours. -\/5. Click on \char`\"{}\+Reset Contours\char`\"{} incase of any error and perform the previous step again. -\/6. Click on \char`\"{}\+Personalize\char`\"{} button to perform personalization. \hypertarget{modulePhysShape}{}\subsection{Shaping Module}\label{modulePhysShape}
This module implements a physics simulation where the whole skeleton is a fixed affine frame and the soft tissue degrees of freedom are points sampled on the skin.

The skin gets elasticity from a triangular F\+E\+M to ensure a smooth transformation.


\begin{DoxyItemize}
\item {\bfseries Metadata\+:} The skin and skeleton must be defined by \hyperlink{pageFramework_secFrameworkMetadataEntity}{Entity}. The skin can be either defined in a single or multiple entites.
\item {\bfseries Input Targets}\+: currently the module does have support for loading any target.
\item {\bfseries Output}\+:
\begin{DoxyItemize}
\item \hyperlink{modulePhysShape_secModulePhysShapeUpdate}{Model nodes update}
\end{DoxyItemize}
\end{DoxyItemize}

\begin{DoxyWarning}{Warning}
This module is in a {\itshape beta} stage and has been tested only with the P\+I\+P\+E\+R child model.
\end{DoxyWarning}
\begin{DoxyAuthor}{Author}
Thomas Lemaire -\/ I\+N\+R\+I\+A
\end{DoxyAuthor}
\hypertarget{modulePhysShape_secModulePhysShapeParam}{}\subsubsection{Parameters}\label{modulePhysShape_secModulePhysShapeParam}
\hypertarget{modulePhysShape_secModulePhysShapeParamNbPoint}{}\paragraph{Points handle}\label{modulePhysShape_secModulePhysShapeParamNbPoint}
Controls the number of points degrees of freedom sampled on the skin.\hypertarget{modulePhysShape_secModulePhysShapeParamStiffness}{}\paragraph{Default target stiffness}\label{modulePhysShape_secModulePhysShapeParamStiffness}
Default stiffness for the point handles target. The current value can be changed in the module.\hypertarget{modulePhysShape_secModulePhysShapeSkinYM}{}\paragraph{Skin young modulus}\label{modulePhysShape_secModulePhysShapeSkinYM}
Skin triangular F\+E\+M Young Modulus. Increase the value to get smoother deformations, decrease it to get sharper deformations. The current value can be changed in the module.\hypertarget{modulePhysShape_secModulePhysShapeGUI}{}\subsubsection{User interface}\label{modulePhysShape_secModulePhysShapeGUI}
\hypertarget{modulePhysShape_secPhysPosiShapeControl}{}\paragraph{Simulation control}\label{modulePhysShape_secPhysPosiShapeControl}

\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{moduleShape_control.png}
\caption{Simulation control}
\end{DoxyImage}
\hypertarget{modulePhysShape_secModulePhysShapeNodeController}{}\paragraph{Point handle controller}\label{modulePhysShape_secModulePhysShapeNodeController}
Once the {\itshape Point handle interactor} mouse tool is active \+:
\begin{DoxyItemize}
\item Click on a red spfere to add a controller for that point
\item Click again on the red sphere to remove the controller
\item Drag the red, green, blue arrows to set the target value for that controller
\end{DoxyItemize}


\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{moduleShape_pointController.png}
\caption{Use of the point handle mouse interactor}
\end{DoxyImage}
\hypertarget{modulePhysShape_secModulePhysShapeDisplay}{}\paragraph{Display settings}\label{modulePhysShape_secModulePhysShapeDisplay}

\begin{DoxyImage}
\includegraphics[width=0.5\textwidth]{moduleShape_display.png}
\caption{Display settings}
\end{DoxyImage}
\hypertarget{modulePhysShape_secModulePhysShapeUpdate}{}\subsubsection{Model nodes update}\label{modulePhysShape_secModulePhysShapeUpdate}
The computation of model nodes must be activated first, then the P\+I\+P\+E\+R model nodes coordinate can be updated. \hypertarget{modulescalingparameter}{}\subsection{Scaling Parameter Module}\label{modulescalingparameter}
The Scaling Parameter module allows to apply a scaling factor to parameter values defined in the parsing rule file (\hyperlink{pageHbmPreparation_parameter}{\char`\"{}parameter\char`\"{} element}).

A typical usage scenario would include the change of material parameters or shell thickness that is correlated with another predictor. An example of application (including a python script to compute material parameters as a function of age) is provided for the P\+I\+P\+E\+R child model.

The module G\+U\+I is divided in two part\+: \begin{DoxyItemize}
\item A table\+: a list of parameters defined in the P\+I\+P\+E\+R model identified by their name in the first column of the table. A default value is set to 1.\+O for the scaling factor displayed in the second column. The scaling factor can be modified by selecting and setting a new value of the appropriate line. \item A module output\+: in this panel, the Scaling Parameter module provides output.\end{DoxyItemize}

\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{scalingparam01.png}
\caption{Scaling Parameter Module U\+I}
\end{DoxyImage}


{\bfseries Button \char`\"{}\+Load Values\char`\"{}\+:} loads scaling factors values defined in a file. Scaling factors values are updated according to values defined in the file.

Example of control points file\+: \begin{DoxyVerb}parameterName1 1.2
parameterName2 0.85
parameterName3 3
....
\end{DoxyVerb}


{\bfseries Button \char`\"{}\+Appy Scaling\char`\"{}\+:} applies scaling factors values to parameter values. \hypertarget{moduleChildScaling}{}\subsection{Scaling the P\+I\+P\+E\+R child model by age}\label{moduleChildScaling}
This small module is designed to work with the P\+I\+P\+E\+R child model.

It allows to scale the anthropometric dimensions of the P\+I\+P\+E\+R child model between 1.\+5 and 6 Y.\+O. (and beyond but without any check on the performance of the scaled model). The dimensions of the model are derived from G\+E\+B\+O\+D regressions and expanded below 2 Y.\+O. using published Candat data. There are also some controls on the shape of the vertebrae. Note also the option to scale the material properties of the model with age. This option is currently experimental and should not be used prior to additional testing.

The module is straightforward to use\+:
\begin{DoxyItemize}
\item Open the \hyperlink{moduleAnthropometricPersonalization}{Anthropo Module}.
\item Load the P\+I\+P\+E\+R child model that you received together with the P\+I\+P\+E\+R application.
\item Click on \char`\"{}\+P\+I\+P\+E\+R-\/child scaling\char`\"{} in the right menu, the \hyperlink{moduleChildScaling_wrkfl_childScaleGUI}{Child scaling G\+U\+I} will appear.
\item Choose the \char`\"{}\+Child\+\_\+scaling\char`\"{} set of control points in the combobox.
\item Check the \char`\"{}\+Preview\char`\"{} checkbox.
\item Choose the target age using either the slider or the arrows next to the number of months, or move the second slider to select the desired height (in mm). Whenever you set a new target, you should see the red preview of what the model will look like.
\item Click Apply to get the scaled model. {\itshape Note\+: \hyperlink{modulekriging_secKrigingNugget}{Nugget} settings affect this deformation as well}
\end{DoxyItemize}

\label{moduleChildScaling_wrkfl_childScaleGUI}%
\hypertarget{moduleChildScaling_wrkfl_childScaleGUI}{}%

\begin{DoxyImage}
\includegraphics[width=0.8\textwidth]{workflow_childScale_GUI.png}
\caption{Child scaling G\+U\+I}
\end{DoxyImage}


\begin{DoxyRemark}{Remarks}

\begin{DoxyItemize}
\item The scaling is done using the kriging method implemented within piper, but the target control points for this transformation are obtained by using a custom octave script tailored specifically for this model to ensure appropriate behaviour (located in share/octave/\+Child\+Scaling). P\+I\+P\+E\+R only sends a set of input parameters and name of the output file it will expect upon the scripts termination as arguments to the script. Then the script is invoked and afterwards, the output file with control points is loaded into P\+I\+P\+E\+R. This allows simple integration of model specific personalization scripts.
\item For the material scaling, a python script (child\+\_\+scaling\+\_\+parameters.\+py) is used to provide the values of the material parameters which are to be modified by the parameter module .
\item This script was integrated as is for historical reasons but it for a new implementation with another model, it could be preferable to use a single python script to update the model, or to use an anthropometric model. 
\end{DoxyItemize}
\end{DoxyRemark}
