📄 avw2brainstorm.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <title>Description of avw2brainstorm</title> <meta name="keywords" content="avw2brainstorm"> <meta name="description" content="avw2brainstorm - Convert Analyze struct into BrainStorm file"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="generator" content="m2html © 2003 Guillaume Flandin"> <meta name="robots" content="index, follow"> <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> > <a href="index.html">mri_toolbox</a> > avw2brainstorm.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td><td align="right"><a href="index.html">Index for mri_toolbox <img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>avw2brainstorm</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>avw2brainstorm - Convert Analyze struct into BrainStorm file</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function avw2brainstorm(avw,Segment,Scalp,PCS,Comment) </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment"> avw2brainstorm - Convert Analyze struct into BrainStorm file
avw2brainstorm(avw,[segment],[scalp],[PCS],[comment])
This function saves a brainstorm file with a name that combines
avw.fileprefix with _subjectimage.mat - for example, if
avw.fileprefix is set to 'subject01', this function will
output a brainstorm MRI file, in the current working
directory, called 'subject01_subjectimage.mat'
avw - Analyze data loaded by avw_img_read.
segment - a sparse 3D matrix the same size as avw.img, with
zeros (not brain) and other integer flags to indicate
different tissue types (as yet unknown values!)
scalp - an Nx3 series of vertex points on the scalp, with
coordinates in the Patient Coordinate System (PCS).
PCS - a struct with the fields described below
comment - a char array describing the image
PCS contains the following fields:
PCS.R % [3x3 double] rotations from PCS to MRI
PCS.t % [3x1 double] translations from PCS to MRI
PCS.Comment % a char array describing the PCS
% orientation (always 'Neuromag 122' here)
PCS.PCSFiducial % [3x4 double] of electrode fiducials
PCS.CubeFiducial % [3x4 double] of MRI fiducials
PCS.FiducialName = {'Nasion' 'LeftEar' 'RightEar' 'Origin'};
see also <a href="avw_view.html" class="code" title="function [ varargout ] = avw_view(avw,parent,command),">AVW_VIEW</a> & ELEC_COREGISTER to obtain fiducials and calculate T, where PCS.R = T(1:3;1:3) and PCS.t = T(4,1:3). See http://neuroimage.usc.edu/ for more information about brainstorm, including a download PDF of the file formats.</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"><li><a href="convert_mri2brainstorm.html" class="code" title="">convert_mri2brainstorm</a> Script to convert freesurfer analyze files into brainstorm format</li></ul><!-- crossreference --><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function avw2brainstorm(avw,Segment,Scalp,PCS,Comment)</a>0002 0003 <span class="comment">% avw2brainstorm - Convert Analyze struct into BrainStorm file</span>0004 <span class="comment">%</span>0005 <span class="comment">% avw2brainstorm(avw,[segment],[scalp],[PCS],[comment])</span>0006 <span class="comment">%</span>0007 <span class="comment">% This function saves a brainstorm file with a name that combines</span>0008 <span class="comment">% avw.fileprefix with _subjectimage.mat - for example, if</span>0009 <span class="comment">% avw.fileprefix is set to 'subject01', this function will</span>0010 <span class="comment">% output a brainstorm MRI file, in the current working</span>0011 <span class="comment">% directory, called 'subject01_subjectimage.mat'</span>0012 <span class="comment">%</span>0013 <span class="comment">% avw - Analyze data loaded by avw_img_read.</span>0014 <span class="comment">% segment - a sparse 3D matrix the same size as avw.img, with</span>0015 <span class="comment">% zeros (not brain) and other integer flags to indicate</span>0016 <span class="comment">% different tissue types (as yet unknown values!)</span>0017 <span class="comment">% scalp - an Nx3 series of vertex points on the scalp, with</span>0018 <span class="comment">% coordinates in the Patient Coordinate System (PCS).</span>0019 <span class="comment">% PCS - a struct with the fields described below</span>0020 <span class="comment">% comment - a char array describing the image</span>0021 <span class="comment">%</span>0022 <span class="comment">% PCS contains the following fields:</span>0023 <span class="comment">%</span>0024 <span class="comment">% PCS.R % [3x3 double] rotations from PCS to MRI</span>0025 <span class="comment">% PCS.t % [3x1 double] translations from PCS to MRI</span>0026 <span class="comment">% PCS.Comment % a char array describing the PCS</span>0027 <span class="comment">% % orientation (always 'Neuromag 122' here)</span>0028 <span class="comment">% PCS.PCSFiducial % [3x4 double] of electrode fiducials</span>0029 <span class="comment">% PCS.CubeFiducial % [3x4 double] of MRI fiducials</span>0030 <span class="comment">% PCS.FiducialName = {'Nasion' 'LeftEar' 'RightEar' 'Origin'};</span>0031 <span class="comment">%</span>0032 <span class="comment">% see also AVW_VIEW & ELEC_COREGISTER to obtain fiducials and</span>0033 <span class="comment">% calculate T, where PCS.R = T(1:3;1:3) and PCS.t = T(4,1:3).</span>0034 <span class="comment">%</span>0035 <span class="comment">% See http://neuroimage.usc.edu/ for more information about</span>0036 <span class="comment">% brainstorm, including a download PDF of the file formats.</span>0037 <span class="comment">%</span>0038 0039 <span class="comment">% $Revision: 1.6 $ $Date: 2004/02/07 01:41:51 $</span>0040 0041 <span class="comment">% Licence: GNU GPL, no express or implied warranties</span>0042 <span class="comment">% Author: 10/2002, Darren.Weber@flinders.edu.au</span>0043 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0044 0045 fprintf(<span class="string">'AVW2BRAINSTORM...\n'</span>); tic0046 0047 <span class="keyword">if</span> ~exist(<span class="string">'avw'</span>,<span class="string">'var'</span>),0048 msg = sprintf(<span class="string">'...no input avw - see help avw2brainstorm\n'</span>);0049 error(msg);0050 <span class="keyword">end</span>0051 0052 fprintf(<span class="string">'...converting avw to brainstorm variables\n'</span>);0053 0054 Cube = uint8(avw.img);0055 0056 Voxsize = double(avw.hdr.dime.pixdim(2:4));0057 0058 <span class="keyword">if</span> ~exist(<span class="string">'Comment'</span>,<span class="string">'var'</span>),0059 <span class="keyword">if</span> isfield(avw,<span class="string">'fileprefix'</span>),0060 Comment = avw.fileprefix;0061 <span class="keyword">else</span>0062 Comment = <span class="string">''</span>;0063 <span class="keyword">end</span>0064 <span class="keyword">end</span>0065 0066 <span class="keyword">if</span> ~exist(<span class="string">'Segment'</span>,<span class="string">'var'</span>), Segment = []; <span class="keyword">end</span>0067 0068 <span class="keyword">if</span> ~exist(<span class="string">'Scalp'</span>,<span class="string">'var'</span>), Scalp = []; <span class="keyword">end</span>0069 0070 <span class="keyword">if</span> ~exist(<span class="string">'PCS'</span>,<span class="string">'var'</span>),0071 PCS.R = eye(3); <span class="comment">% [3x3 double] rotations</span>0072 PCS.t = zeros(3,1); <span class="comment">% [3x1 double] translations</span>0073 PCS.Comment = <span class="string">'Neuromag 122'</span>;0074 PCS.PCSFiducial = []; <span class="comment">% [3x4 double]</span>0075 PCS.CubeFiducial = []; <span class="comment">% [3x4 double]</span>0076 PCS.FiducialName = {<span class="string">'Nasion'</span> <span class="string">'LeftEar'</span> <span class="string">'RightEar'</span> <span class="string">'Origin'</span>};0077 <span class="keyword">else</span>0078 PCS.Comment = <span class="string">'Neuromag 122'</span>;0079 <span class="keyword">end</span>0080 0081 savename = sprintf(<span class="string">'%s_subjectimage.mat'</span>,avw.fileprefix);0082 0083 fprintf(<span class="string">'...saving brainstorm variables to %s\n'</span>, savename);0084 0085 save(savename,<span class="string">'Cube'</span>,<span class="string">'Voxsize'</span>,<span class="string">'Comment'</span>,<span class="string">'Segment'</span>,<span class="string">'Scalp'</span>,<span class="string">'PCS'</span>);0086 0087 t=toc; fprintf(<span class="string">'...done (%5.2f sec).\n\n'</span>,t);0088 0089 <span class="keyword">return</span></pre></div><hr><address>Generated on Fri 21-May-2004 12:38:21 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -