Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > ce1f17e7ec5e62f35dbe9f064c5f74d7 > files > 612

libtpcimgio-devel-1.5.10-4.fc15.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>img_ana.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">img_ana.c File Reference</div>  </div>
</div>
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br/>
<code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &lt;unistd.h&gt;</code><br/>
<code>#include &lt;math.h&gt;</code><br/>
<code>#include &lt;string.h&gt;</code><br/>
<code>#include &lt;time.h&gt;</code><br/>
<code>#include &quot;petc99.h&quot;</code><br/>
<code>#include &quot;swap.h&quot;</code><br/>
<code>#include &quot;halflife.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="img_8h_source.html">include/img.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="analyze_8h_source.html">include/analyze.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="imgmax_8h_source.html">include/imgmax.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="imgdecay_8h_source.html">include/imgdecay.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="sif_8h_source.html">include/sif.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="imgfile_8h_source.html">include/imgfile.h</a>&quot;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for img_ana.c:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c__incl.png" border="0" usemap="#img__ana_8c" alt=""/></div>
<map name="img__ana_8c" id="img__ana_8c">
<area shape="rect" id="node21" href="img_8h.html" title="include/img.h" alt="" coords="935,237,1033,267"/><area shape="rect" id="node25" href="analyze_8h.html" title="include/analyze.h" alt="" coords="1317,160,1440,189"/><area shape="rect" id="node27" href="imgmax_8h.html" title="include/imgmax.h" alt="" coords="872,83,995,112"/><area shape="rect" id="node30" href="imgdecay_8h.html" title="include/imgdecay.h" alt="" coords="1019,83,1152,112"/><area shape="rect" id="node33" href="sif_8h.html" title="include/sif.h" alt="" coords="328,83,419,112"/><area shape="rect" id="node45" href="imgfile_8h.html" title="include/imgfile.h" alt="" coords="1176,83,1291,112"/><area shape="rect" id="node48" href="ecat7_8h.html" title="ecat7.h" alt="" coords="1115,237,1179,267"/><area shape="rect" id="node50" href="ecat63_8h.html" title="ecat63.h" alt="" coords="1221,160,1293,189"/><area shape="rect" id="node53" href="imgunit_8h.html" title="imgunit.h" alt="" coords="1072,160,1147,189"/></map>
</div>
</div>
<p><a href="img__ana_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="img__ana_8c.html#aefc54f0812e16d43a17edcdc342be35b">imgReadAnalyze</a> (const char *dbname, <a class="el" href="structIMG.html">IMG</a> *img)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="img__ana_8c.html#a380113542ddd5040b383221f1377d86f">imgWriteAnalyze</a> (const char *dbname, <a class="el" href="structIMG.html">IMG</a> *img)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="img__ana_8c.html#aca1bc7e49593e3137706287dfb9707c7">imgReadAnalyzeHeader</a> (const char *dbname, <a class="el" href="structIMG.html">IMG</a> *img)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="img__ana_8c.html#a825dd53b92d0a2e0ec0e38308132be9f">imgGetAnalyzeHeader</a> (<a class="el" href="structIMG.html">IMG</a> *img, <a class="el" href="structANALYZE__DSR.html">ANALYZE_DSR</a> *h)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="img__ana_8c.html#adac51c408702b1d888a7056d2e764f9e">imgSetAnalyzeHeader</a> (<a class="el" href="structIMG.html">IMG</a> *img, const char *dbname, <a class="el" href="structANALYZE__DSR.html">ANALYZE_DSR</a> *dsr, float fmin, float fmax)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="img__ana_8c.html#a8b134310e111af2b0577f5e95dc22e21">imgReadAnalyzeFirstFrame</a> (const char *fname, <a class="el" href="structIMG.html">IMG</a> *img)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="img__ana_8c.html#a9094bdc56d1564b7ad412f0dfc114d9b">imgReadAnalyzeFrame</a> (const char *fname, int frame_to_read, <a class="el" href="structIMG.html">IMG</a> *img, int frame_index)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="img__ana_8c.html#add3b38cb5c7cb556ee55dee3b7d66130">imgWriteAnalyzeFrame</a> (const char *dbname, int frame_to_write, <a class="el" href="structIMG.html">IMG</a> *img, int frame_index, float fmin, float fmax)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a825dd53b92d0a2e0ec0e38308132be9f"></a><!-- doxytag: member="img_ana.c::imgGetAnalyzeHeader" ref="a825dd53b92d0a2e0ec0e38308132be9f" args="(IMG *img, ANALYZE_DSR *h)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int imgGetAnalyzeHeader </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structIMG.html">IMG</a> *&#160;</td>
          <td class="paramname"><em>img</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structANALYZE__DSR.html">ANALYZE_DSR</a> *&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Copy Analyze 7.5 header information into <a class="el" href="structIMG.html">IMG</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">img</td><td>image structure </td></tr>
    <tr><td class="paramname">h</td><td>Analyze header structure </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>errstatus, which is STATUS_OK (0) when call was successful, and &gt;0 in case of an error. </dd></dl>

<p>Definition at line <a class="el" href="img__ana_8c_source.html#l00481">481</a> of file <a class="el" href="img__ana_8c_source.html">img_ana.c</a>.</p>

<p>References <a class="el" href="img_8h_source.html#l00229">IMG::_fileFormat</a>, <a class="el" href="img_8h_source.html#l00184">IMG::decayCorrected</a>, <a class="el" href="analyze_8h_source.html#l00079">ANALYZE_HEADER_HISTORY::descrip</a>, <a class="el" href="analyze_8h_source.html#l00054">ANALYZE_HEADER_IMGDIM::dim</a>, <a class="el" href="analyze_8h_source.html#l00101">ANALYZE_DSR::dime</a>, <a class="el" href="img_8h_source.html#l00259">IMG::dimt</a>, <a class="el" href="img_8h_source.html#l00261">IMG::dimx</a>, <a class="el" href="img_8h_source.html#l00263">IMG::dimy</a>, <a class="el" href="img_8h_source.html#l00265">IMG::dimz</a>, <a class="el" href="analyze_8h_source.html#l00069">ANALYZE_HEADER_IMGDIM::funused3</a>, <a class="el" href="analyze_8h_source.html#l00102">ANALYZE_DSR::hist</a>, <a class="el" href="img_8h_source.html#l00089">IMG_ANA</a>, <a class="el" href="img_8h_source.html#l00090">IMG_ANA_L</a>, <a class="el" href="img_8h_source.html#l00072">IMG_STATUS_INITIALIZED</a>, <a class="el" href="img_8h_source.html#l00073">IMG_STATUS_OCCUPIED</a>, <a class="el" href="img_8h_source.html#l00128">IMG_TEST</a>, <a class="el" href="img_8h_source.html#l00080">IMG_TYPE_IMAGE</a>, <a class="el" href="img_8c_source.html#l00399">imgSetStatus()</a>, <a class="el" href="img_8h_source.html#l00182">IMG::isotopeHalflife</a>, <a class="el" href="analyze_8h_source.html#l00104">ANALYZE_DSR::little</a>, <a class="el" href="analyze_8h_source.html#l00085">ANALYZE_HEADER_HISTORY::patient_id</a>, <a class="el" href="img_8h_source.html#l00176">IMG::patientName</a>, <a class="el" href="analyze_8h_source.html#l00065">ANALYZE_HEADER_IMGDIM::pixdim</a>, <a class="el" href="img_8h_source.html#l00208">IMG::sizex</a>, <a class="el" href="img_8h_source.html#l00210">IMG::sizey</a>, <a class="el" href="img_8h_source.html#l00212">IMG::sizez</a>, <a class="el" href="img_8h_source.html#l00164">IMG::status</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_FAULT</a>, <a class="el" href="img_8h_source.html#l00122">STATUS_INVALIDHEADER</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_OK</a>, <a class="el" href="img_8h_source.html#l00174">IMG::studyNr</a>, and <a class="el" href="img_8h_source.html#l00198">IMG::type</a>.</p>

<p>Referenced by <a class="el" href="img__ana_8c_source.html#l00414">imgReadAnalyzeHeader()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c_a825dd53b92d0a2e0ec0e38308132be9f_cgraph.png" border="0" usemap="#img__ana_8c_a825dd53b92d0a2e0ec0e38308132be9f_cgraph" alt=""/></div>
<map name="img__ana_8c_a825dd53b92d0a2e0ec0e38308132be9f_cgraph" id="img__ana_8c_a825dd53b92d0a2e0ec0e38308132be9f_cgraph">
<area shape="rect" id="node3" href="img_8c.html#ad124d2d496934d677156cc8779a1e567" title="imgSetStatus" alt="" coords="208,5,309,35"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aefc54f0812e16d43a17edcdc342be35b"></a><!-- doxytag: member="img_ana.c::imgReadAnalyze" ref="aefc54f0812e16d43a17edcdc342be35b" args="(const char *dbname, IMG *img)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int imgReadAnalyze </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dbname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structIMG.html">IMG</a> *&#160;</td>
          <td class="paramname"><em>img</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read Analyze 7.5 image. Analyze database name must be given with path. Image and header files with .img and .hdr extensions must exist. Also <a class="el" href="structSIF.html">SIF</a> file with .sif extension is used, if it exists. <a class="el" href="analyze_8c.html#a55febab802306e82d162793558f5fbce">anaFlipping()</a> determines whether image is flipped in z-direction; image is always flipped in x,y-directions.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">dbname</td><td>Analyze database name with path, with or without extension </td></tr>
    <tr><td class="paramname">img</td><td>Pointer to initialized <a class="el" href="structIMG.html">IMG</a> strucure </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, 1 invalid input, 2 invalid image status (not initialized), 3 no header file found, 4 invalid header, 7 failed to read image data, 11 failed to allocate memory for header data, 12 failed to allocate memory for image data, 21 failed to rad sif data, 22 invalid sif data, sets IMG-&gt;statmsg in case of error </dd></dl>

<p>Definition at line <a class="el" href="img__ana_8c_source.html#l00083">83</a> of file <a class="el" href="img__ana_8c_source.html">img_ana.c</a>.</p>

<p>References <a class="el" href="img_8h_source.html#l00229">IMG::_fileFormat</a>, <a class="el" href="analyze_8c_source.html#l00075">anaExists()</a>, <a class="el" href="analyze_8c_source.html#l00545">anaFlipping()</a>, <a class="el" href="analyze_8c_source.html#l00307">anaPrintHeader()</a>, <a class="el" href="analyze_8c_source.html#l00102">anaReadHeader()</a>, <a class="el" href="analyze_8c_source.html#l00381">anaReadImagedata()</a>, <a class="el" href="img_8h_source.html#l00184">IMG::decayCorrected</a>, <a class="el" href="analyze_8h_source.html#l00079">ANALYZE_HEADER_HISTORY::descrip</a>, <a class="el" href="analyze_8h_source.html#l00054">ANALYZE_HEADER_IMGDIM::dim</a>, <a class="el" href="analyze_8h_source.html#l00101">ANALYZE_DSR::dime</a>, <a class="el" href="img_8h_source.html#l00259">IMG::dimt</a>, <a class="el" href="img_8h_source.html#l00265">IMG::dimz</a>, <a class="el" href="img_8h_source.html#l00292">IMG::end</a>, <a class="el" href="sif_8h_source.html#l00040">SIF::frameNr</a>, <a class="el" href="analyze_8h_source.html#l00069">ANALYZE_HEADER_IMGDIM::funused3</a>, <a class="el" href="analyze_8h_source.html#l00102">ANALYZE_DSR::hist</a>, <a class="el" href="img_8h_source.html#l00089">IMG_ANA</a>, <a class="el" href="img_8h_source.html#l00090">IMG_ANA_L</a>, <a class="el" href="img_8h_source.html#l00072">IMG_STATUS_INITIALIZED</a>, <a class="el" href="img_8h_source.html#l00128">IMG_TEST</a>, <a class="el" href="img_8h_source.html#l00080">IMG_TYPE_IMAGE</a>, <a class="el" href="img_8c_source.html#l00285">imgAllocate()</a>, <a class="el" href="img_8c_source.html#l00399">imgSetStatus()</a>, <a class="el" href="sif_8h_source.html#l00048">SIF::isotope_name</a>, <a class="el" href="img_8h_source.html#l00182">IMG::isotopeHalflife</a>, <a class="el" href="analyze_8h_source.html#l00104">ANALYZE_DSR::little</a>, <a class="el" href="img_8h_source.html#l00274">IMG::m</a>, <a class="el" href="img_8h_source.html#l00294">IMG::mid</a>, <a class="el" href="analyze_8h_source.html#l00085">ANALYZE_HEADER_HISTORY::patient_id</a>, <a class="el" href="img_8h_source.html#l00176">IMG::patientName</a>, <a class="el" href="analyze_8h_source.html#l00065">ANALYZE_HEADER_IMGDIM::pixdim</a>, <a class="el" href="img_8h_source.html#l00284">IMG::planeNumber</a>, <a class="el" href="sif_8h_source.html#l00054">SIF::prompts</a>, <a class="el" href="img_8h_source.html#l00306">IMG::prompts</a>, <a class="el" href="sif_8h_source.html#l00056">SIF::randoms</a>, <a class="el" href="img_8h_source.html#l00308">IMG::randoms</a>, <a class="el" href="img_8h_source.html#l00186">IMG::scanStart</a>, <a class="el" href="sif_8h_source.html#l00038">SIF::scantime</a>, <a class="el" href="sif_8c_source.html#l00074">sifEmpty()</a>, <a class="el" href="sif_8c_source.html#l00061">sifInit()</a>, <a class="el" href="sifio_8c_source.html#l00064">sifRead()</a>, <a class="el" href="img_8h_source.html#l00208">IMG::sizex</a>, <a class="el" href="img_8h_source.html#l00210">IMG::sizey</a>, <a class="el" href="img_8h_source.html#l00212">IMG::sizez</a>, <a class="el" href="img_8h_source.html#l00290">IMG::start</a>, <a class="el" href="img_8h_source.html#l00164">IMG::status</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_FAULT</a>, <a class="el" href="img_8h_source.html#l00122">STATUS_INVALIDHEADER</a>, <a class="el" href="img_8h_source.html#l00122">STATUS_NOHEADERFILE</a>, <a class="el" href="img_8h_source.html#l00123">STATUS_NOIMGDATA</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_NOMEMORY</a>, <a class="el" href="img_8h_source.html#l00123">STATUS_NOSIFDATA</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_OK</a>, <a class="el" href="img_8h_source.html#l00119">STATUS_UNSUPPORTED</a>, <a class="el" href="img_8h_source.html#l00123">STATUS_WRONGSIFDATA</a>, <a class="el" href="img_8h_source.html#l00174">IMG::studyNr</a>, <a class="el" href="img_8h_source.html#l00198">IMG::type</a>, <a class="el" href="sif_8h_source.html#l00050">SIF::x1</a>, and <a class="el" href="sif_8h_source.html#l00052">SIF::x2</a>.</p>

<p>Referenced by <a class="el" href="imgfile_8c_source.html#l00190">imgRead()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c_aefc54f0812e16d43a17edcdc342be35b_cgraph.png" border="0" usemap="#img__ana_8c_aefc54f0812e16d43a17edcdc342be35b_cgraph" alt=""/></div>
<map name="img__ana_8c_aefc54f0812e16d43a17edcdc342be35b_cgraph" id="img__ana_8c_aefc54f0812e16d43a17edcdc342be35b_cgraph">
<area shape="rect" id="node3" href="analyze_8c.html#a962221ab7adb0bed2050284912d473ca" title="anaExists" alt="" coords="204,5,284,35"/><area shape="rect" id="node5" href="analyze_8c.html#a55febab802306e82d162793558f5fbce" title="anaFlipping" alt="" coords="200,59,288,88"/><area shape="rect" id="node7" href="analyze_8c.html#a5c764c78d790dabed25b1f7971717a05" title="anaPrintHeader" alt="" coords="188,112,300,141"/><area shape="rect" id="node9" href="analyze_8c.html#aa7bf1965dcdbff0686193675a3175a1c" title="anaReadHeader" alt="" coords="187,165,301,195"/><area shape="rect" id="node11" href="analyze_8c.html#abfb69549a8e8c6a4eab3c52045262d22" title="anaReadImagedata" alt="" coords="177,219,311,248"/><area shape="rect" id="node13" href="img_8c.html#a9b2670da9c7685e6d53058cdf1db1199" title="imgAllocate" alt="" coords="199,272,289,301"/><area shape="rect" id="node17" href="img_8c.html#ad124d2d496934d677156cc8779a1e567" title="imgSetStatus" alt="" coords="493,273,595,303"/><area shape="rect" id="node21" href="sif_8c.html#ad2378bec7fec69900af6f52737c89784" title="sifEmpty" alt="" coords="507,428,581,457"/><area shape="rect" id="node23" href="sif_8c.html#a61c0218e380da8ace65d78f82a8f9f69" title="sifInit" alt="" coords="217,427,271,456"/><area shape="rect" id="node25" href="sifio_8c.html#ae6c3f31d7cbe31ca6b74760978fd39c7" title="sifRead" alt="" coords="211,480,277,509"/><area shape="rect" id="node15" href="img_8c.html#ada573d4b40da77be4455bb9fab9a3033" title="imgEmpty" alt="" coords="363,221,443,251"/><area shape="rect" id="node28" href="sif_8c.html#ac1ea54c7476aa6b3d0b1835e22798915" title="sifSetmem" alt="" coords="360,480,445,509"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a8b134310e111af2b0577f5e95dc22e21"></a><!-- doxytag: member="img_ana.c::imgReadAnalyzeFirstFrame" ref="a8b134310e111af2b0577f5e95dc22e21" args="(const char *fname, IMG *img)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int imgReadAnalyzeFirstFrame </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>fname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structIMG.html">IMG</a> *&#160;</td>
          <td class="paramname"><em>img</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the first frame from an Analyze 7.5 database into <a class="el" href="structIMG.html">IMG</a> data structure.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">fname</td><td>Name of Analyze database from which <a class="el" href="structIMG.html">IMG</a> contents will be read </td></tr>
    <tr><td class="paramname">img</td><td>pointer to the initiated but not preallocated <a class="el" href="structIMG.html">IMG</a> data </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>errstatus, which is STATUS_OK (0) when call was successful, and &gt;0 in case of an error. </dd></dl>

<p>Definition at line <a class="el" href="img__ana_8c_source.html#l00629">629</a> of file <a class="el" href="img__ana_8c_source.html">img_ana.c</a>.</p>

<p>References <a class="el" href="img_8h_source.html#l00259">IMG::dimt</a>, <a class="el" href="img_8h_source.html#l00261">IMG::dimx</a>, <a class="el" href="img_8h_source.html#l00263">IMG::dimy</a>, <a class="el" href="img_8h_source.html#l00265">IMG::dimz</a>, <a class="el" href="img_8h_source.html#l00072">IMG_STATUS_INITIALIZED</a>, <a class="el" href="img_8h_source.html#l00128">IMG_TEST</a>, <a class="el" href="img_8c_source.html#l00285">imgAllocate()</a>, <a class="el" href="img_8c_source.html#l00414">imgInfo()</a>, <a class="el" href="img__ana_8c_source.html#l00674">imgReadAnalyzeFrame()</a>, <a class="el" href="img__ana_8c_source.html#l00414">imgReadAnalyzeHeader()</a>, <a class="el" href="img_8c_source.html#l00399">imgSetStatus()</a>, <a class="el" href="img_8h_source.html#l00164">IMG::status</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_FAULT</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_NOMEMORY</a>, and <a class="el" href="img_8h_source.html#l00118">STATUS_OK</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c_a8b134310e111af2b0577f5e95dc22e21_cgraph.png" border="0" usemap="#img__ana_8c_a8b134310e111af2b0577f5e95dc22e21_cgraph" alt=""/></div>
<map name="img__ana_8c_a8b134310e111af2b0577f5e95dc22e21_cgraph" id="img__ana_8c_a8b134310e111af2b0577f5e95dc22e21_cgraph">
<area shape="rect" id="node3" href="img_8c.html#a9b2670da9c7685e6d53058cdf1db1199" title="imgAllocate" alt="" coords="273,75,364,105"/><area shape="rect" id="node7" href="img_8c.html#ad124d2d496934d677156cc8779a1e567" title="imgSetStatus" alt="" coords="697,102,799,131"/><area shape="rect" id="node10" href="img_8c.html#a32edd1b78039f6cc22b7bbe413aa3a56" title="imgInfo" alt="" coords="287,599,351,629"/><area shape="rect" id="node14" href="img__ana_8c.html#a9094bdc56d1564b7ad412f0dfc114d9b" title="imgReadAnalyzeFrame" alt="" coords="240,441,397,470"/><area shape="rect" id="node39" href="img__ana_8c.html#aca1bc7e49593e3137706287dfb9707c7" title="imgReadAnalyzeHeader" alt="" coords="237,283,400,313"/><area shape="rect" id="node5" href="img_8c.html#ada573d4b40da77be4455bb9fab9a3033" title="imgEmpty" alt="" coords="485,75,565,105"/><area shape="rect" id="node12" href="imgunit_8c.html#afdd2838260ccde7ed239666ca05dcf99" title="imgUnit" alt="" coords="492,705,559,734"/><area shape="rect" id="node16" href="analyze_8c.html#a6ecb9b0f8fb5f1fa4920a378d2ce0534" title="anaDatabaseExists" alt="" coords="457,494,593,523"/><area shape="rect" id="node22" href="analyze_8c.html#a55febab802306e82d162793558f5fbce" title="anaFlipping" alt="" coords="481,598,569,627"/><area shape="rect" id="node24" href="analyze_8c.html#aa7bf1965dcdbff0686193675a3175a1c" title="anaReadHeader" alt="" coords="468,337,583,366"/><area shape="rect" id="node26" href="analyze_8c.html#abfb69549a8e8c6a4eab3c52045262d22" title="anaReadImagedata" alt="" coords="459,651,592,681"/><area shape="rect" id="node29" href="sif_8c.html#ad2378bec7fec69900af6f52737c89784" title="sifEmpty" alt="" coords="893,363,968,393"/><area shape="rect" id="node31" href="sif_8c.html#a61c0218e380da8ace65d78f82a8f9f69" title="sifInit" alt="" coords="499,283,552,313"/><area shape="rect" id="node33" href="sifio_8c.html#ae6c3f31d7cbe31ca6b74760978fd39c7" title="sifRead" alt="" coords="492,441,559,470"/><area shape="rect" id="node18" href="analyze_8c.html#a10778c4b955173ef69cba2b85933ac61" title="anaMakeSIFName" alt="" coords="683,494,813,523"/><area shape="rect" id="node20" href="analyze_8c.html#a78fdd5d5b299585ba8546b2071154d3a" title="anaRemoveFNameExtension" alt="" coords="652,441,844,470"/><area shape="rect" id="node36" href="sif_8c.html#ac1ea54c7476aa6b3d0b1835e22798915" title="sifSetmem" alt="" coords="705,337,791,366"/><area shape="rect" id="node43" href="img__ana_8c.html#a825dd53b92d0a2e0ec0e38308132be9f" title="imgGetAnalyzeHeader" alt="" coords="449,179,601,209"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a9094bdc56d1564b7ad412f0dfc114d9b"></a><!-- doxytag: member="img_ana.c::imgReadAnalyzeFrame" ref="a9094bdc56d1564b7ad412f0dfc114d9b" args="(const char *fname, int frame_to_read, IMG *img, int frame_index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int imgReadAnalyzeFrame </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>fname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>frame_to_read</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structIMG.html">IMG</a> *&#160;</td>
          <td class="paramname"><em>img</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>frame_index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read a specified frame from an Analyze 7.5 database into preallocated <a class="el" href="structIMG.html">IMG</a> data structure. Analyze database consists of two or three files in the same directory: fname.hdr, fname.img, and optionally fname.sif. <a class="el" href="structIMG.html">IMG</a> header is assumed to be filled correctly before calling this function, except for information concerning separate planes and this frame, which is filled here. If frame does not exist, then and only then STATUS_NOMATRIX is returned.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">fname</td><td>name of Analyze database from which <a class="el" href="structIMG.html">IMG</a> contents will be read </td></tr>
    <tr><td class="paramname">frame_to_read</td><td>frame which will be read [1..frameNr] </td></tr>
    <tr><td class="paramname">img</td><td>pointer to the <a class="el" href="structIMG.html">IMG</a> data. Place for the frame must be preallocated </td></tr>
    <tr><td class="paramname">frame_index</td><td><a class="el" href="structIMG.html">IMG</a> frame index [0..dimt-1] where data will be placed </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>errstatus, which is STATUS_OK (0) when call was successful, and &gt;0 in case of an error. </dd></dl>

<p>Definition at line <a class="el" href="img__ana_8c_source.html#l00674">674</a> of file <a class="el" href="img__ana_8c_source.html">img_ana.c</a>.</p>

<p>References <a class="el" href="analyze_8c_source.html#l00619">anaDatabaseExists()</a>, <a class="el" href="analyze_8c_source.html#l00545">anaFlipping()</a>, <a class="el" href="analyze_8c_source.html#l00102">anaReadHeader()</a>, <a class="el" href="analyze_8c_source.html#l00381">anaReadImagedata()</a>, <a class="el" href="img_8h_source.html#l00259">IMG::dimt</a>, <a class="el" href="img_8h_source.html#l00261">IMG::dimx</a>, <a class="el" href="img_8h_source.html#l00263">IMG::dimy</a>, <a class="el" href="img_8h_source.html#l00265">IMG::dimz</a>, <a class="el" href="img_8h_source.html#l00292">IMG::end</a>, <a class="el" href="sif_8h_source.html#l00040">SIF::frameNr</a>, <a class="el" href="img_8h_source.html#l00073">IMG_STATUS_OCCUPIED</a>, <a class="el" href="img_8h_source.html#l00128">IMG_TEST</a>, <a class="el" href="img_8c_source.html#l00399">imgSetStatus()</a>, <a class="el" href="img_8h_source.html#l00274">IMG::m</a>, <a class="el" href="img_8h_source.html#l00294">IMG::mid</a>, <a class="el" href="sif_8h_source.html#l00054">SIF::prompts</a>, <a class="el" href="img_8h_source.html#l00306">IMG::prompts</a>, <a class="el" href="sif_8h_source.html#l00056">SIF::randoms</a>, <a class="el" href="img_8h_source.html#l00308">IMG::randoms</a>, <a class="el" href="sif_8c_source.html#l00074">sifEmpty()</a>, <a class="el" href="sif_8c_source.html#l00061">sifInit()</a>, <a class="el" href="sifio_8c_source.html#l00064">sifRead()</a>, <a class="el" href="img_8h_source.html#l00290">IMG::start</a>, <a class="el" href="img_8h_source.html#l00164">IMG::status</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_FAULT</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_NOFILE</a>, <a class="el" href="img_8h_source.html#l00122">STATUS_NOHEADERFILE</a>, <a class="el" href="img_8h_source.html#l00123">STATUS_NOIMGDATA</a>, <a class="el" href="img_8h_source.html#l00121">STATUS_NOMATRIX</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_NOMEMORY</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_OK</a>, <a class="el" href="img_8h_source.html#l00119">STATUS_UNSUPPORTED</a>, <a class="el" href="sif_8h_source.html#l00050">SIF::x1</a>, and <a class="el" href="sif_8h_source.html#l00052">SIF::x2</a>.</p>

<p>Referenced by <a class="el" href="img__ana_8c_source.html#l00629">imgReadAnalyzeFirstFrame()</a>, and <a class="el" href="imgfile_8c_source.html#l00389">imgReadFrame()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c_a9094bdc56d1564b7ad412f0dfc114d9b_cgraph.png" border="0" usemap="#img__ana_8c_a9094bdc56d1564b7ad412f0dfc114d9b_cgraph" alt=""/></div>
<map name="img__ana_8c_a9094bdc56d1564b7ad412f0dfc114d9b_cgraph" id="img__ana_8c_a9094bdc56d1564b7ad412f0dfc114d9b_cgraph">
<area shape="rect" id="node3" href="analyze_8c.html#a6ecb9b0f8fb5f1fa4920a378d2ce0534" title="anaDatabaseExists" alt="" coords="213,32,349,61"/><area shape="rect" id="node9" href="analyze_8c.html#a55febab802306e82d162793558f5fbce" title="anaFlipping" alt="" coords="237,85,325,115"/><area shape="rect" id="node11" href="analyze_8c.html#aa7bf1965dcdbff0686193675a3175a1c" title="anaReadHeader" alt="" coords="224,139,339,168"/><area shape="rect" id="node13" href="analyze_8c.html#abfb69549a8e8c6a4eab3c52045262d22" title="anaReadImagedata" alt="" coords="215,192,348,221"/><area shape="rect" id="node15" href="img_8c.html#ad124d2d496934d677156cc8779a1e567" title="imgSetStatus" alt="" coords="231,245,332,275"/><area shape="rect" id="node17" href="sif_8c.html#ad2378bec7fec69900af6f52737c89784" title="sifEmpty" alt="" coords="640,351,715,380"/><area shape="rect" id="node19" href="sif_8c.html#a61c0218e380da8ace65d78f82a8f9f69" title="sifInit" alt="" coords="255,349,308,379"/><area shape="rect" id="node21" href="sifio_8c.html#ae6c3f31d7cbe31ca6b74760978fd39c7" title="sifRead" alt="" coords="248,403,315,432"/><area shape="rect" id="node5" href="analyze_8c.html#a10778c4b955173ef69cba2b85933ac61" title="anaMakeSIFName" alt="" coords="429,5,560,35"/><area shape="rect" id="node7" href="analyze_8c.html#a78fdd5d5b299585ba8546b2071154d3a" title="anaRemoveFNameExtension" alt="" coords="399,59,591,88"/><area shape="rect" id="node24" href="sif_8c.html#ac1ea54c7476aa6b3d0b1835e22798915" title="sifSetmem" alt="" coords="452,403,537,432"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aca1bc7e49593e3137706287dfb9707c7"></a><!-- doxytag: member="img_ana.c::imgReadAnalyzeHeader" ref="aca1bc7e49593e3137706287dfb9707c7" args="(const char *dbname, IMG *img)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int imgReadAnalyzeHeader </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dbname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structIMG.html">IMG</a> *&#160;</td>
          <td class="paramname"><em>img</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Fill <a class="el" href="structIMG.html">IMG</a> struct header information from Analyze 7.5 database files. <a class="el" href="structSIF.html">SIF</a> file is read if available. Information concerning separate frames or planes is not filled though.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">dbname</td><td>name of Analyze database, may contain filename extension </td></tr>
    <tr><td class="paramname">img</td><td>pointer to the initiated <a class="el" href="structIMG.html">IMG</a> data </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>errstatus, which is STATUS_OK (0) when call was successful, and &gt;0 in case of an error. </dd></dl>

<p>Definition at line <a class="el" href="img__ana_8c_source.html#l00414">414</a> of file <a class="el" href="img__ana_8c_source.html">img_ana.c</a>.</p>

<p>References <a class="el" href="analyze_8c_source.html#l00619">anaDatabaseExists()</a>, <a class="el" href="analyze_8c_source.html#l00102">anaReadHeader()</a>, <a class="el" href="img_8h_source.html#l00072">IMG_STATUS_INITIALIZED</a>, <a class="el" href="img_8h_source.html#l00128">IMG_TEST</a>, <a class="el" href="img__ana_8c_source.html#l00481">imgGetAnalyzeHeader()</a>, <a class="el" href="img_8c_source.html#l00399">imgSetStatus()</a>, <a class="el" href="sif_8h_source.html#l00048">SIF::isotope_name</a>, <a class="el" href="img_8h_source.html#l00182">IMG::isotopeHalflife</a>, <a class="el" href="img_8h_source.html#l00186">IMG::scanStart</a>, <a class="el" href="sif_8h_source.html#l00038">SIF::scantime</a>, <a class="el" href="sif_8c_source.html#l00074">sifEmpty()</a>, <a class="el" href="sif_8c_source.html#l00061">sifInit()</a>, <a class="el" href="sifio_8c_source.html#l00064">sifRead()</a>, <a class="el" href="img_8h_source.html#l00164">IMG::status</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_FAULT</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_NOFILE</a>, <a class="el" href="img_8h_source.html#l00122">STATUS_NOHEADERFILE</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_OK</a>, <a class="el" href="img_8h_source.html#l00119">STATUS_UNSUPPORTED</a>, <a class="el" href="sif_8h_source.html#l00046">SIF::studynr</a>, and <a class="el" href="img_8h_source.html#l00174">IMG::studyNr</a>.</p>

<p>Referenced by <a class="el" href="img__ana_8c_source.html#l00629">imgReadAnalyzeFirstFrame()</a>, <a class="el" href="imgfile_8c_source.html#l00329">imgReadHeader()</a>, and <a class="el" href="img__ana_8c_source.html#l00781">imgWriteAnalyzeFrame()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c_aca1bc7e49593e3137706287dfb9707c7_cgraph.png" border="0" usemap="#img__ana_8c_aca1bc7e49593e3137706287dfb9707c7_cgraph" alt=""/></div>
<map name="img__ana_8c_aca1bc7e49593e3137706287dfb9707c7_cgraph" id="img__ana_8c_aca1bc7e49593e3137706287dfb9707c7_cgraph">
<area shape="rect" id="node3" href="analyze_8c.html#a6ecb9b0f8fb5f1fa4920a378d2ce0534" title="anaDatabaseExists" alt="" coords="225,17,361,47"/><area shape="rect" id="node9" href="analyze_8c.html#aa7bf1965dcdbff0686193675a3175a1c" title="anaReadHeader" alt="" coords="236,71,351,100"/><area shape="rect" id="node11" href="img__ana_8c.html#a825dd53b92d0a2e0ec0e38308132be9f" title="imgGetAnalyzeHeader" alt="" coords="217,124,369,153"/><area shape="rect" id="node13" href="img_8c.html#ad124d2d496934d677156cc8779a1e567" title="imgSetStatus" alt="" coords="465,137,567,167"/><area shape="rect" id="node16" href="sif_8c.html#ad2378bec7fec69900af6f52737c89784" title="sifEmpty" alt="" coords="661,280,736,309"/><area shape="rect" id="node18" href="sif_8c.html#a61c0218e380da8ace65d78f82a8f9f69" title="sifInit" alt="" coords="267,279,320,308"/><area shape="rect" id="node20" href="sifio_8c.html#ae6c3f31d7cbe31ca6b74760978fd39c7" title="sifRead" alt="" coords="260,332,327,361"/><area shape="rect" id="node5" href="analyze_8c.html#a10778c4b955173ef69cba2b85933ac61" title="anaMakeSIFName" alt="" coords="451,5,581,35"/><area shape="rect" id="node7" href="analyze_8c.html#a78fdd5d5b299585ba8546b2071154d3a" title="anaRemoveFNameExtension" alt="" coords="420,59,612,88"/><area shape="rect" id="node23" href="sif_8c.html#ac1ea54c7476aa6b3d0b1835e22798915" title="sifSetmem" alt="" coords="473,332,559,361"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="adac51c408702b1d888a7056d2e764f9e"></a><!-- doxytag: member="img_ana.c::imgSetAnalyzeHeader" ref="adac51c408702b1d888a7056d2e764f9e" args="(IMG *img, const char *dbname, ANALYZE_DSR *dsr, float fmin, float fmax)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int imgSetAnalyzeHeader </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structIMG.html">IMG</a> *&#160;</td>
          <td class="paramname"><em>img</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dbname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structANALYZE__DSR.html">ANALYZE_DSR</a> *&#160;</td>
          <td class="paramname"><em>dsr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>fmin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>fmax</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Copy header information in <a class="el" href="structIMG.html">IMG</a> struct into Analyze 7.5 header struct. Min, max, and scale factor are set here and they apply to all frames.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">img</td><td>pointer to <a class="el" href="structIMG.html">IMG</a> struct </td></tr>
    <tr><td class="paramname">dbname</td><td>Analyze 7.5 database name </td></tr>
    <tr><td class="paramname">dsr</td><td>pointer to Analyze header struct to be filled </td></tr>
    <tr><td class="paramname">fmin</td><td>minimum pixel value in all frames that will be written </td></tr>
    <tr><td class="paramname">fmax</td><td>maximum pixel value in all frames that will be written </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>errstatus, which is STATUS_OK (0) when call was successful, and &gt;0 in case of an error. </dd></dl>

<p>Definition at line <a class="el" href="img__ana_8c_source.html#l00542">542</a> of file <a class="el" href="img__ana_8c_source.html">img_ana.c</a>.</p>

<p>References <a class="el" href="img_8h_source.html#l00229">IMG::_fileFormat</a>, <a class="el" href="analyze_8h_source.html#l00033">ANALYZE_DT_SIGNED_SHORT</a>, <a class="el" href="analyze_8h_source.html#l00063">ANALYZE_HEADER_IMGDIM::bitpix</a>, <a class="el" href="analyze_8h_source.html#l00070">ANALYZE_HEADER_IMGDIM::cal_max</a>, <a class="el" href="analyze_8h_source.html#l00071">ANALYZE_HEADER_IMGDIM::cal_min</a>, <a class="el" href="analyze_8h_source.html#l00045">ANALYZE_HEADER_KEY::data_type</a>, <a class="el" href="analyze_8h_source.html#l00062">ANALYZE_HEADER_IMGDIM::datatype</a>, <a class="el" href="analyze_8h_source.html#l00046">ANALYZE_HEADER_KEY::db_name</a>, <a class="el" href="img_8h_source.html#l00184">IMG::decayCorrected</a>, <a class="el" href="analyze_8h_source.html#l00079">ANALYZE_HEADER_HISTORY::descrip</a>, <a class="el" href="analyze_8h_source.html#l00054">ANALYZE_HEADER_IMGDIM::dim</a>, <a class="el" href="analyze_8h_source.html#l00101">ANALYZE_DSR::dime</a>, <a class="el" href="img_8h_source.html#l00259">IMG::dimt</a>, <a class="el" href="img_8h_source.html#l00261">IMG::dimx</a>, <a class="el" href="img_8h_source.html#l00263">IMG::dimy</a>, <a class="el" href="img_8h_source.html#l00265">IMG::dimz</a>, <a class="el" href="analyze_8h_source.html#l00086">ANALYZE_HEADER_HISTORY::exp_date</a>, <a class="el" href="analyze_8h_source.html#l00087">ANALYZE_HEADER_HISTORY::exp_time</a>, <a class="el" href="analyze_8h_source.html#l00047">ANALYZE_HEADER_KEY::extents</a>, <a class="el" href="analyze_8h_source.html#l00067">ANALYZE_HEADER_IMGDIM::funused1</a>, <a class="el" href="analyze_8h_source.html#l00069">ANALYZE_HEADER_IMGDIM::funused3</a>, <a class="el" href="analyze_8h_source.html#l00074">ANALYZE_HEADER_IMGDIM::glmax</a>, <a class="el" href="analyze_8h_source.html#l00075">ANALYZE_HEADER_IMGDIM::glmin</a>, <a class="el" href="analyze_8h_source.html#l00102">ANALYZE_DSR::hist</a>, <a class="el" href="analyze_8h_source.html#l00100">ANALYZE_DSR::hk</a>, <a class="el" href="img_8h_source.html#l00090">IMG_ANA_L</a>, <a class="el" href="img_8h_source.html#l00072">IMG_STATUS_INITIALIZED</a>, <a class="el" href="img_8h_source.html#l00073">IMG_STATUS_OCCUPIED</a>, <a class="el" href="img_8h_source.html#l00128">IMG_TEST</a>, <a class="el" href="imgmax_8c_source.html#l00115">imgMinMax()</a>, <a class="el" href="img_8c_source.html#l00399">imgSetStatus()</a>, <a class="el" href="img_8h_source.html#l00182">IMG::isotopeHalflife</a>, <a class="el" href="analyze_8h_source.html#l00104">ANALYZE_DSR::little</a>, <a class="el" href="analyze_8h_source.html#l00065">ANALYZE_HEADER_IMGDIM::pixdim</a>, <a class="el" href="analyze_8h_source.html#l00049">ANALYZE_HEADER_KEY::regular</a>, <a class="el" href="analyze_8h_source.html#l00084">ANALYZE_HEADER_HISTORY::scannum</a>, <a class="el" href="img_8h_source.html#l00186">IMG::scanStart</a>, <a class="el" href="analyze_8h_source.html#l00044">ANALYZE_HEADER_KEY::sizeof_hdr</a>, <a class="el" href="img_8h_source.html#l00208">IMG::sizex</a>, <a class="el" href="img_8h_source.html#l00210">IMG::sizey</a>, <a class="el" href="img_8h_source.html#l00212">IMG::sizez</a>, <a class="el" href="img_8h_source.html#l00164">IMG::status</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_FAULT</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_OK</a>, and <a class="el" href="img_8h_source.html#l00174">IMG::studyNr</a>.</p>

<p>Referenced by <a class="el" href="img__ana_8c_source.html#l00781">imgWriteAnalyzeFrame()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c_adac51c408702b1d888a7056d2e764f9e_cgraph.png" border="0" usemap="#img__ana_8c_adac51c408702b1d888a7056d2e764f9e_cgraph" alt=""/></div>
<map name="img__ana_8c_adac51c408702b1d888a7056d2e764f9e_cgraph" id="img__ana_8c_adac51c408702b1d888a7056d2e764f9e_cgraph">
<area shape="rect" id="node3" href="imgmax_8c.html#a97c48d1ed44d81b2d96ce1a139b99009" title="imgMinMax" alt="" coords="212,5,300,35"/><area shape="rect" id="node5" href="img_8c.html#ad124d2d496934d677156cc8779a1e567" title="imgSetStatus" alt="" coords="205,59,307,88"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a380113542ddd5040b383221f1377d86f"></a><!-- doxytag: member="img_ana.c::imgWriteAnalyze" ref="a380113542ddd5040b383221f1377d86f" args="(const char *dbname, IMG *img)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int imgWriteAnalyze </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dbname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structIMG.html">IMG</a> *&#160;</td>
          <td class="paramname"><em>img</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write Analyze 7.5 image. Analyze database name must be given with path. Path must exist. Image and header files with .img and .hdr extensions are created. Existing files are overwritten. <a class="el" href="analyze_8c.html#a55febab802306e82d162793558f5fbce">anaFlipping()</a> determines whether image is flipped in z-direction; image is always flipped in x,y-directions. Byte order is determined based on _fileFormat field.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">dbname</td><td>analyze database name with path, without extension </td></tr>
    <tr><td class="paramname">img</td><td>pointer to <a class="el" href="structIMG.html">IMG</a> data </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, 1 invalid input, 2 invalid image status (image not occupied), 3 failed to resolve extreme values (min and max), 12 failed to allocate temp memory, 14 failed to open file for writing, 15 failed to write data, 21 failed to write header, sets IMG-&gt;statmsg in case of error </dd></dl>

<p>Definition at line <a class="el" href="img__ana_8c_source.html#l00253">253</a> of file <a class="el" href="img__ana_8c_source.html">img_ana.c</a>.</p>

<p>References <a class="el" href="img_8h_source.html#l00229">IMG::_fileFormat</a>, <a class="el" href="analyze_8c_source.html#l00545">anaFlipping()</a>, <a class="el" href="analyze_8h_source.html#l00033">ANALYZE_DT_SIGNED_SHORT</a>, <a class="el" href="analyze_8c_source.html#l00209">anaWriteHeader()</a>, <a class="el" href="analyze_8h_source.html#l00063">ANALYZE_HEADER_IMGDIM::bitpix</a>, <a class="el" href="analyze_8h_source.html#l00070">ANALYZE_HEADER_IMGDIM::cal_max</a>, <a class="el" href="analyze_8h_source.html#l00071">ANALYZE_HEADER_IMGDIM::cal_min</a>, <a class="el" href="analyze_8h_source.html#l00045">ANALYZE_HEADER_KEY::data_type</a>, <a class="el" href="analyze_8h_source.html#l00062">ANALYZE_HEADER_IMGDIM::datatype</a>, <a class="el" href="analyze_8h_source.html#l00046">ANALYZE_HEADER_KEY::db_name</a>, <a class="el" href="img_8h_source.html#l00184">IMG::decayCorrected</a>, <a class="el" href="analyze_8h_source.html#l00079">ANALYZE_HEADER_HISTORY::descrip</a>, <a class="el" href="analyze_8h_source.html#l00054">ANALYZE_HEADER_IMGDIM::dim</a>, <a class="el" href="analyze_8h_source.html#l00101">ANALYZE_DSR::dime</a>, <a class="el" href="img_8h_source.html#l00259">IMG::dimt</a>, <a class="el" href="img_8h_source.html#l00261">IMG::dimx</a>, <a class="el" href="img_8h_source.html#l00263">IMG::dimy</a>, <a class="el" href="img_8h_source.html#l00265">IMG::dimz</a>, <a class="el" href="analyze_8h_source.html#l00086">ANALYZE_HEADER_HISTORY::exp_date</a>, <a class="el" href="analyze_8h_source.html#l00087">ANALYZE_HEADER_HISTORY::exp_time</a>, <a class="el" href="analyze_8h_source.html#l00047">ANALYZE_HEADER_KEY::extents</a>, <a class="el" href="analyze_8h_source.html#l00067">ANALYZE_HEADER_IMGDIM::funused1</a>, <a class="el" href="analyze_8h_source.html#l00069">ANALYZE_HEADER_IMGDIM::funused3</a>, <a class="el" href="analyze_8h_source.html#l00074">ANALYZE_HEADER_IMGDIM::glmax</a>, <a class="el" href="analyze_8h_source.html#l00075">ANALYZE_HEADER_IMGDIM::glmin</a>, <a class="el" href="analyze_8h_source.html#l00102">ANALYZE_DSR::hist</a>, <a class="el" href="analyze_8h_source.html#l00100">ANALYZE_DSR::hk</a>, <a class="el" href="img_8h_source.html#l00090">IMG_ANA_L</a>, <a class="el" href="img_8h_source.html#l00073">IMG_STATUS_OCCUPIED</a>, <a class="el" href="img_8h_source.html#l00128">IMG_TEST</a>, <a class="el" href="imgmax_8c_source.html#l00115">imgMinMax()</a>, <a class="el" href="img_8c_source.html#l00399">imgSetStatus()</a>, <a class="el" href="img_8h_source.html#l00182">IMG::isotopeHalflife</a>, <a class="el" href="analyze_8h_source.html#l00104">ANALYZE_DSR::little</a>, <a class="el" href="img_8h_source.html#l00274">IMG::m</a>, <a class="el" href="analyze_8h_source.html#l00065">ANALYZE_HEADER_IMGDIM::pixdim</a>, <a class="el" href="analyze_8h_source.html#l00049">ANALYZE_HEADER_KEY::regular</a>, <a class="el" href="analyze_8h_source.html#l00084">ANALYZE_HEADER_HISTORY::scannum</a>, <a class="el" href="img_8h_source.html#l00186">IMG::scanStart</a>, <a class="el" href="analyze_8h_source.html#l00044">ANALYZE_HEADER_KEY::sizeof_hdr</a>, <a class="el" href="img_8h_source.html#l00208">IMG::sizex</a>, <a class="el" href="img_8h_source.html#l00210">IMG::sizey</a>, <a class="el" href="img_8h_source.html#l00212">IMG::sizez</a>, <a class="el" href="img_8h_source.html#l00164">IMG::status</a>, <a class="el" href="img_8h_source.html#l00124">STATUS_CANTWRITEHEADERFILE</a>, <a class="el" href="img_8h_source.html#l00124">STATUS_CANTWRITEIMGFILE</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_FAULT</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_NOMEMORY</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_OK</a>, and <a class="el" href="img_8h_source.html#l00174">IMG::studyNr</a>.</p>

<p>Referenced by <a class="el" href="imgfile_8c_source.html#l00277">imgWrite()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c_a380113542ddd5040b383221f1377d86f_cgraph.png" border="0" usemap="#img__ana_8c_a380113542ddd5040b383221f1377d86f_cgraph" alt=""/></div>
<map name="img__ana_8c_a380113542ddd5040b383221f1377d86f_cgraph" id="img__ana_8c_a380113542ddd5040b383221f1377d86f_cgraph">
<area shape="rect" id="node3" href="analyze_8c.html#a55febab802306e82d162793558f5fbce" title="anaFlipping" alt="" coords="191,5,279,35"/><area shape="rect" id="node5" href="analyze_8c.html#a3ec6f97c394c1bafffc57bd45d81c078" title="anaWriteHeader" alt="" coords="177,59,292,88"/><area shape="rect" id="node7" href="imgmax_8c.html#a97c48d1ed44d81b2d96ce1a139b99009" title="imgMinMax" alt="" coords="191,112,279,141"/><area shape="rect" id="node9" href="img_8c.html#ad124d2d496934d677156cc8779a1e567" title="imgSetStatus" alt="" coords="184,165,285,195"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="add3b38cb5c7cb556ee55dee3b7d66130"></a><!-- doxytag: member="img_ana.c::imgWriteAnalyzeFrame" ref="add3b38cb5c7cb556ee55dee3b7d66130" args="(const char *dbname, int frame_to_write, IMG *img, int frame_index, float fmin, float fmax)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int imgWriteAnalyzeFrame </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dbname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>frame_to_write</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structIMG.html">IMG</a> *&#160;</td>
          <td class="paramname"><em>img</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>frame_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>fmin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>fmax</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write one PET frame from <a class="el" href="structIMG.html">IMG</a> data struct into Analyze 7.5 database file. This function can be called repeatedly to write all frames one at a time to conserve memory.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">dbname</td><td>name of file where <a class="el" href="structIMG.html">IMG</a> contents will be written. If file does not exist, it is created. Make sure to delete existing file, unless you want to add data </td></tr>
    <tr><td class="paramname">frame_to_write</td><td>PET frame number (1..frameNr) which will be written: If set to 0, frame data will be written to an existing or new PET file as a new frame, never overwriting existing data. If &gt;0, then frame data is written as specified frame number, overwriting any data existing with the same frame number </td></tr>
    <tr><td class="paramname">img</td><td>pointer to the <a class="el" href="structIMG.html">IMG</a> data struct </td></tr>
    <tr><td class="paramname">frame_index</td><td><a class="el" href="structIMG.html">IMG</a> frame index (0..dimt-1) which will be written </td></tr>
    <tr><td class="paramname">fmin</td><td>minimum pixel value in all frames that will be written; used only when writing the first frame </td></tr>
    <tr><td class="paramname">fmax</td><td>maximum pixel value in all frames that will be written; used only when writing the first frame </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>errstatus, which is STATUS_OK (0) when call was successful, and &gt;0 in case of an error. </dd></dl>

<p>Definition at line <a class="el" href="img__ana_8c_source.html#l00781">781</a> of file <a class="el" href="img__ana_8c_source.html">img_ana.c</a>.</p>

<p>References <a class="el" href="img_8h_source.html#l00229">IMG::_fileFormat</a>, <a class="el" href="analyze_8c_source.html#l00619">anaDatabaseExists()</a>, <a class="el" href="analyze_8c_source.html#l00545">anaFlipping()</a>, <a class="el" href="analyze_8c_source.html#l00102">anaReadHeader()</a>, <a class="el" href="analyze_8c_source.html#l00209">anaWriteHeader()</a>, <a class="el" href="analyze_8h_source.html#l00054">ANALYZE_HEADER_IMGDIM::dim</a>, <a class="el" href="analyze_8h_source.html#l00101">ANALYZE_DSR::dime</a>, <a class="el" href="img_8h_source.html#l00259">IMG::dimt</a>, <a class="el" href="img_8h_source.html#l00261">IMG::dimx</a>, <a class="el" href="img_8h_source.html#l00263">IMG::dimy</a>, <a class="el" href="img_8h_source.html#l00265">IMG::dimz</a>, <a class="el" href="analyze_8h_source.html#l00067">ANALYZE_HEADER_IMGDIM::funused1</a>, <a class="el" href="img_8h_source.html#l00089">IMG_ANA</a>, <a class="el" href="img_8h_source.html#l00090">IMG_ANA_L</a>, <a class="el" href="img_8h_source.html#l00073">IMG_STATUS_OCCUPIED</a>, <a class="el" href="img_8h_source.html#l00128">IMG_TEST</a>, <a class="el" href="img_8c_source.html#l00216">imgEmpty()</a>, <a class="el" href="img_8c_source.html#l00163">imgInit()</a>, <a class="el" href="img__ana_8c_source.html#l00414">imgReadAnalyzeHeader()</a>, <a class="el" href="img__ana_8c_source.html#l00542">imgSetAnalyzeHeader()</a>, <a class="el" href="analyze_8h_source.html#l00104">ANALYZE_DSR::little</a>, <a class="el" href="img_8h_source.html#l00274">IMG::m</a>, <a class="el" href="img_8h_source.html#l00164">IMG::status</a>, <a class="el" href="img_8h_source.html#l00124">STATUS_CANTWRITEHEADERFILE</a>, <a class="el" href="img_8h_source.html#l00124">STATUS_CANTWRITEIMGFILE</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_FAULT</a>, <a class="el" href="img_8h_source.html#l00119">STATUS_MISSINGMATRIX</a>, <a class="el" href="img_8h_source.html#l00120">STATUS_NOMAINHEADER</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_NOMEMORY</a>, <a class="el" href="img_8h_source.html#l00119">STATUS_NOWRITEPERM</a>, <a class="el" href="img_8h_source.html#l00118">STATUS_OK</a>, <a class="el" href="img_8h_source.html#l00120">STATUS_VARMATSIZE</a>, <a class="el" href="img_8h_source.html#l00124">STATUS_WRONGFILETYPE</a>, and <a class="el" href="img_8h_source.html#l00198">IMG::type</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="img__ana_8c_add3b38cb5c7cb556ee55dee3b7d66130_cgraph.png" border="0" usemap="#img__ana_8c_add3b38cb5c7cb556ee55dee3b7d66130_cgraph" alt=""/></div>
<map name="img__ana_8c_add3b38cb5c7cb556ee55dee3b7d66130_cgraph" id="img__ana_8c_add3b38cb5c7cb556ee55dee3b7d66130_cgraph">
<area shape="rect" id="node3" href="analyze_8c.html#a6ecb9b0f8fb5f1fa4920a378d2ce0534" title="anaDatabaseExists" alt="" coords="433,57,569,87"/><area shape="rect" id="node9" href="analyze_8c.html#a55febab802306e82d162793558f5fbce" title="anaFlipping" alt="" coords="251,580,339,609"/><area shape="rect" id="node11" href="analyze_8c.html#aa7bf1965dcdbff0686193675a3175a1c" title="anaReadHeader" alt="" coords="444,111,559,140"/><area shape="rect" id="node13" href="analyze_8c.html#a3ec6f97c394c1bafffc57bd45d81c078" title="anaWriteHeader" alt="" coords="237,633,352,663"/><area shape="rect" id="node15" href="img_8c.html#ada573d4b40da77be4455bb9fab9a3033" title="imgEmpty" alt="" coords="255,420,335,449"/><area shape="rect" id="node19" href="img_8c.html#af95041292a0f9e4a82a10b49a074a95c" title="imgInit" alt="" coords="264,473,325,503"/><area shape="rect" id="node22" href="img__ana_8c.html#aca1bc7e49593e3137706287dfb9707c7" title="imgReadAnalyzeHeader" alt="" coords="213,255,376,284"/><area shape="rect" id="node40" href="img__ana_8c.html#adac51c408702b1d888a7056d2e764f9e" title="imgSetAnalyzeHeader" alt="" coords="219,527,371,556"/><area shape="rect" id="node5" href="analyze_8c.html#a10778c4b955173ef69cba2b85933ac61" title="anaMakeSIFName" alt="" coords="659,5,789,35"/><area shape="rect" id="node7" href="analyze_8c.html#a78fdd5d5b299585ba8546b2071154d3a" title="anaRemoveFNameExtension" alt="" coords="628,59,820,88"/><area shape="rect" id="node17" href="img_8c.html#ad124d2d496934d677156cc8779a1e567" title="imgSetStatus" alt="" coords="673,424,775,453"/><area shape="rect" id="node26" href="img__ana_8c.html#a825dd53b92d0a2e0ec0e38308132be9f" title="imgGetAnalyzeHeader" alt="" coords="425,372,577,401"/><area shape="rect" id="node30" href="sif_8c.html#ad2378bec7fec69900af6f52737c89784" title="sifEmpty" alt="" coords="869,164,944,193"/><area shape="rect" id="node32" href="sif_8c.html#a61c0218e380da8ace65d78f82a8f9f69" title="sifInit" alt="" coords="475,268,528,297"/><area shape="rect" id="node34" href="sifio_8c.html#ae6c3f31d7cbe31ca6b74760978fd39c7" title="sifRead" alt="" coords="468,164,535,193"/><area shape="rect" id="node37" href="sif_8c.html#ac1ea54c7476aa6b3d0b1835e22798915" title="sifSetmem" alt="" coords="681,164,767,193"/><area shape="rect" id="node42" href="imgmax_8c.html#a97c48d1ed44d81b2d96ce1a139b99009" title="imgMinMax" alt="" coords="457,527,545,556"/></map>
</div>
</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon Aug 8 2011 by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>