⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 avw_view3.html

📁 mri_toolbox是一个工具用来MRI. 来自于SourceForge, 我上传这个软件,希望能结识对医疗软件感兴趣的兄弟.
💻 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 avw_view3</title>  <meta name="keywords" content="avw_view3">  <meta name="description" content="AVW_VIEW3 - Create slices of Analyze file and overlay surface vertices">  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  <meta name="generator" content="m2html &copy; 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> &gt;  <a href="index.html">mri_toolbox</a> &gt; avw_view3.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td><td align="right"><a href="index.html">Index for mri_toolbox&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>avw_view3</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>AVW_VIEW3 - Create slices of Analyze file and overlay surface vertices</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 avw_view3(avw,FV), </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"> AVW_VIEW3 - Create slices of Analyze file and overlay surface vertices
 
 avw_view3(avw,FV)
 
 avw - a struct, created by avw_img_read
 FV  - a surface struct with fields FV.vertices, FV.faces
 
 This provides a transparent 3D view of ortho slices, to
 provide a platform for overlay of mesh/tesselation vertices,
 given in FV.</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)"></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 avw_view3(avw,FV),</a>0002 0003 <span class="comment">% AVW_VIEW3 - Create slices of Analyze file and overlay surface vertices</span>0004 <span class="comment">%</span>0005 <span class="comment">% avw_view3(avw,FV)</span>0006 <span class="comment">%</span>0007 <span class="comment">% avw - a struct, created by avw_img_read</span>0008 <span class="comment">% FV  - a surface struct with fields FV.vertices, FV.faces</span>0009 <span class="comment">%</span>0010 <span class="comment">% This provides a transparent 3D view of ortho slices, to</span>0011 <span class="comment">% provide a platform for overlay of mesh/tesselation vertices,</span>0012 <span class="comment">% given in FV.</span>0013 <span class="comment">%</span>0014 0015 <span class="comment">% $Revision: 1.6 $ $Date: 2004/02/07 01:41:51 $</span>0016 0017 <span class="comment">% Licence:  GNU GPL, no express or implied warranties</span>0018 <span class="comment">% History:  08/2002, Darren.Weber@flinders.edu.au</span>0019 <span class="comment">%</span>0020 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0021 0022 0023 <span class="keyword">if</span> ~exist(<span class="string">'avw'</span>,<span class="string">'var'</span>),0024     msg = sprintf(<span class="string">'AVW_VIEW3: No input avw - see help avw_view\n'</span>);0025     error(msg);0026 <span class="keyword">end</span>0027 <span class="keyword">if</span> ~exist(<span class="string">'FV'</span>,<span class="string">'var'</span>),0028     FV.vertices = [];0029 <span class="keyword">end</span>0030 0031 0032 <span class="comment">% GUI General Parameters</span>0033 GUIwidth  = 150;0034 GUIheight = 50;0035 0036 name = <span class="string">'AVW View 3D'</span>;0037 <span class="keyword">if</span> isfield(avw,<span class="string">'fileprefix'</span>),0038     <span class="keyword">if</span> ~isempty(avw.fileprefix),0039         format = strcat(<span class="string">'%+'</span>,sprintf(<span class="string">'%d'</span>,length(avw.fileprefix)+1),<span class="string">'s'</span>);0040         name = strcat(<span class="string">'AVW View 3D - '</span>,sprintf(format,avw.fileprefix));0041     <span class="keyword">end</span>0042 <span class="keyword">end</span>0043 0044 GUI = figure(<span class="string">'Name'</span>,name,<span class="string">'Tag'</span>,<span class="string">'AVWVIEW3'</span>,<span class="string">'units'</span>,<span class="string">'characters'</span>,<span class="keyword">...</span>0045              <span class="string">'NumberTitle'</span>,<span class="string">'off'</span>,<span class="keyword">...</span>0046              <span class="string">'MenuBar'</span>,<span class="string">'figure'</span>,<span class="string">'Position'</span>,[1 1 GUIwidth GUIheight]);0047 movegui(GUI,<span class="string">'center'</span>);0048 0049 AVWVIEW3.gui = GUI;0050 0051 0052 Font.FontName   = <span class="string">'Helvetica'</span>;0053 Font.FontUnits  = <span class="string">'Pixels'</span>;0054 Font.FontSize   = 12;0055 Font.FontWeight = <span class="string">'normal'</span>;0056 Font.FontAngle  = <span class="string">'normal'</span>;0057 0058 0059 shading flat0060 0061 xdim = size(avw.img,1);0062 ydim = size(avw.img,2);0063 zdim = size(avw.img,3);0064 0065 SagSlice = 1;0066 CorSlice = 1;0067 AxiSlice = 1;0068 <span class="keyword">if</span> xdim &gt; 1, SagSlice = floor(xdim/2); <span class="keyword">end</span>0069 <span class="keyword">if</span> ydim &gt; 1, CorSlice = floor(ydim/2); <span class="keyword">end</span>0070 <span class="keyword">if</span> zdim &gt; 1, AxiSlice = floor(zdim/2); <span class="keyword">end</span>0071 0072 0073 <span class="comment">% data aspect should be proportional to image dimensions</span>0074 <span class="comment">% Should check header for these values</span>0075 0076 0077 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0078 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0079 0080 <span class="comment">% The slice command swaps x/y axes - really annoying!</span>0081 G.H = slice(avw.img,SagSlice,CorSlice,AxiSlice,<span class="string">'nearest'</span>);0082 set(G.H,<span class="string">'edgecolor'</span>,<span class="string">'none'</span>,<span class="string">'facealpha'</span>,.7);0083 axis tight, daspect([1,1,1]);0084 colormap(<span class="string">'gray'</span>);0085 xlabel(<span class="string">'Coronal'</span>)0086 ylabel(<span class="string">'Sagittal'</span>)0087 zlabel(<span class="string">'Axial'</span>)0088 view(3)0089 0090 <span class="comment">%axis off</span>0091 0092 <span class="comment">% Overlay plot of surface vertices</span>0093 <span class="keyword">if</span> ~isempty(FV.vertices),0094     hold on;0095     <span class="comment">% The above slice command swaps x/y axes, so we have to</span>0096     <span class="comment">% mess around here to get the vertices in the right place</span>0097     0098     <span class="comment">% rotate the vertices -90 degrees around Z</span>0099     FV.vertices = Rz(FV.vertices,-90,<span class="string">'degrees'</span>);0100     <span class="comment">% Now move vertices from axis origin to the true MRI volume center</span>0101     FV.vertices(:,1) = FV.vertices(:,1) + SagSlice;0102     FV.vertices(:,2) = FV.vertices(:,2) + CorSlice;0103     FV.vertices(:,3) = FV.vertices(:,3) + AxiSlice;0104     <span class="comment">% Now shift it according to the x/y flip</span>0105     FV.vertices(:,1) = FV.vertices(:,1) - (SagSlice - CorSlice);0106     FV.vertices(:,2) = FV.vertices(:,2) - (CorSlice - SagSlice);0107     0108     <span class="comment">%plot3(FV.vertices(:,1),FV.vertices(:,2),FV.vertices(:,3),'r.');</span>0109     patch(<span class="string">'vertices'</span>,FV.vertices,<span class="string">'faces'</span>,FV.faces,<span class="keyword">...</span>0110           <span class="string">'FaceColor'</span>,[0.0 0.0 0.2],<span class="string">'Edgecolor'</span>,<span class="string">'none'</span>,<span class="keyword">...</span>0111           <span class="string">'FaceAlpha'</span>,0.5);0112 <span class="keyword">end</span>0113 0114 rotate3d;0115 0116 0117 0118 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0119 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0120 0121 <span class="comment">% Intensity Value at Mouse Click</span>0122 0123 <span class="comment">%G.Timval = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...</span>0124 <span class="comment">%    'Position',[.05 .90 .20 .05], 'HorizontalAlignment', 'center',...</span>0125 <span class="comment">%    'BusyAction','queue',...</span>0126 <span class="comment">%    'String','Image Intensity');</span>0127 <span class="comment">%G.imval = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...</span>0128 <span class="comment">%    'Position',[.25 .90 .10 .05], 'HorizontalAlignment', 'right',...</span>0129 <span class="comment">%    'BusyAction','queue',...</span>0130 <span class="comment">%    'String','?');</span>0131 0132 0133 0134 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0135 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0136 0137 Font.FontWeight = <span class="string">'bold'</span>;0138 0139 <span class="comment">% OK: Return the avw!</span>0140 G.Bhdr = uicontrol(<span class="string">'Parent'</span>,GUI,<span class="string">'Style'</span>,<span class="string">'pushbutton'</span>,<span class="string">'Units'</span>,<span class="string">'Normalized'</span>, Font, <span class="keyword">...</span>0141     <span class="string">'Position'</span>,[.8 .95 .08 .04],<span class="keyword">...</span>0142     <span class="string">'String'</span>,<span class="string">'HDR'</span>,<span class="string">'BusyAction'</span>,<span class="string">'queue'</span>,<span class="keyword">...</span>0143     <span class="string">'TooltipString'</span>,<span class="string">'View the hdr parameters.'</span>,<span class="keyword">...</span>0144     <span class="string">'BackgroundColor'</span>,[0.0 0.0 0.5],<span class="keyword">...</span>0145     <span class="string">'ForegroundColor'</span>,[1 1 1], <span class="string">'HorizontalAlignment'</span>, <span class="string">'center'</span>,<span class="keyword">...</span>0146     <span class="string">'Callback'</span>,strcat(<span class="string">'AVWVIEW3 = get(gcbf,''Userdata''); '</span>,<span class="keyword">...</span>0147     <span class="string">'avw_view_hdr(AVWVIEW3.avw);'</span>,<span class="keyword">...</span>0148     <span class="string">'clear AVWVIEW3;'</span>));0149 0150 <span class="comment">% Cancel</span>0151 G.Bquit = uicontrol(<span class="string">'Parent'</span>,GUI,<span class="string">'Style'</span>,<span class="string">'pushbutton'</span>,<span class="string">'Units'</span>,<span class="string">'Normalized'</span>, Font, <span class="keyword">...</span>0152     <span class="string">'Position'</span>,[.9 .95 .08 .04],<span class="keyword">...</span>0153     <span class="string">'String'</span>,<span class="string">'CLOSE'</span>,<span class="string">'BusyAction'</span>,<span class="string">'queue'</span>,<span class="keyword">...</span>0154     <span class="string">'BackgroundColor'</span>,[0.75 0.0 0.0],<span class="keyword">...</span>0155     <span class="string">'ForegroundColor'</span>, [1 1 1], <span class="string">'HorizontalAlignment'</span>, <span class="string">'center'</span>,<span class="keyword">...</span>0156     <span class="string">'Callback'</span>,<span class="string">'close gcbf;'</span>);0157 0158 0159 <span class="comment">% Update the gui_struct handles for this gui</span>0160 AVWVIEW3.avw = avw;0161 AVWVIEW3.FV = FV;0162 AVWVIEW3.handles = G;0163 set(AVWVIEW3.gui,<span class="string">'Userdata'</span>,AVWVIEW3);0164 <span class="comment">%set(AVWVIEW3.gui,'HandleVisibility','callback');</span>0165 0166 <span class="keyword">return</span>0167</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> &copy; 2003</address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -