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

update MRItoMat to work with <basilhome>

parent ff224692
......@@ -35,7 +35,7 @@ if nargin < 2, overwrite = 1; end
if nargin < 1, basil = bas_getMeta(0); basil = basil(:,1); end
bruker = bas_getMRIroot;
if ~exist(bruker,'dir'), bruker = uigetdir('~'); end
basilhome = bas_getDataRoot;
savenames = {''; '_preload'; '_loading'; '_postload'; '_flash'};
......@@ -46,7 +46,7 @@ for d = 1:numel(basil)
if ~exist(num2str(scans(b,1)),'dir'), mkdir(num2str(scans(b,1))); end
for s = 2:size(scans,2)
if (~exist( fullfile(pwd,num2str(scans(b,1)),savenames{s},'.mat'),'file') ...
if (~exist( fullfile(basilhome,num2str(scans(b,1)),savenames{s},'.mat'),'file') ...
|| overwrite == 1) && scans(b,s) > 0
% fullfile(bruker,paths(b),scans(b,s))
[data, subject, acqp, meth, imnd, reco, d3proc, visupars] = ...
......@@ -85,39 +85,39 @@ for d = 1:numel(basil)
end
slices = Info.ImageReco{1}; %#ok<NASGU>
save(fullfile(num2str(scans(b,1)),strcat('IMDAT',savenames{s},'.mat')),'Info'); % for backward compatibility
save(fullfile(num2str(scans(b,1)),strcat('MRI_slices',savenames{s},'.mat')),'slices');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('IMDAT',savenames{s},'.mat')),'Info'); % for backward compatibility
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_slices',savenames{s},'.mat')),'slices');
if isstruct(subject)
save(fullfile(num2str(scans(b,1)),strcat('MRI_subject',savenames{s},'.mat')),'subject');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_subject',savenames{s},'.mat')),'subject');
end
if isstruct(acqp)
save(fullfile(num2str(scans(b,1)),strcat('MRI_acqp',savenames{s},'.mat')),'acqp');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_acqp',savenames{s},'.mat')),'acqp');
end
if isstruct(meth)
save(fullfile(num2str(scans(b,1)),strcat('MRI_method',savenames{s},'.mat')),'meth');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_method',savenames{s},'.mat')),'meth');
end
if isstruct(imnd)
save(fullfile(num2str(scans(b,1)),strcat('MRI_imnd',savenames{s},'.mat')),'imnd');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_imnd',savenames{s},'.mat')),'imnd');
end
if isstruct(reco)
save(fullfile(num2str(scans(b,1)),strcat('MRI_reco',savenames{s},'.mat')),'reco');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_reco',savenames{s},'.mat')),'reco');
end
if isstruct(d3proc)
save(fullfile(num2str(scans(b,1)),strcat('MRI_d3proc',savenames{s},'.mat')),'d3proc');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_d3proc',savenames{s},'.mat')),'d3proc');
end
if isstruct(visupars)
save(fullfile(num2str(scans(b,1)),strcat('MRI_visupars',savenames{s},'.mat')),'visupars');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_visupars',savenames{s},'.mat')),'visupars');
end
save(fullfile(num2str(scans(b,1)),strcat('MRI_voxel',savenames{s},'.txt')),'voxel', '-ascii');
save(fullfile(basilhome,num2str(scans(b,1)),strcat('MRI_voxel',savenames{s},'.txt')),'voxel', '-ascii');
end
......
......@@ -38,8 +38,25 @@ Similarly, \basilhome{} is defined in \bas{getDataRoot} and updated with \bas{se
\section{Pre-processing of MRI-data}
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 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
\end{enumerate}
Only step 2. requires user interaction, the rest is performed 'under the hood', automagically.
\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.
\subsection{Segment MRI-data}
\subsection{Map bone movement}
\subsection{Map indenter movement}
\section{Building 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