Commit 041d68c3 authored by Mark van Turnhout's avatar Mark van Turnhout
Browse files

map bone update documentation

parent fce5af0d
......@@ -62,6 +62,7 @@
\usepackage{svgimport}
\usepackage{transparent}
\usepackage{coffee4}
% tables
\usepackage{tabulary}
\usepackage{multirow}
% language
......@@ -70,7 +71,7 @@
% document specific conventions
\newcommand\gibbon{GIBB\textsl{On}}
\newcommand\gibbon{GIBB\textsl{On}\index{GIBBOn@GIBB\textsl{On}}}
\newcommand\warning{\marginpar{\center\includegraphics[width=1cm]{Exclamation.png}\\}}
\newcommand\adoc{\href{http://furnace.wfw.wtb.tue.nl:2080/v6.14/}{Abaqus documentation}}
% \renewcommand{\thesubsection}{\thesection.\alph{subsection}}
......
......@@ -53,7 +53,7 @@ Extracting and copying MRI (meta) data is done by \bas{MRItoMat}. This function
The actual parsing of raw MRI-data is done by a call to \bas{readMRI}, which in turn calls \bas{readMRImeta} to parse the MRI meta data. Note that MRI data parsing in BasilLab is copied (and slightly adapted) from older scripts that existed long before BasilLab: \texttt{jcampread.m} by B.C.\ Hamans (2003) and Edwin Heijman (update 2005), \texttt{load2seq.m} by Edwin Heijman (July 2005), and \texttt{PV3read.m} by B.J.\ van Nierop (March 2008).\\
\noindent The first argument of \bas{MRItoMat} is a list of \texttt{<basilid>}'s for which to parse and copy the MRI-data. The second argument can be used to skip copying and parsing of data that already exists in \basilhome\texttt{/<basilid>}. When the list of \texttt{<basilid>}'s is omitted, all data defined in \bas{getMeta} is parsed. When the last argument is \texttt{0}, data that is already present in \basilhome\texttt{/<basilid>} is not processed; when it is \texttt{1}, all data present in \basilhome\texttt{/<basilid>} will be overwritten. If \bas{MRItoMat} is called without arguments, all data defined in \bas{getMeta} is parsed and all existing data is overwritten.
\noindent The first argument of \bas{MRItoMat} is a list of \texttt{<basilid>}'s for which to parse and copy the MRI-data. The second argument can be used to skip copying and parsing of data that already exists in \basilhome\texttt{/<basilid>}. When the list of \texttt{<basilid>}'s is omitted, all data defined in \bas{getMeta} is parsed. When the last argument is \texttt{0}, data that is already present in \basilhome\texttt{/<basilid>} is not processed; when it is \texttt{1}, all data present in \basilhome\texttt{/<basilid>} will be overwritten. If \bas{MRItoMat} is called without arguments, all data defined in \bas{getMeta} is parsed and all existing data is overwritten.
To process the data for \texttt{<basilid> = 140611} and \texttt{<basilid> = 140613} and skip processing of data that is already present in \basilhome\texttt{/<basilid>}, call:
\begin{lstlisting}[numbers=none]
......@@ -63,7 +63,7 @@ To process the data for \texttt{<basilid> = 140611} and \texttt{<basilid> = 1406
The output of \bas{MRItoMat} consists of the files listed in table \ref{mritomatout}. These files are written to \basilhome\texttt{/<basilid>} as explained before. The bold entries are actually needed by BasilLab to prepare the model data. The other (meta) data is written for your convenience and backward compatibility.
\begin{table}[p!]
\center
\caption{Output of \bas{MRItoMat}: \texttt{`\_preload'} is from the scans before indentation, \texttt{`\_loading'} is from the scans during indentation, and \texttt{`\_postload'} is from the scans after removal of the indentation; \texttt{`\_flash'} is from the flash scans. \textbf{Bold} entries are \textbf{required} to prepare model data, \textsl{slanted} entries are used for parameters that should facilitate post-processing of the FE data.}\label{mritomatout}
\caption{Output of \bas{MRItoMat}: \texttt{`\_preload'} is from the scans before indentation, \texttt{`\_loading'} is from the scans during indentation, and \texttt{`\_postload'} is from the scans after removal of the indentation; \texttt{`\_flash'} is from the flash scans. \textbf{Bold} entries are \textbf{required} to prepare model data, \textsl{slanted} entries are used for parameters that should facilitate \textsl{post-processing} of the FE data.}\label{mritomatout}
\begin{tabulary}{\linewidth}{l R}
\hline\noalign{\smallskip}
file in \basilhome\texttt{/<basilid>/}& description\\
......@@ -115,13 +115,73 @@ file in \basilhome\texttt{/<basilid>/}& description\\
\subsection{Segment MRI-data}
We need to segment five contours in the MR images (table \ref{contours}): skin contours in de scans before and during indentation, and bone contours in the scans before, during and after indentation.
\begin{table}[t!]
\center
\caption{Contours that need to be segmented in the MRI-data}\label{contours}
\begin{tabulary}{\linewidth}{l c R l}
\hline\noalign{\smallskip}
contour & scans & purpose & section \\
\noalign{\smallskip}\hline\noalign{\smallskip}
\multirow{2}*{skin} & before indentation & geometry for the FEM & \ref{buildmodel}\\
& during indentation & determine end-point of the indenter, boundary condition for the FEM & \ref{mapind}\\ \hline\noalign{\smallskip}
\multirow{3}*{bone} & before indentation & geometry for the FEM & \ref{buildmodel}\\
& during indentation & determine tibia movement as a result of the application of indentation, boundary condition for the FEM & \ref{mapbone}\\
& after indentation & determine tibia movement as a result of the release of indentation, used in post-processing of the results of the FEM & \ref{mapbone}\\
\noalign{\smallskip}\hline
\end{tabulary}
\end{table}
For the segmentation of the MR image data we rely on the \gibbon{}-function \texttt{uiContourSegment}. This function requires a (3D) `mask' to go with the 3D MR voxel data that is to be segmented. The mask should have the same size as the voxel data, and can change between (2D) MRI-slices.
BasilLab is very lazy on the masking part.
The function \bas{maskBG}{} loads the voxel set that you wish to segment and shows a maximum intensity projection over the $z$-direction. In this image, you are asked to interactively select the centre and radius of a circle. The circle will serve as the basis of a cylinder-shaped 3D `mask' for \texttt{uiContourSegment}. \bas{maskBG}{} does not make separate mask for skin and bone.
The mask for \basilhome\texttt{/<basilid>/}\texttt{MRI\_slices\_<foo>.mat}\footnote{\texttt{<foo>} can be \texttt{preload} or \texttt{loading} or \texttt{postload} or \texttt{flash} (see table \ref{mritomatout}.}will be saved as \basilhome\texttt{/}\-\texttt{<basilid>}\-\texttt{/MRI\_BG\_<foo>.mat}. To mask the data in the scans before (\texttt{1}), during (\texttt{2}) and after indentation (\texttt{3}) for \texttt{<basilid> = 140611} call:
\begin{lstlisting}[numbers=none]
>> bas_maskBG(140611, [1 2 3]);
\end{lstlisting}
\noindent With the masks, we can call \bas{segmentMRI} which in turn calls \gibbon{} for the actual segmentation. The output of \texttt{uiContourSegment} is a Matlab structure called \texttt{Vcs} that contains a cell with contour points $(x, y,z)$ for each 2D MRI-slice. \bas{segmentMRI} saves this structure `as is'. The \texttt{Vcs}-structure for the skin in \basilhome\texttt{/<basilid>/}\texttt{MRI\_slices\_<foo>.mat} will be saved as \basilhome\texttt{/<basilid>/}\texttt{contour\_skin\_<foo>.mat}, that of the tibia as \basilhome\texttt{/<basilid>}\-\texttt{/contour\_bone\_<foo>.mat}.
Note that \bas{segmentMRI} loaded \basilhome\texttt{/<basilid>/}\texttt{MRI\_voxel\_<foo>.txt} in the process. The dimensions of the saved contours are in mm. To segment the skin and bone data in the scans before (\texttt{1,2}), during (\texttt{3,4}), and the bone contour after indentation (\texttt{6}) for \texttt{<basilid> = 140611} call:
\begin{lstlisting}[numbers=none]
>> bas_segmentMRI(140611, [1:4, 6]);
\end{lstlisting}
\noindent Finally, we need to check for missing contours in de segmented data. The \texttt{Vcs}-structure of \texttt{uiContourSegment} may contain empty cells, and missing contour data may mess op BasilLab and post-processing. The function \bas{checkVsize} loads five contour-sets \texttt{contour\_skin\_preload.mat}, \texttt{contour\_skin\_loading.mat}, \texttt{contour\_bone\_preload.mat}, \texttt{contour\_bone\_loading.mat}, and \texttt{contour\_bone\_postload.mat} from \basilhome\texttt{/<basilid>/}, and deletes a contour that is missing from \textsl{any} set from \textsl{all} sets.
The (new) contour sets are saved with \texttt{-ncc} appended to their file name, i.e.\ the corrected set for \texttt{contour\_skin\_preload.mat} will be saved as \texttt{contour\_skin\_preload-ncc.mat}. The original data will remain untouched. To post-process the contours for \texttt{<basilid> = 140611} and \texttt{<basilid> = 140613} call:
\begin{lstlisting}[numbers=none]
>> bas_checkVsize([140611, 140613]);
\end{lstlisting}
\subsection{Map bone movement}\label{mapbone}
The next step is to map the displacement and rotation of the tibia as a result of the application and release of the indentation. The movement of the tibia as a result of the indentation is modelled in the FEM in the loading phase and is therefore needed for its boundary conditions. The movement of the tibia as a result of the release of the indentation is used in post-processing of the FEM output.
The function \bas{mapBone} uses the segmented contours \texttt{contour\_bone\_<foo>-ncc.mat} to map the movement and displacement of the tibia in the \texttt{loading}-contours and in the \texttt{postload}-contours, both with the \texttt{preload}-contours as reference.
The output of \bas{mapBone}{} consists of a $3\times 3$ matrix for each of the two cases. The first row contains the centre of mass $(x,y,z)$ of the tibia contours (in mm) in the \texttt{preload}-contours, and the second row contains the centre of mass $(x,y,z)$ of the tibia contours in the \texttt{loading}- or \texttt{postload}-contours. The third row contains three `Euler angles' $(\alpha, \beta, \gamma)$ that describe the rotation of the tibia around its centre of mass.
These Euler angles follow the \gibbon-convention (see \texttt{euler2DCM.m}): $\alpha$ is the rotation around the $x$-axis, $\beta$ the rotation around the $y$-axis, and $\gamma$ the rotation around the $z$-axis, such that the 3D rotation matrix is given by:
\begin{equation}
\mat{R}_{\alpha\beta\gamma} = \mat{R}_\alpha\cdot\mat{R}_\beta \cdot \mat{R}_\gamma
\end{equation}
This kind of angle multiplication is not commutative. Abaqus uses a different definition for Euler angles. These three Euler angles from \gibbon{} can not be directly used in Abaqus. It will wreak havoc.
The $3\times 3$ matrix (centres of mass, Euler angles) is written to \texttt{Bone\_preload\_loading.txt} or \texttt{Bone\_preload\_postload.txt}, depending on the case, in \basilhome\texttt{/<basilid>/}. To map the tibia movements for \texttt{<basilid> = 140611} and \texttt{<basilid> = 140613} call:
\begin{lstlisting}[numbers=none]
>> bas_mapBone([140611, 140613]);
\end{lstlisting}
\subsection{Map bone movement}
\subsection{Map indenter movement}\label{mapind}
\subsection{Map indenter movement}
\subsection{\bas{prepFEM}}
\section{Building the FE model}
\section{Building the FE model}\label{buildmodel}
\section{Running the FE model}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment