\hypertarget{group__anatomyDB}{}\subsection{Anatomy Database}
\label{group__anatomyDB}\index{Anatomy Database@{Anatomy Database}}


The anatomy\+D\+B library contains knowledge on the human body anatomy.  


The anatomy\+D\+B library contains knowledge on the human body anatomy. 

\begin{DoxyAuthor}{Author}
Thomas Lemaire, Christophe Lecomte 
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
2015
\end{DoxyDate}
\hypertarget{group__anatomyDB_secAnatomyDBData}{}\subsubsection{How the data is managed}\label{group__anatomyDB_secAnatomyDBData}
The following picture presents how the data is organized in the library \+:
\begin{DoxyEnumerate}
\item The My\+C\+F database is query to get the basis of the database (anatomical entities such as bones, group of bones, joints,...). This process is done by the {\ttfamily make\+\_\+entity\+\_\+mycf.\+py} script. The obtain data is stored in the {\ttfamily entity\+\_\+mycf\+\_\+do\+Not\+Edit.\+csv} file.
\item A set of editable {\ttfamily }.csv files contains information that cannot be retrieved from My\+C\+F. This includes synonyms for entity names, anatomical landmarks, anatomical frames,...
\item The {\ttfamily create.\+sql} script is used at compile time to produce the sqlite database file.
\end{DoxyEnumerate}

 \hypertarget{group__anatomyDB_secAnatomyDBQuery}{}\subsubsection{How to query the database}\label{group__anatomyDB_secAnatomyDBQuery}
The core of the anatomy\+D\+B library is a set of functions which wrap S\+Q\+L queries. In addition to the standard C++ library, several wrappers for other target languages are provided.

 \hypertarget{group__anatomyDB_secAnatomyDBPython}{}\paragraph{In Python}\label{group__anatomyDB_secAnatomyDBPython}
\hypertarget{group__anatomyDB_secAnatomyDBOcatve}{}\paragraph{In Octave}\label{group__anatomyDB_secAnatomyDBOcatve}
Octave (\href{http://www.octave.org}{\tt http\+://www.\+octave.\+org}) is an open source alternative to Matlab, and is compatible with it up to a certain level. Anatomy\+D\+B functions can be used in octave as shown below \+:


\begin{DoxyCodeInclude}
% Copyright (C) 2017 INRIA
% This file is part of the PIPER Framework.
% Version: 1.0.0
% 
% The PIPER Framework is free software: you can redistribute it and/or
% modify it under the terms of the GNU Lesser General Public License as
% published by
% the Free Software Foundation, either version 2.1 of the License, or (at
% your option) any later version.
% 
% The PIPER Framework is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
% General Public License \textcolor{keywordflow}{for} more details. You should have received a copy
% of the GNU Lesser General Public License along with the PIPER Framework.
% If not, see <http:\textcolor{comment}{//www.gnu.org/licenses/>.}
% 
% Contributors include Thomas Lemaire (INRIA)
% 
% This work has received funding from the European Union Seventh Framework
% Program ([FP7/2007-2013]) under grant agreement 605544 [PIPER project]).
% 
\textcolor{preprocessor}{# copy bin/anatomyDB.sqlite and lib/anatomyDB.oct from the build tree}
\textcolor{preprocessor}{# start with octave octave\_demo.m}

anatomyDB
anatomyDB.init(\textcolor{stringliteral}{"."}) # anatomyDB install directory
printf \textcolor{stringliteral}{"C1 synonyms:\(\backslash\)n"}
anatomyDB.getSynonymList(\textcolor{stringliteral}{"C1"})
printf \textcolor{stringliteral}{"Bony parts of pelvis:\(\backslash\)n"}
anatomyDB.getSubPartOfList(\textcolor{stringliteral}{"Pelvic\_skeleton"},\textcolor{stringliteral}{"Bone"})
printf \textcolor{stringliteral}{"Right\_anterior\_superior\_iliac\_spine in Kepple1997:\(\backslash\)n"}
anatomyDB.getSynonymFromBibliography(\textcolor{stringliteral}{"Right\_anterior\_superior\_iliac\_spine"}, \textcolor{stringliteral}{"Kepple1997"})
printf \textcolor{stringliteral}{"Landmarks defined in Kepple1997:\(\backslash\)n"}
anatomyDB.getSubClassOfFromBibliographyList(\textcolor{stringliteral}{"Landmark"},\textcolor{stringliteral}{"Kepple1997"})

printf \textcolor{stringliteral}{"Bone frames defined in ISB:\(\backslash\)n"}
anatomyDB.getSubClassOfFromBibliographyList(\textcolor{stringliteral}{"Frame"},\textcolor{stringliteral}{"ISB\_BCS"})

printf \textcolor{stringliteral}{"Fill landmarks coordinates:\(\backslash\)n"}
ff = anatomyDB.FrameFactory\_instance()
printf \textcolor{stringliteral}{"Available frames in factory:\(\backslash\)n"}
ff.registeredFrameList()
ff.landmark().add(\textcolor{stringliteral}{"Head\_center\_of\_left\_humerus"}, [1,2,3])
printf \textcolor{stringliteral}{"Left\_scapula\_glenohumeral frame:\(\backslash\)n"}
ff.computeFrame(\textcolor{stringliteral}{"Left\_scapula\_glenohumeral\_frame"})
printf \textcolor{stringliteral}{"Left\_femur\_hip frame cannot be computed (missing landmarks):\(\backslash\)n"}
ff.computeFrame(\textcolor{stringliteral}{"Left\_femur\_hip\_frame"})

\end{DoxyCodeInclude}


output \+: \begin{DoxyVerb}C1 synonyms:
ans = 
{
  [1,1] = Atlas
  [2,1] = C1
}
Bony parts of pelvis:
ans = 
{
  [1,1] = Coccyx
  [2,1] = Left_hip_bone
  [3,1] = Right_hip_bone
  [4,1] = Sacrum
}
Right_anterior_superior_iliac_spine in Kepple1997:
ans = RASIS
Landmarks defined in Kepple1997:
ans = 
{
  [1,1] = RASIS
  [2,1] = LASIS
  [3,1] = RPSIS
  [4,1] = LPSIS
  [5,1] = RHJCPEL
  [6,1] = LHJCPEL
  [7,1] = RAIIS
  [8,1] = LAIIS
  ...
}
Fill landmarks coordinates:
ff =

{
  FrameFactory, ptr = 0x7f3d62ffbf40
  computeFrame (method)
  instance (static method)
  isFrameRegistered (method)
  landmark (method)
  registeredFrameList (method)
}

Available frames in factory:
ans = 
{
  [1,1] = C1_C2_arch
  [2,1] = C1_Skull
  ...
  [25,1] = Left_calcaneus_ankle
  [26,1] = Left_carpal_radiocarpal
  [27,1] = Left_clavicle_acromioclavicular
  [28,1] = Left_clavicle_sternoclavicular
  ...
  [38,1] = Left_ulna_humeroulnar
  [39,1] = Pelvis_left_hip
  [40,1] = Pelvis_right_hip
  [41,1] = Right_calcaneus_ankle
  [42,1] = Right_carpal_radiocarpal
  [43,1] = Right_clavicle_acromioclavicular
  [44,1] = Right_clavicle_sternoclavicular
  [45,1] = Right_femur_hip
  [46,1] = Right_femur_knee
  [47,1] = Right_humerus_glenohumeral
  [48,1] = Right_humerus_humeroulnar
  [49,1] = Right_radius_radiocarpal
  ...
}
Left_scapula_glenohumeral frame:
ans =

   1
   2
   3
   0
   0
   0
   1

Left_femur_hip frame cannot be computed (missing landmarks):
error: Error while computating frame Left_femur_hip
Unknown landmark: Medial_epicondyle_of_left_femur (Medial_epicondyle_of_left_femur) (SWIG_RuntimeError)
\end{DoxyVerb}
 