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

📄 avw_img_compose.html

📁 mri_toolbox是一个工具用来MRI. 来自于SourceForge, 我上传这个软件,希望能结识对医疗软件感兴趣的兄弟.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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_img_compose</title>  <meta name="keywords" content="avw_img_compose">  <meta name="description" content="AVW_IMG_COMPOSE - Compose single slice Analyze files into a volume">  <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_img_compose.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_img_compose</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>AVW_IMG_COMPOSE - Compose single slice Analyze files into a 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 avw = avw_img_compose(files,IMGorient,machine), </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_IMG_COMPOSE - Compose single slice Analyze files into a volume

 [ avw, machine ] = avw_img_compose(files, orient, machine)

 files  - a struct created with F = DIR('*.img').
          The filenames of the .img files are in F.name and
          these files are composed into a volume, in the 
          order given by the DIR command
 
 orient - force reading IMG in specified orientation, integer values:

          '', read header history orient field
          0,  transverse/axial unflipped
          1,  coronal unflipped
          2,  sagittal unflipped
          3,  transverse/axial flipped
          4,  coronal flipped
          5,  sagittal flipped

          Note that composed volume is given in this orientation
 
 machine - a string, see machineformat in fread for details.
           The default here is 'ieee-le' but the routine
           will automatically switch between little and big
           endian to read any such Analyze header.  It
           reports the appropriate machine format and can
           return the machine value.

 Returned values:
 
 avw.hdr - a struct with image data parameters.
 avw.img - a 3D matrix of image data (double precision).
 
 See also: <a href="avw_img_read.html" class="code" title="function [ avw, machine ] = avw_img_read(fileprefix,IMGorient,machine)">AVW_IMG_READ</a> &amp; <a href="avw_hdr_read.html" class="code" title="function [ avw, machine ] = avw_hdr_read(fileprefix, machine)">AVW_HDR_READ</a> (called by this function)</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_hdr_read.html" class="code" title="function [ avw, machine ] = avw_hdr_read(fileprefix, machine)">avw_hdr_read</a>	avw_hdr_read - read Analyze format data header (*.hdr)</li><li><a href="avw_img_read.html" class="code" title="function [ avw, machine ] = avw_img_read(fileprefix,IMGorient,machine)">avw_img_read</a>	avw_img_read - read Analyze format data image (*.img)</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 [avw] = avw_add_slice(avw,slice,Nslice,orient),</a></li><li><a href="#_sub2" class="code">function [avw] = avw_img_init(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 avw = avw_img_compose(files,IMGorient,machine),</a>0002 0003 <span class="comment">% AVW_IMG_COMPOSE - Compose single slice Analyze files into a volume</span>0004 <span class="comment">%</span>0005 <span class="comment">% [ avw, machine ] = avw_img_compose(files, orient, machine)</span>0006 <span class="comment">%</span>0007 <span class="comment">% files  - a struct created with F = DIR('*.img').</span>0008 <span class="comment">%          The filenames of the .img files are in F.name and</span>0009 <span class="comment">%          these files are composed into a volume, in the</span>0010 <span class="comment">%          order given by the DIR command</span>0011 <span class="comment">%</span>0012 <span class="comment">% orient - force reading IMG in specified orientation, integer values:</span>0013 <span class="comment">%</span>0014 <span class="comment">%          '', read header history orient field</span>0015 <span class="comment">%          0,  transverse/axial unflipped</span>0016 <span class="comment">%          1,  coronal unflipped</span>0017 <span class="comment">%          2,  sagittal unflipped</span>0018 <span class="comment">%          3,  transverse/axial flipped</span>0019 <span class="comment">%          4,  coronal flipped</span>0020 <span class="comment">%          5,  sagittal flipped</span>0021 <span class="comment">%</span>0022 <span class="comment">%          Note that composed volume is given in this orientation</span>0023 <span class="comment">%</span>0024 <span class="comment">% machine - a string, see machineformat in fread for details.</span>0025 <span class="comment">%           The default here is 'ieee-le' but the routine</span>0026 <span class="comment">%           will automatically switch between little and big</span>0027 <span class="comment">%           endian to read any such Analyze header.  It</span>0028 <span class="comment">%           reports the appropriate machine format and can</span>0029 <span class="comment">%           return the machine value.</span>0030 <span class="comment">%</span>0031 <span class="comment">% Returned values:</span>0032 <span class="comment">%</span>0033 <span class="comment">% avw.hdr - a struct with image data parameters.</span>0034 <span class="comment">% avw.img - a 3D matrix of image data (double precision).</span>0035 <span class="comment">%</span>0036 <span class="comment">% See also: AVW_IMG_READ &amp; AVW_HDR_READ (called by this function)</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">% History:  05/2002, Darren.Weber@flinders.edu.au</span>0043 <span class="comment">%                    The Analyze format is copyright</span>0044 <span class="comment">%                    (c) Copyright, 1986-1995</span>0045 <span class="comment">%                    Biomedical Imaging Resource, Mayo Foundation</span>0046 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0047 0048 <span class="keyword">if</span> ~exist(<span class="string">'files'</span>,<span class="string">'var'</span>),0049     error(<span class="string">'AVW_IMG_COMPOSE: No files to compose'</span>);0050 <span class="keyword">end</span>0051 0052 <span class="keyword">if</span> ~exist(<span class="string">'IMGorient'</span>,<span class="string">'var'</span>), IMGorient = <span class="string">''</span>; <span class="keyword">end</span>0053 <span class="keyword">if</span> ~exist(<span class="string">'machine'</span>,<span class="string">'var'</span>), machine = <span class="string">'ieee-le'</span>; <span class="keyword">end</span>0054 0055 0056 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0057 <span class="comment">% Number of files (slices) to compose</span>0058 Nfiles = size(files,1);0059 <span class="comment">% Size of first file (slice) in bytes</span>0060 Fsize = files(1).bytes;0061 0062 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>0063 <span class="comment">% Initialise the composed volume</span>0064 0065 <span class="comment">% Read the first slice header</span>0066 firstslice = <a href="avw_hdr_read.html" class="code" title="function [ avw, machine ] = avw_hdr_read(fileprefix, machine)">avw_hdr_read</a>(files(1).name,machine);0067 0068 avw = firstslice;0069 0070 <span class="comment">% Not sure if this is always the case, but individual</span>0071 <span class="comment">% slice files output by http://xmedcon.sourceforge.net</span>0072 <span class="comment">% have the FOV in .hdr.dime.pixdim(4) after reading</span>0073 <span class="comment">% some Siemens .ima files.  It might be worth checking</span>0074 <span class="comment">% at this point and dividing this FOV by the</span>0075 <span class="comment">% number of slices</span>0076 <span class="keyword">if</span> avw.hdr.dime.pixdim(4) &gt; 20,0077     msg = sprintf(<span class="string">'AVW_IMG_COMPOSE: slice pixdim(4) is very large, assuming it is FOV and converting!\n'</span>);

⌨️ 快捷键说明

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