Commit c3647020 authored by Mark van Turnhout's avatar Mark van Turnhout
Browse files

MRItoMat in documentation

parent fb0f9427
......@@ -43,7 +43,7 @@ savenames = {''; '_preload'; '_loading'; '_postload'; '_flash'};
for d = 1:numel(basil)
[scans, paths] = bas_getMeta(basil(d));
for b = 1:size(scans,1)
if ~exist(num2str(scans(b,1)),'dir'), mkdir(num2str(scans(b,1))); end
if ~exist(basilhome,num2str(scans(b,1)),'dir'), mkdir(basilhome,num2str(scans(b,1))); end
for s = 2:size(scans,2)
if (~exist( fullfile(basilhome,num2str(scans(b,1)),savenames{s},'.mat'),'file') ...
......
......@@ -31,7 +31,7 @@ As a matter of principle and for philosophical reasons, BasilLab leaves the raw
\noindent \MRIroot{} is defined (hard-coded) in \bas{getMRIroot}. This script is called by BasilLab when it needs to know the path to the \MRIroot{}-folder. You can edit this script manually, or you can use \bas{setMRIroot} to update this script to your local situation. When you call \bas{setMRIroot}, the \bas{getMRIroot}-script is overwritten with a new version that provides the \MRIroot{} that you provided as an argument to \bas{setMRIroot}.
Similarly, \basilhome{} is defined in \bas{getDataRoot} and updated with \bas{setDataRoot}. The argument for \bas{setDataRoot} or \bas{setMRIroot} is the \textsl{full} path to the folder that you wish to define, e.g.:
\begin{lstlisting}
\begin{lstlisting}[numbers=none]
>> bas_setMRIroot('/home/mark/BrukerData');
>> bas_setDataRoot(pwd);
\end{lstlisting}
......@@ -40,7 +40,7 @@ Similarly, \basilhome{} is defined in \bas{getDataRoot} and updated with \bas{se
All steps that are required to prepare the model data can be performed with \bas{prepFEM}. Briefly, these steps are
\begin{enumerate}
\item Copy MRI-data from \MRIroot{}\texttt{/experiment-folder} to \basilhome\texttt{/<basilid>}
\item Copy MRI-data from \MRIroot{}\texttt{/<experiment-folder>} to \basilhome\texttt{/<basilid>}
\item Segment MRI-data to obtain skin- and bone contours
\item Determine bone movement and rotation due to indentation from segmented bone contours
\item Determine indenter orientation and displacements from MRI-data
......@@ -49,7 +49,38 @@ Only step 2. requires user interaction, the rest is performed 'under the hood',
\subsection{Copying MRI data}
Extracting and copying MRI (meta) data is done by \bas{MRItoMat}. This function calls \bas{getMRIroot} for the path to the raw MRI-data, \bas{getDataRoot} for the path to the BasilLab work directory, and \bas{getMeta} for the experiment specific sub-folders within these two directories.
Extracting and copying MRI (meta) data is done by \bas{MRItoMat}. This function calls a number of other functions: \bas{getMRIroot} for the path to the raw MRI-data, \bas{getDataRoot} for the path to the BasilLab work directory, and \bas{getMeta} for the experiment specific sub-folders within these two directories. \bas{getMeta} also provides information on the scans that are to be processed in the raw MRI-data.
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.
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]
>> bas_MRItoMat([140611, 140613], 0);
\end{lstlisting}
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}[t!]
\center
\caption{Output of \bas{MRItoMat}. Bold entries are required to prepare model data.}\label{mritomatout}
\begin{tabulary}{\linewidth}{l R}
\hline\noalign{\smallskip}
file & description\\
\noalign{\smallskip}\hline\noalign{\bigskip}
\texttt{<basilhome>/<basilid>/MRI\_slices.mat} & \textbf{3D matrix with MRI-slice voxel values} \\
\texttt{<basilhome>/<basilid>/IMDAT.mat} & as \texttt{MRI\_slices.mat} \\
\texttt{<basilhome>/<basilid>/MRI\_subject.mat} & `subject' from MRI meta data \\
\texttt{<basilhome>/<basilid>/MRI\_acqp.mat} & `acqp' from MRI meta data\\
\texttt{<basilhome>/<basilid>/MRI\_method.mat} & `method' from MRI meta data\\
\texttt{<basilhome>/<basilid>/MRI\_imnd.mat} & `imnd' from MRI meta data \\
\texttt{<basilhome>/<basilid>/MRI\_reco.mat} & `reco' from MRI meta data \\
\texttt{<basilhome>/<basilid>/MRI\_d3proc.mat} & `d3proc' from MRI meta data \\
\texttt{<basilhome>/<basilid>/MRI\_visupars.mat} & `visupars' from MRI meta data \\
\texttt{<basilhome>/<basilid>/MRI\_voxel.txt} & \textbf{row with the voxel sizes in $[x y z]$ in mm from MRI meta data}\\
\noalign{\smallskip}\hline
\end{tabulary}
\end{table}
\subsection{Segment MRI-data}
......
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