📄 avw_view_new.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_view_new</title>
<meta name="keywords" content="avw_view_new">
<meta name="description" content="avw_view - create and navigate ortho views of Analyze 7.5 volume">
<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> > avw_view_new.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>avw_view_new
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>avw_view - create and navigate ortho views of Analyze 7.5 volume</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 [ varargout ] = avw_view(avw,parent,command), </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_view - create and navigate ortho views of Analyze 7.5 volume
[ avw ] = avw_view([avw], [parent], [command])
avw - a struct, created by avw_read; if omitted, a gui file locator will
prompt for a .hdr file.
parent - an optional handle to the gui that calls this gui, useful for
updating the UserData field of the parent. The avw structure may be
returned to the parent, if possible.
command - an optional string, such as 'init' or various callback
commands, 'init' is the default.
The navigation is by sliders, mouse clicks and arrow keys. Right mouse
clicks on any ortho-view will show a command menu, for simple block
region of interest (ROI) calculations, image zoom, and save image. The
ROI calculations are returned into avw.stats.
Fiducial points can be selected, which are returned into 'avw.fiducials'
in the base workspace. These points are given in several coordinate
frameworks (voxels, mm, and meters), with values given relative to an
origin located at the "center" of the MRI volume (see avw_center, which
returns abs and corner values, abs used here).
The AC location can be selected and the values are returned into 'avw.ac'
in the base workspace. These points are given in voxels, mm & meters; for
the latter, the values are given as offsets from the "center" of the MRI
volume (see avw_center).
+X is left (L), +Y is anterior (A), +Z is superior (S), the default LAS
orientation of the Analyze 7.5 format. The coordinate system is left
handed. This is the radiological convention, as opposed to the
neurological convention (RAS). The latter can be emulated by using the
'Flip L/R' button.
Example of loading and viewing the SPM T1 template:
avw = avw_read('T1')
avw = avw_view(avw);
Similarly, just 'avw_view' can be typed at the command prompt and you can
use the gui file locator to select any .hdr file.
See also, <a href="avw_read.html" class="code" title="function [ avw, machine ] = avw_read(fileprefix,IMGorient,machine)">avw_read</a>, <a href="avw_img_read.html" class="code" title="function [ avw, machine ] = avw_img_read(fileprefix,IMGorient,machine)">avw_img_read</a>, <a href="avw_hdr_read.html" class="code" title="function [ avw, machine ] = avw_hdr_read(fileprefix, machine)">avw_hdr_read</a></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)">
<li><a href="avw_center.html" class="code" title="function center = avw_center(avw)">avw_center</a> avw_center - find center of a volume</li><li><a href="avw_read.html" class="code" title="function [ avw, machine ] = avw_read(fileprefix,IMGorient,machine)">avw_read</a> avw_read - read Analyze format data image (*.img)</li><li><a href="avw_roi.html" class="code" title="function [roi] = avw_roi(avw,position,shape)">avw_roi</a> avw_roi - extract a region of interest from avw.img</li><li><a href="avw_stats.html" class="code" title="function [stat] = avw_stats(stat)">avw_stats</a> avw_stats - calculate region of interest stats for avw data</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->
<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="#_sub1" class="code">function axial_update(AVWVIEW)</a></li><li><a href="#_sub2" class="code">function coronal_update(AVWVIEW)</a></li><li><a href="#_sub3" class="code">function sagittal_update(AVWVIEW)</a></li><li><a href="#_sub4" class="code">function AVWVIEW = set_crosshairs(AVWVIEW)</a></li><li><a href="#_sub5" class="code">function AVWVIEW = set_coordinates(AVWVIEW)</a></li><li><a href="#_sub6" class="code">function AVWVIEW = get_current_position(AVWVIEW),</a></li><li><a href="#_sub7" class="code">function AVWVIEW = get_slider_position(AVWVIEW),</a></li><li><a href="#_sub8" class="code">function AVWVIEW = check_slices(AVWVIEW),</a></li><li><a href="#_sub9" class="code">function set_display_values(AVWVIEW),</a></li><li><a href="#_sub10" class="code">function [AVWVIEW,metric] = slices2metric(AVWVIEW),</a></li><li><a href="#_sub11" class="code">function AVWVIEW = metric2slices(AVWVIEW,metric),</a></li><li><a href="#_sub12" class="code">function AVWVIEW = init(avw,invarname),</a></li><li><a href="#_sub13" class="code">function slice_img(avw),</a></li></ul>
<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 [ varargout ] = avw_view(avw,parent,command),</a>
0002
0003 <span class="comment">% avw_view - create and navigate ortho views of Analyze 7.5 volume</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% [ avw ] = avw_view([avw], [parent], [command])</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% avw - a struct, created by avw_read; if omitted, a gui file locator will</span>
0008 <span class="comment">% prompt for a .hdr file.</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% parent - an optional handle to the gui that calls this gui, useful for</span>
0011 <span class="comment">% updating the UserData field of the parent. The avw structure may be</span>
0012 <span class="comment">% returned to the parent, if possible.</span>
0013 <span class="comment">%</span>
0014 <span class="comment">% command - an optional string, such as 'init' or various callback</span>
0015 <span class="comment">% commands, 'init' is the default.</span>
0016 <span class="comment">%</span>
0017 <span class="comment">% The navigation is by sliders, mouse clicks and arrow keys. Right mouse</span>
0018 <span class="comment">% clicks on any ortho-view will show a command menu, for simple block</span>
0019 <span class="comment">% region of interest (ROI) calculations, image zoom, and save image. The</span>
0020 <span class="comment">% ROI calculations are returned into avw.stats.</span>
0021 <span class="comment">%</span>
0022 <span class="comment">% Fiducial points can be selected, which are returned into 'avw.fiducials'</span>
0023 <span class="comment">% in the base workspace. These points are given in several coordinate</span>
0024 <span class="comment">% frameworks (voxels, mm, and meters), with values given relative to an</span>
0025 <span class="comment">% origin located at the "center" of the MRI volume (see avw_center, which</span>
0026 <span class="comment">% returns abs and corner values, abs used here).</span>
0027 <span class="comment">%</span>
0028 <span class="comment">% The AC location can be selected and the values are returned into 'avw.ac'</span>
0029 <span class="comment">% in the base workspace. These points are given in voxels, mm & meters; for</span>
0030 <span class="comment">% the latter, the values are given as offsets from the "center" of the MRI</span>
0031 <span class="comment">% volume (see avw_center).</span>
0032 <span class="comment">%</span>
0033 <span class="comment">% +X is left (L), +Y is anterior (A), +Z is superior (S), the default LAS</span>
0034 <span class="comment">% orientation of the Analyze 7.5 format. The coordinate system is left</span>
0035 <span class="comment">% handed. This is the radiological convention, as opposed to the</span>
0036 <span class="comment">% neurological convention (RAS). The latter can be emulated by using the</span>
0037 <span class="comment">% 'Flip L/R' button.</span>
0038 <span class="comment">%</span>
0039 <span class="comment">% Example of loading and viewing the SPM T1 template:</span>
0040 <span class="comment">% avw = avw_read('T1')</span>
0041 <span class="comment">% avw = avw_view(avw);</span>
0042 <span class="comment">%</span>
0043 <span class="comment">% Similarly, just 'avw_view' can be typed at the command prompt and you can</span>
0044 <span class="comment">% use the gui file locator to select any .hdr file.</span>
0045 <span class="comment">%</span>
0046 <span class="comment">% See also, avw_read, avw_img_read, avw_hdr_read</span>
0047 <span class="comment">%</span>
0048
0049 <span class="comment">% $Revision: 1.1 $ $Date: 2004/04/08 20:12:52 $</span>
0050
0051 <span class="comment">% Licence: GNU GPL, no express or implied warranties</span>
0052 <span class="comment">% History: 06/2002, Darren.Weber_at_flinders.edu.au</span>
0053 <span class="comment">% 10/2002, Darren.Weber_at_flinders.edu.au</span>
0054 <span class="comment">% added fiducial point determination</span>
0055 <span class="comment">% changed plots from surf to imagesc commands</span>
0056 <span class="comment">% added handling of datatype for avw.img</span>
0057 <span class="comment">% altered daspect to use avw.hdr.dime.pixdim</span>
0058 <span class="comment">% altered color scheme</span>
0059 <span class="comment">% 01/2003, Darren.Weber_at_flinders.edu.au</span>
0060 <span class="comment">% added parent GUI handling</span>
0061 <span class="comment">% 10/2003, Darren.Weber_at_radiology.ucsf.edu</span>
0062 <span class="comment">% added right click options, including simple block ROI</span>
0063 <span class="comment">% functions, zoom and save image</span>
0064 <span class="comment">% 11/2003, Darren.Weber_at_radiology.ucsf.edu</span>
0065 <span class="comment">% added arrow key navigation</span>
0066 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
0067
0068 <span class="keyword">if</span> gcbf,
0069 AVWVIEW = get(gcbf,<span class="string">'Userdata'</span>);
0070 <span class="keyword">end</span>
0071
0072 <span class="keyword">if</span> ~exist(<span class="string">'command'</span>,<span class="string">'var'</span>), command = <span class="string">'init'</span>; <span class="keyword">end</span>
0073
0074 command = lower(command);
0075
0076 <span class="comment">% Check for specific keys and assign command</span>
0077 <span class="keyword">if</span> strcmp(command, <span class="string">'keypress'</span>),
0078
0079 cc = get(AVWVIEW.gui,<span class="string">'CurrentCharacter'</span>);
0080 cc = double(cc);
0081 <span class="keyword">if</span> cc,
0082 <span class="keyword">switch</span> cc,
0083 <span class="keyword">case</span> 27, command = <span class="string">'quit'</span>; <span class="comment">% ESC</span>
0084 <span class="keyword">case</span> 28, command = <span class="string">'left'</span>; <span class="comment">% left</span>
0085 <span class="keyword">case</span> 29, command = <span class="string">'right'</span>; <span class="comment">% right</span>
0086 <span class="keyword">case</span> 30, command = <span class="string">'up'</span>; <span class="comment">% up</span>
0087 <span class="keyword">case</span> 31, command = <span class="string">'down'</span>; <span class="comment">% down</span>
0088 <span class="keyword">otherwise</span>, <span class="keyword">return</span>; <span class="comment">% all other keys</span>
0089 <span class="keyword">end</span>
0090 <span class="keyword">end</span>
0091 <span class="keyword">end</span>
0092
0093 <span class="keyword">switch</span> command,
0094
0095 <span class="keyword">case</span> <span class="string">'init'</span>,
0096
0097 <span class="keyword">if</span> ~exist(<span class="string">'avw'</span>,<span class="string">'var'</span>),
0098 avw = <a href="avw_read.html" class="code" title="function [ avw, machine ] = avw_read(fileprefix,IMGorient,machine)">avw_read</a>;
0099 <span class="keyword">end</span>
0100
0101 <span class="keyword">if</span> nargin == 0,
0102 AVWVIEW = <a href="#_sub12" class="code" title="subfunction AVWVIEW = init(avw,invarname),">init</a>(avw);
0103 <span class="keyword">elseif</span> isempty(inputname(1)),
0104 AVWVIEW = <a href="#_sub12" class="code" title="subfunction AVWVIEW = init(avw,invarname),">init</a>(avw);
0105 <span class="keyword">else</span>
0106 AVWVIEW = <a href="#_sub12" class="code" title="subfunction AVWVIEW = init(avw,invarname),">init</a>(avw,inputname(1));
0107 <span class="keyword">end</span>
0108
0109 AVWVIEW = <a href="#_sub5" class="code" title="subfunction AVWVIEW = set_coordinates(AVWVIEW)">set_coordinates</a>(AVWVIEW);
0110
0111
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -