Sophie

Sophie

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

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>ecat7p.c Source File</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 class="header">
  <div class="headertitle">
<div class="title">ecat7p.c</div>  </div>
</div>
<div class="contents">
<a href="ecat7p_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/******************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"></span>
<a name="l00003"></a>00003 <span class="comment">  ecat7p.c   (c) 2003-2007 by Turku PET Centre</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">  Procedures for printing ECAT 7.x (header) contents.</span>
<a name="l00006"></a>00006 <span class="comment"></span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">  Version:</span>
<a name="l00009"></a>00009 <span class="comment">  2003-07-17 Vesa Oikonen</span>
<a name="l00010"></a>00010 <span class="comment">  2004-05-23 VO</span>
<a name="l00011"></a>00011 <span class="comment">    Added ecat7datatype(short int data_type), and used too.</span>
<a name="l00012"></a>00012 <span class="comment">    Added some units etc.</span>
<a name="l00013"></a>00013 <span class="comment">  2004-08-15 VO</span>
<a name="l00014"></a>00014 <span class="comment">    Main header sex and dexterity are checked printed as space instead of</span>
<a name="l00015"></a>00015 <span class="comment">    (char)0.</span>
<a name="l00016"></a>00016 <span class="comment">  2004-09-20 VO</span>
<a name="l00017"></a>00017 <span class="comment">    Doxygen style comments are corrected.</span>
<a name="l00018"></a>00018 <span class="comment">  2007-03-21 VO</span>
<a name="l00019"></a>00019 <span class="comment">    strftime() call changed so that even Mingw can understand it.</span>
<a name="l00020"></a>00020 <span class="comment">  2007-17-07 Harri Merisaari</span>
<a name="l00021"></a>00021 <span class="comment">    fixed for ANSI</span>
<a name="l00022"></a>00022 <span class="comment">  2007-09-10 VO</span>
<a name="l00023"></a>00023 <span class="comment">    Return value of localtime() is checked.</span>
<a name="l00024"></a>00024 <span class="comment">  2008-07-24 VO</span>
<a name="l00025"></a>00025 <span class="comment">    Added ecat7PrintSubheader().</span>
<a name="l00026"></a>00026 <span class="comment"></span>
<a name="l00027"></a>00027 <span class="comment">******************************************************************************/</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;locale.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;ctype.h&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;unistd.h&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;time.h&gt;</span>
<a name="l00036"></a>00036 <span class="comment">/*****************************************************************************/</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;swap.h&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;datetime.h&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &quot;<a class="code" href="ecat7_8h.html">include/ecat7.h</a>&quot;</span>
<a name="l00040"></a>00040 <span class="comment">/*****************************************************************************/</span>
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="comment">/*****************************************************************************/</span>
<a name="l00049"></a><a class="code" href="ecat7_8h.html#ac27b431e755edc04a17dabf20577e27d">00049</a> <span class="keywordtype">void</span> <a class="code" href="ecat7p_8c.html#ac27b431e755edc04a17dabf20577e27d">ecat7PrintMainheader</a>(<a class="code" href="structecat7__mainheader.html">ECAT7_mainheader</a> *h, FILE *fp) {
<a name="l00050"></a>00050   <span class="keywordtype">int</span> i;
<a name="l00051"></a>00051   <span class="keywordtype">char</span> tmp[64];
<a name="l00052"></a>00052   <span class="keyword">struct </span>tm *st;
<a name="l00053"></a>00053   time_t lt;
<a name="l00054"></a>00054 
<a name="l00055"></a>00055   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>) fprintf(stdout, <span class="stringliteral">&quot;ecat7PrintMainheader()\n&quot;</span>);
<a name="l00056"></a>00056   fprintf(fp, <span class="stringliteral">&quot;magic_number := %.14s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a71cb64edce706f383f3e68b9548b9ec3">magic_number</a>);
<a name="l00057"></a>00057   fprintf(fp, <span class="stringliteral">&quot;original_file_name := %.32s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a229fda43a3abcdb4e055f2b5791823a8">original_file_name</a>);
<a name="l00058"></a>00058   fprintf(fp, <span class="stringliteral">&quot;sw_version := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a413498a0395e39c969bf7bf401cf023c">sw_version</a>);
<a name="l00059"></a>00059   fprintf(fp, <span class="stringliteral">&quot;system_type := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ae6537726ed92ab81d76c8985fff81244">system_type</a>);
<a name="l00060"></a>00060   fprintf(fp, <span class="stringliteral">&quot;file_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a1914b3a0ebf3077d090752d6ef66c757">file_type</a>, <a class="code" href="ecat7p_8c.html#af7076f45a7f4d8c4a339e5e7d60b0f46">ecat7filetype</a>(h-&gt;<a class="code" href="structecat7__mainheader.html#a1914b3a0ebf3077d090752d6ef66c757">file_type</a>) );
<a name="l00061"></a>00061   fprintf(fp, <span class="stringliteral">&quot;serial_number := %.10s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a03420554a59f09d747e217011f1859c0">serial_number</a>);
<a name="l00062"></a>00062   lt=(time_t)h-&gt;<a class="code" href="structecat7__mainheader.html#a1ad956ffc4f0dc8e9bd473bfa20e6b81">scan_start_time</a>; st=localtime(&amp;lt);
<a name="l00063"></a>00063   <span class="keywordflow">if</span>(st!=NULL) strftime(tmp, 32, <span class="stringliteral">&quot;%Y-%m-%d %H:%M:%S&quot;</span>, st); <span class="comment">/* %T did not work with Mingw */</span>
<a name="l00064"></a>00064   <span class="keywordflow">else</span> strcpy(tmp, <span class="stringliteral">&quot;1900-01-01 00:00:00&quot;</span>);
<a name="l00065"></a>00065   fprintf(fp, <span class="stringliteral">&quot;scan_start_time := %s\n&quot;</span>, tmp);
<a name="l00066"></a>00066   fprintf(fp, <span class="stringliteral">&quot;isotope_name := %.8s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a1a6eea4ac705c0f84f755ac6cb12d69d">isotope_name</a>);
<a name="l00067"></a>00067   fprintf(fp, <span class="stringliteral">&quot;isotope_halflife := %E sec\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a9389f1b044165caf1a4b79007cb6cdfd">isotope_halflife</a>);
<a name="l00068"></a>00068   fprintf(fp, <span class="stringliteral">&quot;radiopharmaceutical := %.32s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ab353f8a8b1166323fe7798d81004a225">radiopharmaceutical</a>);
<a name="l00069"></a>00069   fprintf(fp, <span class="stringliteral">&quot;gantry_tilt := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a5bcbe3f6bdf521d7bc709b79aa8359c0">gantry_tilt</a>);
<a name="l00070"></a>00070   fprintf(fp, <span class="stringliteral">&quot;gantry_rotation := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a81f5c30a8cfa68da62bd4121b4251e6f">gantry_rotation</a>);
<a name="l00071"></a>00071   fprintf(fp, <span class="stringliteral">&quot;bed_elevation := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a8e0caba01dedd5e94dbd36d6db107149">bed_elevation</a>);
<a name="l00072"></a>00072   fprintf(fp, <span class="stringliteral">&quot;intrinsic_tilt := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ac39e16ca7d54c7c1ba069f3581700d16">intrinsic_tilt</a>);
<a name="l00073"></a>00073   fprintf(fp, <span class="stringliteral">&quot;wobble_speed := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a6bb42a878ca6292118b2e591eff6b965">wobble_speed</a>);
<a name="l00074"></a>00074   fprintf(fp, <span class="stringliteral">&quot;transm_source_type := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a637cb9f894c15a7ff4f147ac1810a80f">transm_source_type</a>);
<a name="l00075"></a>00075   fprintf(fp, <span class="stringliteral">&quot;distance_scanned := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a1be6bc903aaef62d6cfac179b7b8a05b">distance_scanned</a>);
<a name="l00076"></a>00076   fprintf(fp, <span class="stringliteral">&quot;transaxial_fov := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a3dff6c0caf29b90298e542c6e76af2a1">transaxial_fov</a>);
<a name="l00077"></a>00077   fprintf(fp, <span class="stringliteral">&quot;angular_compression := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a5682114a0723ab5c3eb65ef673f85779">angular_compression</a>);
<a name="l00078"></a>00078   fprintf(fp, <span class="stringliteral">&quot;coin_samp_mode := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a8b370daee9ea0f228870038831684a04">coin_samp_mode</a>);
<a name="l00079"></a>00079   fprintf(fp, <span class="stringliteral">&quot;axial_samp_mode := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a97197dc85925d45fc1bf501c2edb94cc">axial_samp_mode</a>);
<a name="l00080"></a>00080   fprintf(fp, <span class="stringliteral">&quot;ecat_calibration_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ad5be044d585696c1f35bb8b63c26fec9">ecat_calibration_factor</a>);
<a name="l00081"></a>00081   fprintf(fp, <span class="stringliteral">&quot;calibration_units := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a56bb68347079aca9062f24fe0fb24a63">calibration_units</a>);
<a name="l00082"></a>00082   fprintf(fp, <span class="stringliteral">&quot;calibration_units_label := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a9ee5c316fc447e305593efc25f51dc67">calibration_units_label</a>);
<a name="l00083"></a>00083   fprintf(fp, <span class="stringliteral">&quot;compression_code := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a11ae37f7e7af8371b4884aff851dec2b">compression_code</a>);
<a name="l00084"></a>00084   fprintf(fp, <span class="stringliteral">&quot;study_type := %.12s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#af24db33af652c26d6b2b8a580f3515c4">study_type</a>);
<a name="l00085"></a>00085   fprintf(fp, <span class="stringliteral">&quot;patient_id := %.16s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a3ba61576ab7c202d8d9ba320ea352fe3">patient_id</a>);
<a name="l00086"></a>00086   fprintf(fp, <span class="stringliteral">&quot;patient_name := %.32s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a077ddc2daa174f716708c2077e9ea838">patient_name</a>);
<a name="l00087"></a>00087   fprintf(fp, <span class="stringliteral">&quot;patient_sex := %c\n&quot;</span>, (h-&gt;<a class="code" href="structecat7__mainheader.html#ae87bc1bf2265ce23abe05b38a4f40fb8">patient_sex</a>!=0)?h-&gt;<a class="code" href="structecat7__mainheader.html#ae87bc1bf2265ce23abe05b38a4f40fb8">patient_sex</a>:(<span class="keywordtype">char</span>)32);
<a name="l00088"></a>00088   fprintf(fp, <span class="stringliteral">&quot;patient_dexterity := %c\n&quot;</span>, (h-&gt;<a class="code" href="structecat7__mainheader.html#acd68a5818bdac5c729a43959b0cddfb7">patient_dexterity</a>!=0)?h-&gt;<a class="code" href="structecat7__mainheader.html#acd68a5818bdac5c729a43959b0cddfb7">patient_dexterity</a>:(<span class="keywordtype">char</span>)32 );
<a name="l00089"></a>00089   fprintf(fp, <span class="stringliteral">&quot;patient_age := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ad308b992472cc20d57261aa792159cdd">patient_age</a>);
<a name="l00090"></a>00090   fprintf(fp, <span class="stringliteral">&quot;patient_height := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ab0f4df121ec2ed3b4513f25030d7a041">patient_height</a>);
<a name="l00091"></a>00091   fprintf(fp, <span class="stringliteral">&quot;patient_weight := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a5b2180feb84eb042e654666703a068dd">patient_weight</a>);
<a name="l00092"></a>00092   fprintf(fp, <span class="stringliteral">&quot;patient_birth_date := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ab803645ef6896ad52033966c67ef985c">patient_birth_date</a>);
<a name="l00093"></a>00093   fprintf(fp, <span class="stringliteral">&quot;physician_name := %.32s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a14b5bcdff318fa65d2d95126ebc550fc">physician_name</a>);
<a name="l00094"></a>00094   fprintf(fp, <span class="stringliteral">&quot;operator_name := %.32s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a973da5bf47d9376aff843b93e125156a">operator_name</a>);
<a name="l00095"></a>00095   fprintf(fp, <span class="stringliteral">&quot;study_description := %.32s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a08d61531e0bfce977dd5542f175925d9">study_description</a>);
<a name="l00096"></a>00096   fprintf(fp, <span class="stringliteral">&quot;acquisition_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a8cb7331fc88e1dbd17e0f403f4d7ae8e">acquisition_type</a>,
<a name="l00097"></a>00097     <a class="code" href="ecat7p_8c.html#a678be687d746330004c5b3f71f05a928">ecat7acquisitiontype</a>(h-&gt;<a class="code" href="structecat7__mainheader.html#a8cb7331fc88e1dbd17e0f403f4d7ae8e">acquisition_type</a>));
<a name="l00098"></a>00098   fprintf(fp, <span class="stringliteral">&quot;patient_orientation := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a1815f9e0d0083df1ba25af49d033d202">patient_orientation</a>);
<a name="l00099"></a>00099   fprintf(fp, <span class="stringliteral">&quot;facility_name := %.20s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a2db57a2b51c8d87a9ab9ff09a811c556">facility_name</a>);
<a name="l00100"></a>00100   fprintf(fp, <span class="stringliteral">&quot;num_planes := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#aacea3a6d9b88add8710823f1c17acc37">num_planes</a>);
<a name="l00101"></a>00101   fprintf(fp, <span class="stringliteral">&quot;num_frames := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a7df83de0bdabd7ebf190e1a58bfc2e20">num_frames</a>);
<a name="l00102"></a>00102   fprintf(fp, <span class="stringliteral">&quot;num_gates := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a45cd434d5473194ffdbb27c99d9d7e6a">num_gates</a>);
<a name="l00103"></a>00103   fprintf(fp, <span class="stringliteral">&quot;num_bed_pos := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#acd90030d2317a4af5583431115b21a4a">num_bed_pos</a>);
<a name="l00104"></a>00104   fprintf(fp, <span class="stringliteral">&quot;init_bed_position := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a8a6bbcaf85225c67f8bfa5e564318e79">init_bed_position</a>);
<a name="l00105"></a>00105   fprintf(fp, <span class="stringliteral">&quot;bed_position :=&quot;</span>);
<a name="l00106"></a>00106   <span class="keywordflow">for</span>(i=0; i&lt;15; i++) fprintf(fp, <span class="stringliteral">&quot; %g&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#af66557399c7d155de452a077228fea71">bed_position</a>[i]);
<a name="l00107"></a>00107   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00108"></a>00108   fprintf(fp, <span class="stringliteral">&quot;plane_separation := %g cm\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a786937fcd3117a9d287da4636e3c0f37">plane_separation</a>);
<a name="l00109"></a>00109   fprintf(fp, <span class="stringliteral">&quot;lwr_sctr_thres := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ae649a9fa654b298d7d06d6cfd1648e9c">lwr_sctr_thres</a>);
<a name="l00110"></a>00110   fprintf(fp, <span class="stringliteral">&quot;lwr_true_thres := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ae07a9464fb11913d993a7ce9aaac588f">lwr_true_thres</a>);
<a name="l00111"></a>00111   fprintf(fp, <span class="stringliteral">&quot;upr_true_thres := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a4f229882ef975488024b05405f56d3ba">upr_true_thres</a>);
<a name="l00112"></a>00112   fprintf(fp, <span class="stringliteral">&quot;user_process_code := %.10s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a957502542c1a109b52a59af75ebcb27e">user_process_code</a>);
<a name="l00113"></a>00113   fprintf(fp, <span class="stringliteral">&quot;acquisition_mode := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#ab04f1792d0c7f628dd8e05c5a8f38363">acquisition_mode</a>);
<a name="l00114"></a>00114   fprintf(fp, <span class="stringliteral">&quot;bin_size := %g cm\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#abc625a3c1c4052d87e502bfca8599b8f">bin_size</a>);
<a name="l00115"></a>00115   fprintf(fp, <span class="stringliteral">&quot;branching_fraction := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#aca100a7dd48d4b56c1ec7028716c6a68">branching_fraction</a>);
<a name="l00116"></a>00116   lt=(time_t)h-&gt;<a class="code" href="structecat7__mainheader.html#a7d6f47d203ff147bd73cebe41167474c">dose_start_time</a>; st=localtime(&amp;lt);
<a name="l00117"></a>00117   <span class="keywordflow">if</span>(st!=NULL) strftime(tmp, 32, <span class="stringliteral">&quot;%Y-%m-%d %H:%M:%S&quot;</span>, st); <span class="comment">/* %T did not work with Mingw */</span>
<a name="l00118"></a>00118   <span class="keywordflow">else</span> strcpy(tmp, <span class="stringliteral">&quot;1900-01-01 00:00:00&quot;</span>);
<a name="l00119"></a>00119   fprintf(fp, <span class="stringliteral">&quot;dose_start_time := %s\n&quot;</span>, tmp);
<a name="l00120"></a>00120   fprintf(fp, <span class="stringliteral">&quot;dosage := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a002205eea64b6f6be8a8c254c8a6b95f">dosage</a>);
<a name="l00121"></a>00121   fprintf(fp, <span class="stringliteral">&quot;well_counter_corr_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a0d4893dd1647140f775698b5649223d4">well_counter_corr_factor</a>);
<a name="l00122"></a>00122   fprintf(fp, <span class="stringliteral">&quot;data_units := %.32s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#aa6bbc6d3bc1a60f51dd721db2c3be09d">data_units</a>);
<a name="l00123"></a>00123   fprintf(fp, <span class="stringliteral">&quot;septa_state := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#abb92c232a653327ce7a089be23f6df09">septa_state</a>);
<a name="l00124"></a>00124   fprintf(fp, <span class="stringliteral">&quot;fill_cti :=&quot;</span>);
<a name="l00125"></a>00125   <span class="keywordflow">for</span>(i=0; i&lt;6; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__mainheader.html#a5766625b9e684946431b919aff7426b9">fill_cti</a>[i]);
<a name="l00126"></a>00126   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128 <span class="comment">/*****************************************************************************/</span>
<a name="l00129"></a>00129 
<a name="l00130"></a>00130 <span class="comment">/*****************************************************************************/</span>
<a name="l00137"></a><a class="code" href="ecat7_8h.html#a0854c4b26b52aba47971deb210c1a5a7">00137</a> <span class="keywordtype">void</span> <a class="code" href="ecat7p_8c.html#a0854c4b26b52aba47971deb210c1a5a7">ecat7PrintImageheader</a>(<a class="code" href="structecat7__imageheader.html">ECAT7_imageheader</a> *h, FILE *fp) {
<a name="l00138"></a>00138   <span class="keywordtype">int</span> i;
<a name="l00139"></a>00139 
<a name="l00140"></a>00140   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>) fprintf(stdout, <span class="stringliteral">&quot;ecat7PrintImageheader()\n&quot;</span>);
<a name="l00141"></a>00141   fprintf(fp, <span class="stringliteral">&quot;data_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a9b90dc8511beaf487a57afc61044d09a">data_type</a>,
<a name="l00142"></a>00142     <a class="code" href="ecat7p_8c.html#acf623faacbc8b3010be3c91d6a573fb6">ecat7datatype</a>(h-&gt;<a class="code" href="structecat7__imageheader.html#a9b90dc8511beaf487a57afc61044d09a">data_type</a>) );
<a name="l00143"></a>00143   fprintf(fp, <span class="stringliteral">&quot;num_dimensions := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#acabca0e942a462b769c59804250b9a1c">num_dimensions</a>);
<a name="l00144"></a>00144   fprintf(fp, <span class="stringliteral">&quot;x_dimension := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a37550f6ce6a114de12aa0d038f573230">x_dimension</a>);
<a name="l00145"></a>00145   fprintf(fp, <span class="stringliteral">&quot;y_dimension := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a217d17f8b1f921fad128ce923fa21c35">y_dimension</a>);
<a name="l00146"></a>00146   fprintf(fp, <span class="stringliteral">&quot;z_dimension := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a7d4bc496c4aa5581d41dff3e5b40a231">z_dimension</a>);
<a name="l00147"></a>00147   fprintf(fp, <span class="stringliteral">&quot;x_offset := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a340a9f9df62d09e5ea8deefd64fec57d">x_offset</a>);
<a name="l00148"></a>00148   fprintf(fp, <span class="stringliteral">&quot;y_offset := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ad8fcacd511c334e938839c2a7730bbc3">y_offset</a>);
<a name="l00149"></a>00149   fprintf(fp, <span class="stringliteral">&quot;z_offset := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ab08e016d3c4fb780aeb1048398308254">z_offset</a>);
<a name="l00150"></a>00150   fprintf(fp, <span class="stringliteral">&quot;recon_zoom := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a7290c1acb6f8263f85492e3b5c44cdc9">recon_zoom</a>);
<a name="l00151"></a>00151   fprintf(fp, <span class="stringliteral">&quot;scale_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a2e44d8de4b5809864432376f713968ec">scale_factor</a>);
<a name="l00152"></a>00152   fprintf(fp, <span class="stringliteral">&quot;image_min := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ad599fd1c46c31b598fb2a6f376d562eb">image_min</a>);
<a name="l00153"></a>00153   fprintf(fp, <span class="stringliteral">&quot;image_max := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a08e876d5e60f96c5b90fc99eeedde10f">image_max</a>);
<a name="l00154"></a>00154   fprintf(fp, <span class="stringliteral">&quot;x_pixel_size := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a3f2c13786fd5e912c31f481f1b48cff3">x_pixel_size</a>);
<a name="l00155"></a>00155   fprintf(fp, <span class="stringliteral">&quot;y_pixel_size := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#aefd3bbd592bedba8d68dbec20d855586">y_pixel_size</a>);
<a name="l00156"></a>00156   fprintf(fp, <span class="stringliteral">&quot;z_pixel_size := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a404d5327064305a7a9dfe75831b29581">z_pixel_size</a>);
<a name="l00157"></a>00157   fprintf(fp, <span class="stringliteral">&quot;frame_duration := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ae75244f1e5532bb257095e7583ef79a3">frame_duration</a>);
<a name="l00158"></a>00158   fprintf(fp, <span class="stringliteral">&quot;frame_start_time := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a5fb0b8e2eec4391ed600f0efa4666631">frame_start_time</a>);
<a name="l00159"></a>00159   fprintf(fp, <span class="stringliteral">&quot;filter_code := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ad5bd2f0c18209cb80d17c9ccabd44753">filter_code</a>);
<a name="l00160"></a>00160   fprintf(fp, <span class="stringliteral">&quot;x_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a94c84cc00c6100c166167eaf0d4d34c9">x_resolution</a>);
<a name="l00161"></a>00161   fprintf(fp, <span class="stringliteral">&quot;y_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a88478cdda647f217f81ba4fe753f8602">y_resolution</a>);
<a name="l00162"></a>00162   fprintf(fp, <span class="stringliteral">&quot;z_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#aa0599cfeedd3708b353ef027f281657d">z_resolution</a>);
<a name="l00163"></a>00163   fprintf(fp, <span class="stringliteral">&quot;num_r_elements := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a8649bac62fab217d1b49131a6bbeaffa">num_r_elements</a>);
<a name="l00164"></a>00164   fprintf(fp, <span class="stringliteral">&quot;num_angles := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a046f5ff250412ec423b6ee43b8cf1496">num_angles</a>);
<a name="l00165"></a>00165   fprintf(fp, <span class="stringliteral">&quot;z_rotation_angle := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ac9bdf6594e830a86e04f92e8c5603225">z_rotation_angle</a>);
<a name="l00166"></a>00166   fprintf(fp, <span class="stringliteral">&quot;decay_corr_fctr := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a753cec72803431b0b3ecf130b2fee645">decay_corr_fctr</a>);
<a name="l00167"></a>00167   fprintf(fp, <span class="stringliteral">&quot;processing_code := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a6e617bc2f7f9ddd225af3946198e2d06">processing_code</a>);
<a name="l00168"></a>00168   fprintf(fp, <span class="stringliteral">&quot;gate_duration := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a5f8654cf5e2a615ee18a0b2226ae2b36">gate_duration</a>);
<a name="l00169"></a>00169   fprintf(fp, <span class="stringliteral">&quot;r_wave_offset := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#af2652b5447df30fa1198d34a2a6c1a81">r_wave_offset</a>);
<a name="l00170"></a>00170   fprintf(fp, <span class="stringliteral">&quot;num_accepted_beats := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a9562593e2089ae493975e4770c455038">num_accepted_beats</a>);
<a name="l00171"></a>00171   fprintf(fp, <span class="stringliteral">&quot;filter_cutoff_frequency := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#afbe5e1b92387d70242a64e0253c8d196">filter_cutoff_frequency</a>);
<a name="l00172"></a>00172   fprintf(fp, <span class="stringliteral">&quot;filter_resolution := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a92cbc1f31172ccde80cfbc74763c6bc7">filter_resolution</a>);
<a name="l00173"></a>00173   fprintf(fp, <span class="stringliteral">&quot;filter_ramp_slope := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#aab3e31ea98f55be2dc136b6d38c6084c">filter_ramp_slope</a>);
<a name="l00174"></a>00174   fprintf(fp, <span class="stringliteral">&quot;filter_order := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a09d1048e2e74c28630242ffa98270ed0">filter_order</a>);
<a name="l00175"></a>00175   fprintf(fp, <span class="stringliteral">&quot;filter_scatter_fraction := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ac8b2021a00f2c1acd43213ae780e9993">filter_scatter_fraction</a>);
<a name="l00176"></a>00176   fprintf(fp, <span class="stringliteral">&quot;filter_scatter_slope := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a26a5abf25a440aee0f0adfe0eb5a781b">filter_scatter_slope</a>);
<a name="l00177"></a>00177   fprintf(fp, <span class="stringliteral">&quot;annotation := %.40s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ad5ed4d561b195452ddb325baab3adbb2">annotation</a>);
<a name="l00178"></a>00178   fprintf(fp, <span class="stringliteral">&quot;mt_1_1 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a5ab2348c59531dd764f4b659aaf4f75d">mt_1_1</a>);
<a name="l00179"></a>00179   fprintf(fp, <span class="stringliteral">&quot;mt_1_2 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a0b84bc9d478661de5916723009b846c6">mt_1_2</a>);
<a name="l00180"></a>00180   fprintf(fp, <span class="stringliteral">&quot;mt_1_3 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ac6112b47c4727d97a00927ec2cd66e08">mt_1_3</a>);
<a name="l00181"></a>00181   fprintf(fp, <span class="stringliteral">&quot;mt_2_1 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a9aa22eb676327cd80cc852f1da66b2e9">mt_2_1</a>);
<a name="l00182"></a>00182   fprintf(fp, <span class="stringliteral">&quot;mt_2_2 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a0387c09ae6ce5366bd9f557666807db1">mt_2_2</a>);
<a name="l00183"></a>00183   fprintf(fp, <span class="stringliteral">&quot;mt_2_3 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a9f12cf3a77cbec5884db289e3f671b88">mt_2_3</a>);
<a name="l00184"></a>00184   fprintf(fp, <span class="stringliteral">&quot;mt_3_1 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a93f68b4a932241c32442675541b5eafa">mt_3_1</a>);
<a name="l00185"></a>00185   fprintf(fp, <span class="stringliteral">&quot;mt_3_2 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a3ff42a2285fff0e821df591aaf089491">mt_3_2</a>);
<a name="l00186"></a>00186   fprintf(fp, <span class="stringliteral">&quot;mt_3_3 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#af571054289d88e95552f0a792667b84f">mt_3_3</a>);
<a name="l00187"></a>00187   fprintf(fp, <span class="stringliteral">&quot;rfilter_cutoff := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#af1a33983eb2c35e26f2ca2531b092d64">rfilter_cutoff</a>);
<a name="l00188"></a>00188   fprintf(fp, <span class="stringliteral">&quot;rfilter_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ab3eaa110df4b571b92924dd94826f3c0">rfilter_resolution</a>);
<a name="l00189"></a>00189   fprintf(fp, <span class="stringliteral">&quot;rfilter_code := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a2ffc2cb4c75c295a5e58af8592ce9a4c">rfilter_code</a>);
<a name="l00190"></a>00190   fprintf(fp, <span class="stringliteral">&quot;rfilter_order := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a847e512ab018e42b37430b291f2a6e1b">rfilter_order</a>);
<a name="l00191"></a>00191   fprintf(fp, <span class="stringliteral">&quot;zfilter_cutoff := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a574df5d81d5b1ab3b5b0ada42c976dbe">zfilter_cutoff</a>);
<a name="l00192"></a>00192   fprintf(fp, <span class="stringliteral">&quot;zfilter_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#aacfbdbd324b30a3b319eeca5bbeeee12">zfilter_resolution</a>);
<a name="l00193"></a>00193   fprintf(fp, <span class="stringliteral">&quot;zfilter_code := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ae90d91c961a0ddaca2e1e3bbd77095c7">zfilter_code</a>);
<a name="l00194"></a>00194   fprintf(fp, <span class="stringliteral">&quot;zfilter_order := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a8f7008e7dbfe7e4a7121c254375f0f47">zfilter_order</a>);
<a name="l00195"></a>00195   fprintf(fp, <span class="stringliteral">&quot;mt_1_4 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ae68e680639ac505c93d21ec447481ebf">mt_1_4</a>);
<a name="l00196"></a>00196   fprintf(fp, <span class="stringliteral">&quot;mt_2_4 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#adcd2dc3fbd8ded9a1ed5f8d1e85dbda8">mt_2_4</a>);
<a name="l00197"></a>00197   fprintf(fp, <span class="stringliteral">&quot;mt_3_4 := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ae3481c71f0ab8a1895d37fc7de71ed80">mt_3_4</a>);
<a name="l00198"></a>00198   fprintf(fp, <span class="stringliteral">&quot;scatter_type := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a26e3211da4e7bdee598a912f59bbd80c">scatter_type</a>);
<a name="l00199"></a>00199   fprintf(fp, <span class="stringliteral">&quot;recon_type := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a060576c7efe995f93a17fb73881b6607">recon_type</a>);
<a name="l00200"></a>00200   fprintf(fp, <span class="stringliteral">&quot;recon_views := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ae67f441f35e6b40499b03fca8a7d3d90">recon_views</a>);
<a name="l00201"></a>00201   fprintf(fp, <span class="stringliteral">&quot;fill_cti :=&quot;</span>);
<a name="l00202"></a>00202   <span class="keywordflow">for</span>(i=0; i&lt;87; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#a70ba01c4d16b5c5e5ad7b6a2143aba4c">fill_cti</a>[i]); fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00203"></a>00203   fprintf(fp, <span class="stringliteral">&quot;fill_user :=&quot;</span>);
<a name="l00204"></a>00204   <span class="keywordflow">for</span>(i=0; i&lt;49; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__imageheader.html#ac7858af3c6aeab6ee47867cba833e0a9">fill_user</a>[i]); fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206 <span class="comment">/*****************************************************************************/</span>
<a name="l00207"></a>00207 
<a name="l00208"></a>00208 <span class="comment">/*****************************************************************************/</span>
<a name="l00215"></a><a class="code" href="ecat7_8h.html#ade61cec0f7e15550290193ef0d6e26cc">00215</a> <span class="keywordtype">void</span> <a class="code" href="ecat7p_8c.html#ade61cec0f7e15550290193ef0d6e26cc">ecat7PrintScanheader</a>(<a class="code" href="structecat7__scanheader.html">ECAT7_scanheader</a> *h, FILE *fp) {
<a name="l00216"></a>00216   <span class="keywordtype">int</span> i;
<a name="l00217"></a>00217 
<a name="l00218"></a>00218   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>) fprintf(stdout, <span class="stringliteral">&quot;ecat7PrintScanheader()\n&quot;</span>);
<a name="l00219"></a>00219   fprintf(fp, <span class="stringliteral">&quot;data_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#ac1dfbebf9227256db4dd3ec96a95277f">data_type</a>,
<a name="l00220"></a>00220     <a class="code" href="ecat7p_8c.html#acf623faacbc8b3010be3c91d6a573fb6">ecat7datatype</a>(h-&gt;<a class="code" href="structecat7__scanheader.html#ac1dfbebf9227256db4dd3ec96a95277f">data_type</a>) );
<a name="l00221"></a>00221   fprintf(fp, <span class="stringliteral">&quot;num_dimensions := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a4b4361b122c74cfd1c7171357615a2a4">num_dimensions</a>);
<a name="l00222"></a>00222   fprintf(fp, <span class="stringliteral">&quot;num_r_elements := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#aee3fd0c2360973b3d53ad1adf6225d7d">num_r_elements</a>);
<a name="l00223"></a>00223   fprintf(fp, <span class="stringliteral">&quot;num_angles := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a4f58fe54c66427d34390f6530a12f8ed">num_angles</a>);
<a name="l00224"></a>00224   fprintf(fp, <span class="stringliteral">&quot;corrections_applied := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a18d65465164971f7dcdfe5b251b6c244">corrections_applied</a>);
<a name="l00225"></a>00225   fprintf(fp, <span class="stringliteral">&quot;num_z_elements :=&quot;</span>);
<a name="l00226"></a>00226   <span class="keywordflow">for</span>(i=0; i&lt;64; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a714bae4e56b451926ceeb0de19222ad7">num_z_elements</a>[i]);
<a name="l00227"></a>00227   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00228"></a>00228   fprintf(fp, <span class="stringliteral">&quot;ring_difference := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#ae0d7a41a8f2790fe97d7784367f8daba">ring_difference</a>);
<a name="l00229"></a>00229   fprintf(fp, <span class="stringliteral">&quot;storage_order := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#af0fcf4af875d58acf97d1b412d0299b5">storage_order</a>);
<a name="l00230"></a>00230   fprintf(fp, <span class="stringliteral">&quot;axial_compression := %d (span)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#ad0c5b2146bf087faa53cafd30be60aad">axial_compression</a>);
<a name="l00231"></a>00231   fprintf(fp, <span class="stringliteral">&quot;x_resolution := %g cm\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a3b20e770bbcc8bc038190aab1d777199">x_resolution</a>);
<a name="l00232"></a>00232   fprintf(fp, <span class="stringliteral">&quot;v_resolution := %g rad\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a377740afa37d1774a1938a37354b5bde">v_resolution</a>);
<a name="l00233"></a>00233   fprintf(fp, <span class="stringliteral">&quot;z_resolution := %g cm\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a1e5bfef1c77d887f15aa6daada8464d7">z_resolution</a>);
<a name="l00234"></a>00234   fprintf(fp, <span class="stringliteral">&quot;w_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a3377bb6891117ab290ea776444caecf2">w_resolution</a>);
<a name="l00235"></a>00235   fprintf(fp, <span class="stringliteral">&quot;gate_duration := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a603f407610a5e2864bfda5c80152f9c9">gate_duration</a>);
<a name="l00236"></a>00236   fprintf(fp, <span class="stringliteral">&quot;r_wave_offset := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#ae2bdd51e3b0c9b838e77793eb71280d7">r_wave_offset</a>);
<a name="l00237"></a>00237   fprintf(fp, <span class="stringliteral">&quot;num_accepted_beats := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#ae80300a155f4fcf65cb0851ff8bfa122">num_accepted_beats</a>);
<a name="l00238"></a>00238   fprintf(fp, <span class="stringliteral">&quot;scale_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a77ed7b5edd51bf8feeea367ec4d143bb">scale_factor</a>);
<a name="l00239"></a>00239   fprintf(fp, <span class="stringliteral">&quot;scan_min := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#ae8d5fb305463d8a019b452068176c20c">scan_min</a>);
<a name="l00240"></a>00240   fprintf(fp, <span class="stringliteral">&quot;scan_max := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a6cad394ec364530cb33b335f1256fec1">scan_max</a>);
<a name="l00241"></a>00241   fprintf(fp, <span class="stringliteral">&quot;prompts := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a421bb8924e8aed2ef38ecc673b71a574">prompts</a>);
<a name="l00242"></a>00242   fprintf(fp, <span class="stringliteral">&quot;delayed := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a8f67a369e6ef599551b8271c08a8b5d7">delayed</a>);
<a name="l00243"></a>00243   fprintf(fp, <span class="stringliteral">&quot;multiples := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a7d8ff4b790f38d9e8be6bf83c4bd185d">multiples</a>);
<a name="l00244"></a>00244   fprintf(fp, <span class="stringliteral">&quot;net_trues := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a2e6e0eaff39c88e72fb766c85ebf5c07">net_trues</a>);
<a name="l00245"></a>00245   fprintf(fp, <span class="stringliteral">&quot;tot_avg_cor := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#aaa779c47e6e11a47795aee0c90437adf">tot_avg_cor</a>);
<a name="l00246"></a>00246   fprintf(fp, <span class="stringliteral">&quot;tot_avg_uncor := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a80ffd347fbe13b90be3264318d2cb754">tot_avg_uncor</a>);
<a name="l00247"></a>00247   fprintf(fp, <span class="stringliteral">&quot;total_coin_rate := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#afcd90f2a17b7af7f495e7ffd5a0a52a8">total_coin_rate</a>);
<a name="l00248"></a>00248   fprintf(fp, <span class="stringliteral">&quot;frame_start_time := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a73b5c4aae33a122d91703ce6a3330f89">frame_start_time</a>);
<a name="l00249"></a>00249   fprintf(fp, <span class="stringliteral">&quot;frame_duration := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#ae7eafb4bf000a8404407489dbd6b54ac">frame_duration</a>);
<a name="l00250"></a>00250   fprintf(fp, <span class="stringliteral">&quot;deadtime_correction_factor := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a97b2c1a33ab3c42a21aa9f1d3d9e21e7">deadtime_correction_factor</a>);
<a name="l00251"></a>00251   fprintf(fp, <span class="stringliteral">&quot;uncor_singles :=&quot;</span>);
<a name="l00252"></a>00252   <span class="keywordflow">for</span>(i=0; i&lt;128; i++) fprintf(fp, <span class="stringliteral">&quot; %g&quot;</span>, h-&gt;<a class="code" href="structecat7__scanheader.html#a30c149d12f3ee869d8303c8430fca0f0">uncor_singles</a>[i]);
<a name="l00253"></a>00253   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00254"></a>00254 }
<a name="l00255"></a>00255 <span class="comment">/*****************************************************************************/</span>
<a name="l00256"></a>00256 
<a name="l00257"></a>00257 <span class="comment">/*****************************************************************************/</span>
<a name="l00264"></a><a class="code" href="ecat7_8h.html#aa1193aee8e3546663ae8691f1649ee8f">00264</a> <span class="keywordtype">void</span> <a class="code" href="ecat7p_8c.html#aa1193aee8e3546663ae8691f1649ee8f">ecat7PrintAttenheader</a>(<a class="code" href="structecat7__attenheader.html">ECAT7_attenheader</a> *h, FILE *fp) {
<a name="l00265"></a>00265   <span class="keywordtype">int</span> i;
<a name="l00266"></a>00266 
<a name="l00267"></a>00267   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>) fprintf(stdout, <span class="stringliteral">&quot;ecat7PrintAttenheader()\n&quot;</span>);
<a name="l00268"></a>00268   fprintf(fp, <span class="stringliteral">&quot;data_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a1e279bd4817d0a7e940b796ebb901d39">data_type</a>,
<a name="l00269"></a>00269     <a class="code" href="ecat7p_8c.html#acf623faacbc8b3010be3c91d6a573fb6">ecat7datatype</a>(h-&gt;<a class="code" href="structecat7__attenheader.html#a1e279bd4817d0a7e940b796ebb901d39">data_type</a>) );
<a name="l00270"></a>00270   fprintf(fp, <span class="stringliteral">&quot;num_dimensions := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a26c4cf72bd2f93808c53113c45e23552">num_dimensions</a>);
<a name="l00271"></a>00271   fprintf(fp, <span class="stringliteral">&quot;attenuation_type := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a559039bce5d7432a2c1b2627400055ed">attenuation_type</a>);
<a name="l00272"></a>00272   fprintf(fp, <span class="stringliteral">&quot;num_r_elements := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#ab469110a7579b07996d48b7ec6367cc5">num_r_elements</a>);
<a name="l00273"></a>00273   fprintf(fp, <span class="stringliteral">&quot;num_angles := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a5b3cb8793edf2f160a1c8893b09ffa4e">num_angles</a>);
<a name="l00274"></a>00274   fprintf(fp, <span class="stringliteral">&quot;num_z_elements := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a78a581032441626011b5394a43bdf2af">num_z_elements</a>);
<a name="l00275"></a>00275   fprintf(fp, <span class="stringliteral">&quot;ring_difference := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#ab27975a4dbecf07f924abec9ca3022d2">ring_difference</a>);
<a name="l00276"></a>00276   fprintf(fp, <span class="stringliteral">&quot;x_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#ad25d43e88b93dc981f8d3dbc85b246a4">x_resolution</a>);
<a name="l00277"></a>00277   fprintf(fp, <span class="stringliteral">&quot;y_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a9f559f6c3fdde8d0bf93d110a9057b8b">y_resolution</a>);
<a name="l00278"></a>00278   fprintf(fp, <span class="stringliteral">&quot;z_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a409675e4d6361e84c616079c2316f061">z_resolution</a>);
<a name="l00279"></a>00279   fprintf(fp, <span class="stringliteral">&quot;w_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a9d90102a2f5032e260edbb5834dff17f">w_resolution</a>);
<a name="l00280"></a>00280   fprintf(fp, <span class="stringliteral">&quot;scale_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a6c90e753da243d94a24384873b0195b3">scale_factor</a>);
<a name="l00281"></a>00281   fprintf(fp, <span class="stringliteral">&quot;x_offset := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#adb7c3a7f9ad331e2e2d66ad397d1061e">x_offset</a>);
<a name="l00282"></a>00282   fprintf(fp, <span class="stringliteral">&quot;y_offset := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#af00ef016e4bec39cccb0566e0d1e1beb">y_offset</a>);
<a name="l00283"></a>00283   fprintf(fp, <span class="stringliteral">&quot;x_radius := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#aade44803290eb7c042e8db22b647c3f3">x_radius</a>);
<a name="l00284"></a>00284   fprintf(fp, <span class="stringliteral">&quot;y_radius := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a885d8e8ab2ce770cf193b4273d591de0">y_radius</a>);
<a name="l00285"></a>00285   fprintf(fp, <span class="stringliteral">&quot;tilt_angle := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a8ee01a9d388f1116b71395e62618ced1">tilt_angle</a>);
<a name="l00286"></a>00286   fprintf(fp, <span class="stringliteral">&quot;attenuation_coeff := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#acfdb1bdf8255158bf0ce77e6b2d682e3">attenuation_coeff</a>);
<a name="l00287"></a>00287   fprintf(fp, <span class="stringliteral">&quot;attenuation_min := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a6734bcf692194b4b2fe3477574549b04">attenuation_min</a>);
<a name="l00288"></a>00288   fprintf(fp, <span class="stringliteral">&quot;attenuation_max := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#abc998fff1d231a8c23ab7bd75e980289">attenuation_max</a>);
<a name="l00289"></a>00289   fprintf(fp, <span class="stringliteral">&quot;skull_thickness := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#ad5b24b2b096cbddc14a358ba21be77d2">skull_thickness</a>);
<a name="l00290"></a>00290   fprintf(fp, <span class="stringliteral">&quot;num_additional_atten_coeff := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#ac4a70cc92f5cd58fcd9c4d10757c04a0">num_additional_atten_coeff</a>);
<a name="l00291"></a>00291   fprintf(fp, <span class="stringliteral">&quot;additional_atten_coeff :=&quot;</span>);
<a name="l00292"></a>00292   <span class="keywordflow">for</span>(i=0; i&lt;8; i++) fprintf(fp, <span class="stringliteral">&quot; %E&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#ab71ff5127a01d22c4c376a82a128f926">additional_atten_coeff</a>[i]);
<a name="l00293"></a>00293   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00294"></a>00294   fprintf(fp, <span class="stringliteral">&quot;edge_finding_threshold := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a2ec9a53c0910ba896e41f486b479fd7c">edge_finding_threshold</a>);
<a name="l00295"></a>00295   fprintf(fp, <span class="stringliteral">&quot;storage_order := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#addc2063b495772262146f9385c294323">storage_order</a>);
<a name="l00296"></a>00296   fprintf(fp, <span class="stringliteral">&quot;span := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#a45d73fa0fd340f998265aaf15a123ba8">span</a>);
<a name="l00297"></a>00297   fprintf(fp, <span class="stringliteral">&quot;z_elements :=&quot;</span>);
<a name="l00298"></a>00298   <span class="keywordflow">for</span>(i=0; i&lt;64; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__attenheader.html#aeb743233aff66821f8cfbf3ec1f64d3b">z_elements</a>[i]);
<a name="l00299"></a>00299   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00300"></a>00300 }
<a name="l00301"></a>00301 <span class="comment">/*****************************************************************************/</span>
<a name="l00302"></a>00302 
<a name="l00303"></a>00303 <span class="comment">/*****************************************************************************/</span>
<a name="l00310"></a><a class="code" href="ecat7_8h.html#a7b20d17081345d4f4ede5d4791e18e31">00310</a> <span class="keywordtype">void</span> <a class="code" href="ecat7p_8c.html#a7b20d17081345d4f4ede5d4791e18e31">ecat7PrintPolmapheader</a>(<a class="code" href="structecat7__polmapheader.html">ECAT7_polmapheader</a> *h, FILE *fp) {
<a name="l00311"></a>00311   <span class="keywordtype">int</span> i;
<a name="l00312"></a>00312 
<a name="l00313"></a>00313   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>) fprintf(stdout, <span class="stringliteral">&quot;ecat7PrintPolmapheader()\n&quot;</span>);
<a name="l00314"></a>00314   fprintf(fp, <span class="stringliteral">&quot;data_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a85514ffcdb6dc106fe8d742bcb248947">data_type</a>,
<a name="l00315"></a>00315     <a class="code" href="ecat7p_8c.html#acf623faacbc8b3010be3c91d6a573fb6">ecat7datatype</a>(h-&gt;<a class="code" href="structecat7__polmapheader.html#a85514ffcdb6dc106fe8d742bcb248947">data_type</a>) );
<a name="l00316"></a>00316   fprintf(fp, <span class="stringliteral">&quot;polar_map_type := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a1c42cbb82e3d3abdea6eab7893e3151f">polar_map_type</a>);
<a name="l00317"></a>00317   fprintf(fp, <span class="stringliteral">&quot;num_rings := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a503caad4ac64580ff3508463ae8e2342">num_rings</a>);
<a name="l00318"></a>00318   fprintf(fp, <span class="stringliteral">&quot;sectors_per_ring :=&quot;</span>);
<a name="l00319"></a>00319   <span class="keywordflow">for</span>(i=0; i&lt;32; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a7888f1b2bc8adcc5bcbf918bbbb82dbb">sectors_per_ring</a>[i]);
<a name="l00320"></a>00320   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00321"></a>00321   fprintf(fp, <span class="stringliteral">&quot;ring_position :=&quot;</span>);
<a name="l00322"></a>00322   <span class="keywordflow">for</span>(i=0; i&lt;32; i++) fprintf(fp, <span class="stringliteral">&quot; %g&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a1f8b29deb85540e9d4d30d9a8247c0d6">ring_position</a>[i]);
<a name="l00323"></a>00323   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00324"></a>00324   fprintf(fp, <span class="stringliteral">&quot;ring_angle :=&quot;</span>);
<a name="l00325"></a>00325   <span class="keywordflow">for</span>(i=0; i&lt;32; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#af91ac7e401a999aaaaf275c8671ad0ab">ring_angle</a>[i]);
<a name="l00326"></a>00326   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00327"></a>00327   fprintf(fp, <span class="stringliteral">&quot;start_angle := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#ad59dd3b498ddd78aa65a6cf4425d259a">start_angle</a>);
<a name="l00328"></a>00328   fprintf(fp, <span class="stringliteral">&quot;long_axis_left :=&quot;</span>);
<a name="l00329"></a>00329   <span class="keywordflow">for</span>(i=0; i&lt;3; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#aabc620f253f9b5bc777f1848d8300e5e">long_axis_left</a>[i]);
<a name="l00330"></a>00330   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00331"></a>00331   fprintf(fp, <span class="stringliteral">&quot;long_axis_right :=&quot;</span>);
<a name="l00332"></a>00332   <span class="keywordflow">for</span>(i=0; i&lt;3; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#af9716ddc7fc52ecbf3980dfd38b4fbd3">long_axis_right</a>[i]);
<a name="l00333"></a>00333   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00334"></a>00334   fprintf(fp, <span class="stringliteral">&quot;position_data := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#af4ebf16c597dd432ffb78c267137c40c">position_data</a>);
<a name="l00335"></a>00335   fprintf(fp, <span class="stringliteral">&quot;image_min := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#ac955d5b0a42d9a35011f0a9687db1ee7">image_min</a>);
<a name="l00336"></a>00336   fprintf(fp, <span class="stringliteral">&quot;image_max := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a402864bf8af8ab091faf877d831cb7ef">image_max</a>);
<a name="l00337"></a>00337   fprintf(fp, <span class="stringliteral">&quot;scale_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#ad2f57edc57a8a6f328e19ab35502eb20">scale_factor</a>);
<a name="l00338"></a>00338   fprintf(fp, <span class="stringliteral">&quot;pixel_size := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a4a7a70570769b6b97bf67f6358a61f45">pixel_size</a>);
<a name="l00339"></a>00339   fprintf(fp, <span class="stringliteral">&quot;frame_duration := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#af2c0109195bbcc833521aed329d2bd83">frame_duration</a>);
<a name="l00340"></a>00340   fprintf(fp, <span class="stringliteral">&quot;frame_start_time := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#ac7757667731f12beb6c6e8a584dd6682">frame_start_time</a>);
<a name="l00341"></a>00341   fprintf(fp, <span class="stringliteral">&quot;processing_code := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a1b6921694ee32fdda5e5c4b1a64f733b">processing_code</a>);
<a name="l00342"></a>00342   fprintf(fp, <span class="stringliteral">&quot;quant_units := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#aa4b2dda11a8f10a58a77307ffbf28805">quant_units</a>);
<a name="l00343"></a>00343   fprintf(fp, <span class="stringliteral">&quot;annotation := %.40s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a873c092e019a8919b5b82030ed29f6a5">annotation</a>);
<a name="l00344"></a>00344   fprintf(fp, <span class="stringliteral">&quot;gate_duration := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a87bdb3bf6e644c357290c320166e068f">gate_duration</a>);
<a name="l00345"></a>00345   fprintf(fp, <span class="stringliteral">&quot;r_wave_offset := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a8a17116a1e9c4a1df60eb9f709b5d03e">r_wave_offset</a>);
<a name="l00346"></a>00346   fprintf(fp, <span class="stringliteral">&quot;num_accepted_beats := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#aae8015e83f96723de1bffab0cf44b2b3">num_accepted_beats</a>);
<a name="l00347"></a>00347   fprintf(fp, <span class="stringliteral">&quot;polar_map_protocol := %.20s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#ac6a9017cce528db97e827de264aa3142">polar_map_protocol</a>);
<a name="l00348"></a>00348   fprintf(fp, <span class="stringliteral">&quot;database_name := %.30s\n&quot;</span>, h-&gt;<a class="code" href="structecat7__polmapheader.html#a65ab9e055aedc38c33d62fb6ebf05589">database_name</a>);
<a name="l00349"></a>00349 }
<a name="l00350"></a>00350 <span class="comment">/*****************************************************************************/</span>
<a name="l00351"></a>00351 
<a name="l00352"></a>00352 <span class="comment">/*****************************************************************************/</span>
<a name="l00359"></a><a class="code" href="ecat7_8h.html#a07df33f30bcc8232de1fce513774dc69">00359</a> <span class="keywordtype">void</span> <a class="code" href="ecat7p_8c.html#a07df33f30bcc8232de1fce513774dc69">ecat7PrintNormheader</a>(<a class="code" href="structecat7__normheader.html">ECAT7_normheader</a> *h, FILE *fp) {
<a name="l00360"></a>00360   <span class="keywordtype">int</span> i;
<a name="l00361"></a>00361 
<a name="l00362"></a>00362   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>) fprintf(stdout, <span class="stringliteral">&quot;ecat7PrintNormheader()\n&quot;</span>);
<a name="l00363"></a>00363   fprintf(fp, <span class="stringliteral">&quot;data_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#aed9b4cb1c561d080a8336baf7c80fdcc">data_type</a>,
<a name="l00364"></a>00364     <a class="code" href="ecat7p_8c.html#acf623faacbc8b3010be3c91d6a573fb6">ecat7datatype</a>(h-&gt;<a class="code" href="structecat7__normheader.html#aed9b4cb1c561d080a8336baf7c80fdcc">data_type</a>) );
<a name="l00365"></a>00365   fprintf(fp, <span class="stringliteral">&quot;num_r_elements := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#ad44f4013947a523f61f406ab26f2e44a">num_r_elements</a>);
<a name="l00366"></a>00366   fprintf(fp, <span class="stringliteral">&quot;num_transaxial_crystals := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#aa8d1e9e258ad69f1d1af98d30c7a6cf5">num_transaxial_crystals</a>);
<a name="l00367"></a>00367   fprintf(fp, <span class="stringliteral">&quot;num_crystal_rings := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a3cdec5a8adfe16d0d8fcebcfcdbc4d48">num_crystal_rings</a>);
<a name="l00368"></a>00368   fprintf(fp, <span class="stringliteral">&quot;crystals_per_ring := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#aaf63afdf4ccafc47626d7075dbb7727c">crystals_per_ring</a>);
<a name="l00369"></a>00369   fprintf(fp, <span class="stringliteral">&quot;num_geo_corr_planes := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a7ae2012feb0d317925f54c719c6023bb">num_geo_corr_planes</a>);
<a name="l00370"></a>00370   fprintf(fp, <span class="stringliteral">&quot;uld := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#aaa65ed681794afc0f8c67b65f05febfb">uld</a>);
<a name="l00371"></a>00371   fprintf(fp, <span class="stringliteral">&quot;lld := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a64e2d29a3fd63691aa5fd129a32c32f5">lld</a>);
<a name="l00372"></a>00372   fprintf(fp, <span class="stringliteral">&quot;scatter_energy := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a7835b4239c66f51f97b0d96c45ce862e">scatter_energy</a>);
<a name="l00373"></a>00373   fprintf(fp, <span class="stringliteral">&quot;norm_quality_factor := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a6cb5155206d5f40b4dc6363482364f5a">norm_quality_factor</a>);
<a name="l00374"></a>00374   fprintf(fp, <span class="stringliteral">&quot;norm_quality_factor_code := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a71f98c8e0270a3b738a8228a130e6e4a">norm_quality_factor_code</a>);
<a name="l00375"></a>00375   fprintf(fp, <span class="stringliteral">&quot;ring_dtcor1 :=&quot;</span>);
<a name="l00376"></a>00376   <span class="keywordflow">for</span>(i=0; i&lt;32; i++) fprintf(fp, <span class="stringliteral">&quot; %E&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a981b1ecafed3fc8ffb6027ffa4e37d0d">ring_dtcor1</a>[i]);
<a name="l00377"></a>00377   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00378"></a>00378   fprintf(fp, <span class="stringliteral">&quot;ring_dtcor2 :=&quot;</span>);
<a name="l00379"></a>00379   <span class="keywordflow">for</span>(i=0; i&lt;32; i++) fprintf(fp, <span class="stringliteral">&quot; %E&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#aca206f1d98356df2cd4ab06bb4b25de0">ring_dtcor2</a>[i]);
<a name="l00380"></a>00380   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00381"></a>00381   fprintf(fp, <span class="stringliteral">&quot;crystal_dtcor :=&quot;</span>);
<a name="l00382"></a>00382   <span class="keywordflow">for</span>(i=0; i&lt;8; i++) fprintf(fp, <span class="stringliteral">&quot; %E&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#acf7f342012459796cfea425e7e9faf7f">crystal_dtcor</a>[i]);
<a name="l00383"></a>00383   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00384"></a>00384   fprintf(fp, <span class="stringliteral">&quot;span := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a83cc022237d464480c1696fece19729f">span</a>);
<a name="l00385"></a>00385   fprintf(fp, <span class="stringliteral">&quot;max_ring_diff := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__normheader.html#a7dd4601b4e06fb51df9e6a09d3287154">max_ring_diff</a>);
<a name="l00386"></a>00386 }
<a name="l00387"></a>00387 <span class="comment">/*****************************************************************************/</span>
<a name="l00388"></a>00388 
<a name="l00389"></a>00389 <span class="comment">/*****************************************************************************/</span>
<a name="l00396"></a><a class="code" href="ecat7_8h.html#aaa6831e8494e81833098b42b37e3f96a">00396</a> <span class="keywordtype">void</span> <a class="code" href="ecat7p_8c.html#aaa6831e8494e81833098b42b37e3f96a">ecat7Print2DScanheader</a>(<a class="code" href="structecat7__2Dscanheader.html">ECAT7_2Dscanheader</a> *h, FILE *fp) {
<a name="l00397"></a>00397   <span class="keywordtype">int</span> i;
<a name="l00398"></a>00398 
<a name="l00399"></a>00399   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>) fprintf(stdout, <span class="stringliteral">&quot;ecat7Print2DScanheader()\n&quot;</span>);
<a name="l00400"></a>00400   fprintf(fp, <span class="stringliteral">&quot;data_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#aa13b8697f5c56f7e31e942cafb91bddc">data_type</a>,
<a name="l00401"></a>00401     <a class="code" href="ecat7p_8c.html#acf623faacbc8b3010be3c91d6a573fb6">ecat7datatype</a>(h-&gt;<a class="code" href="structecat7__2Dscanheader.html#aa13b8697f5c56f7e31e942cafb91bddc">data_type</a>) );
<a name="l00402"></a>00402   fprintf(fp, <span class="stringliteral">&quot;num_dimensions := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a592447ad964ba95e2a29a7d3d2284576">num_dimensions</a>);
<a name="l00403"></a>00403   fprintf(fp, <span class="stringliteral">&quot;num_r_elements := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#adfe07cff44e3145ca65c234079ff255a">num_r_elements</a>);
<a name="l00404"></a>00404   fprintf(fp, <span class="stringliteral">&quot;num_angles := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#ad0d1958b231f10aa68d60c653ec30627">num_angles</a>);
<a name="l00405"></a>00405   fprintf(fp, <span class="stringliteral">&quot;corrections_applied := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a8c126cf20e0b59765720d52fbfbf92d9">corrections_applied</a>);
<a name="l00406"></a>00406   fprintf(fp, <span class="stringliteral">&quot;num_z_elements := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a697bb7a95d88bce42bf80e2d6bd69037">num_z_elements</a>);
<a name="l00407"></a>00407   fprintf(fp, <span class="stringliteral">&quot;ring_difference := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a6a37718cdfb000b2724062232ecadcf6">ring_difference</a>);
<a name="l00408"></a>00408   fprintf(fp, <span class="stringliteral">&quot;x_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a77e48781a4d1eda3cd828fdc2c3b1a62">x_resolution</a>);
<a name="l00409"></a>00409   fprintf(fp, <span class="stringliteral">&quot;y_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#ab4d6c7e3cdd71cf5edb222956600083b">y_resolution</a>);
<a name="l00410"></a>00410   fprintf(fp, <span class="stringliteral">&quot;z_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#aed6ef090a59741c23fc97dec8eb6e17a">z_resolution</a>);
<a name="l00411"></a>00411   fprintf(fp, <span class="stringliteral">&quot;w_resolution := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a946ef333c9627293f30db28447a09f55">w_resolution</a>);
<a name="l00412"></a>00412   fprintf(fp, <span class="stringliteral">&quot;gate_duration := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a790afb788d414578a5c3ab75ee33e6ef">gate_duration</a>);
<a name="l00413"></a>00413   fprintf(fp, <span class="stringliteral">&quot;r_wave_offset := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#ac6159922811bbc4faa5227977aa1aecc">r_wave_offset</a>);
<a name="l00414"></a>00414   fprintf(fp, <span class="stringliteral">&quot;num_accepted_beats := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a268204e52f918f4738cbd4b6b41c0010">num_accepted_beats</a>);
<a name="l00415"></a>00415   fprintf(fp, <span class="stringliteral">&quot;scale_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#ae27dc6ec3582a4e2a0e69ea9377993a3">scale_factor</a>);
<a name="l00416"></a>00416   fprintf(fp, <span class="stringliteral">&quot;scan_min := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a6a644bf6cbb45523522f20ebf730af2c">scan_min</a>);
<a name="l00417"></a>00417   fprintf(fp, <span class="stringliteral">&quot;scan_max := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#abaf0931401015351496475447bdf2e4a">scan_max</a>);
<a name="l00418"></a>00418   fprintf(fp, <span class="stringliteral">&quot;prompts := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#ac4abf37f9a786b4133fe6526cf29463c">prompts</a>);
<a name="l00419"></a>00419   fprintf(fp, <span class="stringliteral">&quot;delayed := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a01d95cfc32cb38a15067f6f2b6835176">delayed</a>);
<a name="l00420"></a>00420   fprintf(fp, <span class="stringliteral">&quot;multiples := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a875117198383dd1ede79e8e0c7e9e98d">multiples</a>);
<a name="l00421"></a>00421   fprintf(fp, <span class="stringliteral">&quot;net_trues := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#af370e602f761d19cc1663c84f8fb0fae">net_trues</a>);
<a name="l00422"></a>00422   fprintf(fp, <span class="stringliteral">&quot;cor_singles :=&quot;</span>);
<a name="l00423"></a>00423   <span class="keywordflow">for</span>(i=0; i&lt;16; i++) fprintf(fp, <span class="stringliteral">&quot; %g&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#af2e871980537eb5bf534ff9ed4d7346f">cor_singles</a>[i]);
<a name="l00424"></a>00424   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00425"></a>00425   fprintf(fp, <span class="stringliteral">&quot;uncor_singles :=&quot;</span>);
<a name="l00426"></a>00426   <span class="keywordflow">for</span>(i=0; i&lt;16; i++) fprintf(fp, <span class="stringliteral">&quot; %g&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#ae09638e910e990877f98f8f5bf0450fe">uncor_singles</a>[i]);
<a name="l00427"></a>00427   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00428"></a>00428   fprintf(fp, <span class="stringliteral">&quot;tot_avg_cor := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#ab18f6c6f465371a84b37b909e3294dda">tot_avg_cor</a>);
<a name="l00429"></a>00429   fprintf(fp, <span class="stringliteral">&quot;tot_avg_uncor := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a3e4245e6136c30d208c36e2e60432ea1">tot_avg_uncor</a>);
<a name="l00430"></a>00430   fprintf(fp, <span class="stringliteral">&quot;total_coin_rate := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a2f154fd294d938039e15dbc452aae7a0">total_coin_rate</a>);
<a name="l00431"></a>00431   fprintf(fp, <span class="stringliteral">&quot;frame_start_time := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a8930d980328907f75c2518b36e67b36f">frame_start_time</a>);
<a name="l00432"></a>00432   fprintf(fp, <span class="stringliteral">&quot;frame_duration := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#afe892b507d85054ad72ce5ac289b3b05">frame_duration</a>);
<a name="l00433"></a>00433   fprintf(fp, <span class="stringliteral">&quot;deadtime_correction_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a8788db06847593186cbeaef45e03b838">deadtime_correction_factor</a>);
<a name="l00434"></a>00434   fprintf(fp, <span class="stringliteral">&quot;physical_planes :=&quot;</span>);
<a name="l00435"></a>00435   <span class="keywordflow">for</span>(i=0; i&lt;8; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dscanheader.html#a32d5dfdc807697d412704c5ac53adced">physical_planes</a>[i]);
<a name="l00436"></a>00436   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00437"></a>00437 }
<a name="l00438"></a>00438 <span class="comment">/*****************************************************************************/</span>
<a name="l00439"></a>00439 
<a name="l00440"></a>00440 <span class="comment">/*****************************************************************************/</span>
<a name="l00447"></a><a class="code" href="ecat7_8h.html#aff22c6c730539472220919691780016d">00447</a> <span class="keywordtype">void</span> <a class="code" href="ecat7p_8c.html#aff22c6c730539472220919691780016d">ecat7Print2DNormheader</a>(<a class="code" href="structecat7__2Dnormheader.html">ECAT7_2Dnormheader</a> *h, FILE *fp) {
<a name="l00448"></a>00448   <span class="keywordtype">int</span> i;
<a name="l00449"></a>00449 
<a name="l00450"></a>00450   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>) fprintf(stdout, <span class="stringliteral">&quot;ecat7Print2DNormheader()\n&quot;</span>);
<a name="l00451"></a>00451   fprintf(fp, <span class="stringliteral">&quot;data_type := %d (%s)\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#aed37b336ee5cf6446aa8f14a8a8589e9">data_type</a>,
<a name="l00452"></a>00452     <a class="code" href="ecat7p_8c.html#acf623faacbc8b3010be3c91d6a573fb6">ecat7datatype</a>(h-&gt;<a class="code" href="structecat7__2Dnormheader.html#aed37b336ee5cf6446aa8f14a8a8589e9">data_type</a>) );
<a name="l00453"></a>00453   fprintf(fp, <span class="stringliteral">&quot;num_dimensions := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a2513b09534273845652deb6b9ab94e25">num_dimensions</a>);
<a name="l00454"></a>00454   fprintf(fp, <span class="stringliteral">&quot;num_r_elements := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a9445d293a44e6b33f1114ed77a8aae28">num_r_elements</a>);
<a name="l00455"></a>00455   fprintf(fp, <span class="stringliteral">&quot;num_angles := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a56ea7bd534112992fbd8380d9358bb67">num_angles</a>);
<a name="l00456"></a>00456   fprintf(fp, <span class="stringliteral">&quot;num_z_elements := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a83e70d1ac4fa6dd8421c1302370529ed">num_z_elements</a>);
<a name="l00457"></a>00457   fprintf(fp, <span class="stringliteral">&quot;ring_difference := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#ac43014ca13110db8929ecfa9ae0141b0">ring_difference</a>);
<a name="l00458"></a>00458   fprintf(fp, <span class="stringliteral">&quot;scale_factor := %E\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a41e0cea1c8ef72712a6f44c1634fa5fc">scale_factor</a>);
<a name="l00459"></a>00459   fprintf(fp, <span class="stringliteral">&quot;norm_min := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a27bc628ff44c68378fa60074c442acf1">norm_min</a>);
<a name="l00460"></a>00460   fprintf(fp, <span class="stringliteral">&quot;norm_max := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#ad8025a3f59f73ba95c2412bd0a72ff9c">norm_max</a>);
<a name="l00461"></a>00461   fprintf(fp, <span class="stringliteral">&quot;fov_source_width := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a7bbbf33025bb7abbe325825cb7ede630">fov_source_width</a>);
<a name="l00462"></a>00462   fprintf(fp, <span class="stringliteral">&quot;norm_quality_factor := %g\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a52b683dd331c8c3d3f9f12d354e83522">norm_quality_factor</a>);
<a name="l00463"></a>00463   fprintf(fp, <span class="stringliteral">&quot;norm_quality_factor_code := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a8642a53226b65eaf30bd7205432871a0">norm_quality_factor_code</a>);
<a name="l00464"></a>00464   fprintf(fp, <span class="stringliteral">&quot;storage_order := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a0a45487c98abca585bb1865c00d8bbfb">storage_order</a>);
<a name="l00465"></a>00465   fprintf(fp, <span class="stringliteral">&quot;span := %d\n&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a863a208786a3728549c8f8e3f1aa7082">span</a>);
<a name="l00466"></a>00466   fprintf(fp, <span class="stringliteral">&quot;z_elements :=&quot;</span>);
<a name="l00467"></a>00467   <span class="keywordflow">for</span>(i=0; i&lt;64; i++) fprintf(fp, <span class="stringliteral">&quot; %d&quot;</span>, h-&gt;<a class="code" href="structecat7__2Dnormheader.html#a2f7d015ed9f1c857e239d43f986fbc9f">z_elements</a>[i]);
<a name="l00468"></a>00468   fprintf(fp, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00469"></a>00469 }
<a name="l00470"></a>00470 <span class="comment">/*****************************************************************************/</span>
<a name="l00471"></a>00471 
<a name="l00472"></a>00472 <span class="comment">/*****************************************************************************/</span>
<a name="l00479"></a><a class="code" href="ecat7_8h.html#af7076f45a7f4d8c4a339e5e7d60b0f46">00479</a> <span class="keywordtype">char</span>* <a class="code" href="ecat7p_8c.html#af7076f45a7f4d8c4a339e5e7d60b0f46">ecat7filetype</a>(<span class="keywordtype">short</span> <span class="keywordtype">int</span> file_type) {
<a name="l00480"></a>00480   <span class="keyword">static</span> <span class="keywordtype">char</span> *info[] = {
<a name="l00481"></a>00481   <span class="stringliteral">&quot;unknown&quot;</span>, <span class="stringliteral">&quot;2D sinogram&quot;</span>, <span class="stringliteral">&quot;image-16&quot;</span>, <span class="stringliteral">&quot;attenuation correction&quot;</span>,
<a name="l00482"></a>00482   <span class="stringliteral">&quot;2D normalization&quot;</span>, <span class="stringliteral">&quot;polar map&quot;</span>, <span class="stringliteral">&quot;volume 8&quot;</span>, <span class="stringliteral">&quot;volume 16&quot;</span>,
<a name="l00483"></a>00483   <span class="stringliteral">&quot;projection 8&quot;</span>, <span class="stringliteral">&quot;projection 16&quot;</span>, <span class="stringliteral">&quot;image 8&quot;</span>, <span class="stringliteral">&quot;3D sinogram 16&quot;</span>,
<a name="l00484"></a>00484   <span class="stringliteral">&quot;3D sinogram 8&quot;</span>, <span class="stringliteral">&quot;3D normalization&quot;</span>, <span class="stringliteral">&quot;3D sinogram fit&quot;</span>,
<a name="l00485"></a>00485   0};
<a name="l00486"></a>00486   <span class="keywordflow">if</span>(file_type&gt;=0 &amp;&amp; file_type&lt;=14) <span class="keywordflow">return</span>((<span class="keywordtype">char</span>*)info[file_type]);
<a name="l00487"></a>00487   <span class="keywordflow">else</span> <span class="keywordflow">return</span>((<span class="keywordtype">char</span>*)info[0]);
<a name="l00488"></a>00488 }
<a name="l00489"></a>00489 <span class="comment">/*****************************************************************************/</span>
<a name="l00490"></a>00490 
<a name="l00491"></a>00491 <span class="comment">/*****************************************************************************/</span>
<a name="l00498"></a><a class="code" href="ecat7_8h.html#a678be687d746330004c5b3f71f05a928">00498</a> <span class="keywordtype">char</span>* <a class="code" href="ecat7p_8c.html#a678be687d746330004c5b3f71f05a928">ecat7acquisitiontype</a>(<span class="keywordtype">short</span> <span class="keywordtype">int</span> acquisition_type) {
<a name="l00499"></a>00499   <span class="keyword">static</span> <span class="keywordtype">char</span> *info[] = {
<a name="l00500"></a>00500   <span class="stringliteral">&quot;undefined&quot;</span>, <span class="stringliteral">&quot;blank&quot;</span>, <span class="stringliteral">&quot;transmission&quot;</span>, <span class="stringliteral">&quot;static emission&quot;</span>,
<a name="l00501"></a>00501   <span class="stringliteral">&quot;dynamic emission&quot;</span>, <span class="stringliteral">&quot;gated emission&quot;</span>, <span class="stringliteral">&quot;transmission rectilinear&quot;</span>,
<a name="l00502"></a>00502   <span class="stringliteral">&quot;emission rectilinear&quot;</span>,
<a name="l00503"></a>00503   0};
<a name="l00504"></a>00504   <span class="keywordflow">if</span>(acquisition_type&gt;=0 &amp;&amp; acquisition_type&lt;=7)
<a name="l00505"></a>00505     <span class="keywordflow">return</span>((<span class="keywordtype">char</span>*)info[acquisition_type]);
<a name="l00506"></a>00506   <span class="keywordflow">else</span> <span class="keywordflow">return</span>((<span class="keywordtype">char</span>*)info[0]);
<a name="l00507"></a>00507 }
<a name="l00508"></a>00508 <span class="comment">/*****************************************************************************/</span>
<a name="l00509"></a>00509 
<a name="l00510"></a>00510 <span class="comment">/*****************************************************************************/</span>
<a name="l00517"></a><a class="code" href="ecat7_8h.html#acf623faacbc8b3010be3c91d6a573fb6">00517</a> <span class="keywordtype">char</span>* <a class="code" href="ecat7p_8c.html#acf623faacbc8b3010be3c91d6a573fb6">ecat7datatype</a>(<span class="keywordtype">short</span> <span class="keywordtype">int</span> data_type) {
<a name="l00518"></a>00518   <span class="keyword">static</span> <span class="keywordtype">char</span> *info[] = {
<a name="l00519"></a>00519   <span class="stringliteral">&quot;unknown&quot;</span>, <span class="stringliteral">&quot;byte&quot;</span>, <span class="stringliteral">&quot;VAX 2 byte integer&quot;</span>, <span class="stringliteral">&quot;VAX 4 byte integer&quot;</span>,
<a name="l00520"></a>00520   <span class="stringliteral">&quot;VAX 4 byte float&quot;</span>, <span class="stringliteral">&quot;IEEE 4 byte float&quot;</span>, <span class="stringliteral">&quot;SUN 2 byte integer&quot;</span>,
<a name="l00521"></a>00521   <span class="stringliteral">&quot;SUN 4 byte integer&quot;</span>,
<a name="l00522"></a>00522   0};
<a name="l00523"></a>00523   <span class="keywordflow">if</span>(data_type&gt;=0 &amp;&amp; data_type&lt;=7) <span class="keywordflow">return</span>((<span class="keywordtype">char</span>*)info[data_type]);
<a name="l00524"></a>00524   <span class="keywordflow">else</span> <span class="keywordflow">return</span>((<span class="keywordtype">char</span>*)info[0]);
<a name="l00525"></a>00525 }
<a name="l00526"></a>00526 <span class="comment">/*****************************************************************************/</span>
<a name="l00527"></a>00527 
<a name="l00528"></a>00528 <span class="comment">/*****************************************************************************/</span>
<a name="l00532"></a><a class="code" href="ecat7_8h.html#acdeecf04ee874f1f360fe0a7b87996e6">00532</a> <span class="keywordtype">int</span> <a class="code" href="ecat7p_8c.html#acdeecf04ee874f1f360fe0a7b87996e6">ecat7PrintSubheader</a>(
<a name="l00534"></a>00534   <a class="code" href="structecat7__mainheader.html">ECAT7_mainheader</a> mh,
<a name="l00536"></a>00536   FILE *fp,
<a name="l00538"></a>00538   <span class="keywordtype">int</span> plane,
<a name="l00540"></a>00540   <span class="keywordtype">int</span> frame,
<a name="l00542"></a>00542   FILE *ofp
<a name="l00543"></a>00543 ) {
<a name="l00544"></a>00544   <span class="keywordtype">int</span>                     mi, ret, nr=0;
<a name="l00545"></a>00545   <a class="code" href="structecat7__imageheader.html">ECAT7_imageheader</a>       image_header;
<a name="l00546"></a>00546   <a class="code" href="structecat7__scanheader.html">ECAT7_scanheader</a>        scan_header;
<a name="l00547"></a>00547   <a class="code" href="structecat7__2Dscanheader.html">ECAT7_2Dscanheader</a>      scan2D_header;
<a name="l00548"></a>00548   <a class="code" href="structecat7__2Dnormheader.html">ECAT7_2Dnormheader</a>      norm2D_header;
<a name="l00549"></a>00549   <a class="code" href="structecat7__normheader.html">ECAT7_normheader</a>        norm_header;
<a name="l00550"></a>00550   <a class="code" href="structecat7__attenheader.html">ECAT7_attenheader</a>       atten_header;
<a name="l00551"></a>00551   <a class="code" href="structecat7__polmapheader.html">ECAT7_polmapheader</a>      polmap_header;
<a name="l00552"></a>00552   <span class="keyword">static</span> <a class="code" href="structECAT7__MATRIXLIST.html">ECAT7_MATRIXLIST</a> mlist;
<a name="l00553"></a>00553   <a class="code" href="structECAT7__Matval.html">ECAT7_Matval</a>            matval;
<a name="l00554"></a>00554 
<a name="l00555"></a>00555 
<a name="l00556"></a>00556   <span class="comment">/*</span>
<a name="l00557"></a>00557 <span class="comment">   *  Read matrix list</span>
<a name="l00558"></a>00558 <span class="comment">   */</span>
<a name="l00559"></a>00559   <a class="code" href="ecat7ml_8c.html#a0826a19efcf80e53e28473189d07949e">ecat7InitMatlist</a>(&amp;mlist);
<a name="l00560"></a>00560   ret=<a class="code" href="ecat7ml_8c.html#a0304c6b68597ab6fe00bb35a44c19dcb">ecat7ReadMatlist</a>(fp, &amp;mlist);
<a name="l00561"></a>00561   <span class="keywordflow">if</span>(ret) {
<a name="l00562"></a>00562     fprintf(stderr, <span class="stringliteral">&quot;Error (%d): cannot read matrix list.\n&quot;</span>, ret);
<a name="l00563"></a>00563     <span class="keywordflow">return</span>(2);
<a name="l00564"></a>00564   }
<a name="l00565"></a>00565   <span class="keywordflow">if</span>(mlist.<a class="code" href="structECAT7__MATRIXLIST.html#af3e725f10fb1d8e7768330b26cd37691">matrixNr</a>&lt;=0) {
<a name="l00566"></a>00566     fprintf(stderr, <span class="stringliteral">&quot;Error: matrix list is empty.\n&quot;</span>);
<a name="l00567"></a>00567     <span class="keywordflow">return</span>(2);
<a name="l00568"></a>00568   }
<a name="l00569"></a>00569   <span class="keywordflow">if</span>(<a class="code" href="ecat7_8h.html#aeba6b1646ad1dd69809d9ba3a8732939">ECAT7_TEST</a>&gt;1) <a class="code" href="ecat7ml_8c.html#ad50b3297af530071a5f115c14f40c701">ecat7PrintMatlist</a>(&amp;mlist);
<a name="l00570"></a>00570 
<a name="l00571"></a>00571   <span class="comment">/*</span>
<a name="l00572"></a>00572 <span class="comment">   *  Read and print subheaders one at a time</span>
<a name="l00573"></a>00573 <span class="comment">   */</span>
<a name="l00574"></a>00574   <span class="keywordflow">for</span>(mi=nr=0; mi&lt;mlist.<a class="code" href="structECAT7__MATRIXLIST.html#af3e725f10fb1d8e7768330b26cd37691">matrixNr</a>; mi++) {
<a name="l00575"></a>00575     <span class="comment">/* Get frame nr */</span>
<a name="l00576"></a>00576     <a class="code" href="ecat7ml_8c.html#a4cf0dc3b586a1c62d177f21b5e8e2328">ecat7_id_to_val</a>(mlist.<a class="code" href="structECAT7__MATRIXLIST.html#a691b0a0862d05c2eb983930022a908a7">matdir</a>[mi].<a class="code" href="structECAT7__MatDir.html#a496411c7ccf25471dd7e7af220160ffd">id</a>, &amp;matval);
<a name="l00577"></a>00577     <span class="comment">/* Check if this is supposed to be listed or not */</span>
<a name="l00578"></a>00578     <span class="keywordflow">if</span>(frame&gt;=0 &amp;&amp; frame!=matval.<a class="code" href="structECAT7__Matval.html#afc531f65c0b1b58cbcffb947df62400b">frame</a>) <span class="keywordflow">continue</span>;
<a name="l00579"></a>00579     <span class="keywordflow">if</span>(plane&gt;=0 &amp;&amp; plane!=matval.<a class="code" href="structECAT7__Matval.html#a041cdbab82513cac692f52c4e7364093">plane</a>) <span class="keywordflow">continue</span>;
<a name="l00580"></a>00580     fprintf(fp, <span class="stringliteral">&quot;Matrix: plane %d frame %d gate %d bed %d\n&quot;</span>,
<a name="l00581"></a>00581       matval.<a class="code" href="structECAT7__Matval.html#a041cdbab82513cac692f52c4e7364093">plane</a>, matval.<a class="code" href="structECAT7__Matval.html#afc531f65c0b1b58cbcffb947df62400b">frame</a>, matval.<a class="code" href="structECAT7__Matval.html#a0f094bb9f2d880fa875ecc6110ace13b">gate</a>, matval.<a class="code" href="structECAT7__Matval.html#af1f94ed7c49267bed701b8a0fa690ecd">bed</a>);
<a name="l00582"></a>00582     <span class="comment">/* Read and print subheader */</span>
<a name="l00583"></a>00583     ret=0;
<a name="l00584"></a>00584     <span class="keywordflow">switch</span>(mh.<a class="code" href="structecat7__mainheader.html#a1914b3a0ebf3077d090752d6ef66c757">file_type</a>) {
<a name="l00585"></a>00585       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a2402b4811763dfb68cb331ff5262633e">ECAT7_ATTEN</a>:
<a name="l00586"></a>00586         ret=<a class="code" href="ecat7r_8c.html#a610647e39e3d9de0f24b1886a064d6f8">ecat7ReadAttenheader</a>(fp, mlist.<a class="code" href="structECAT7__MATRIXLIST.html#a691b0a0862d05c2eb983930022a908a7">matdir</a>[mi].<a class="code" href="structECAT7__MatDir.html#a599cd12bfc8ff972afaef41a2cb57aa8">strtblk</a>, &amp;atten_header);
<a name="l00587"></a>00587         <span class="keywordflow">if</span>(ret==0) <a class="code" href="ecat7p_8c.html#aa1193aee8e3546663ae8691f1649ee8f">ecat7PrintAttenheader</a>(&amp;atten_header, stdout);
<a name="l00588"></a>00588         <span class="keywordflow">break</span>;
<a name="l00589"></a>00589       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a7fc850b7d3e9176a7e8dc54bbf7ba29a">ECAT7_3DNORM</a>:
<a name="l00590"></a>00590         ret=<a class="code" href="ecat7r_8c.html#a53935e3d6fa02ec2414895e205593db3">ecat7ReadNormheader</a>(fp, mlist.<a class="code" href="structECAT7__MATRIXLIST.html#a691b0a0862d05c2eb983930022a908a7">matdir</a>[mi].<a class="code" href="structECAT7__MatDir.html#a599cd12bfc8ff972afaef41a2cb57aa8">strtblk</a>, &amp;norm_header);
<a name="l00591"></a>00591         <span class="keywordflow">if</span>(ret==0) <a class="code" href="ecat7p_8c.html#a07df33f30bcc8232de1fce513774dc69">ecat7PrintNormheader</a>(&amp;norm_header, stdout);
<a name="l00592"></a>00592         <span class="keywordflow">break</span>;
<a name="l00593"></a>00593       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a89d13a863bef6b8ba3be45dd7ae179ae">ECAT7_IMAGE8</a>:
<a name="l00594"></a>00594       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a65f66a0950e8acad3f17e8943f8fffe5">ECAT7_IMAGE16</a>:
<a name="l00595"></a>00595       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a0ea1caf9e41509e4d119d229d9636445">ECAT7_VOLUME8</a>:
<a name="l00596"></a>00596       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a6e003b3310c339d2cdac5b64cbdca3f1">ECAT7_VOLUME16</a>:
<a name="l00597"></a>00597         ret=<a class="code" href="ecat7r_8c.html#ac96bedc17610a5a05d95ce7742d44b5c">ecat7ReadImageheader</a>(fp, mlist.<a class="code" href="structECAT7__MATRIXLIST.html#a691b0a0862d05c2eb983930022a908a7">matdir</a>[mi].<a class="code" href="structECAT7__MatDir.html#a599cd12bfc8ff972afaef41a2cb57aa8">strtblk</a>, &amp;image_header);
<a name="l00598"></a>00598         <span class="keywordflow">if</span>(ret==0) <a class="code" href="ecat7p_8c.html#a0854c4b26b52aba47971deb210c1a5a7">ecat7PrintImageheader</a>(&amp;image_header, stdout);
<a name="l00599"></a>00599         <span class="keywordflow">break</span>;
<a name="l00600"></a>00600       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a432546d341581f2754964e808b368116">ECAT7_3DSCAN</a>:
<a name="l00601"></a>00601       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a4b13fe4c981f8d1ebf6f99baceb3730d">ECAT7_3DSCAN8</a>:
<a name="l00602"></a>00602       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#a6c8af4dc922ee29e79c8490da33eea76">ECAT7_3DSCANFIT</a>:
<a name="l00603"></a>00603         ret=<a class="code" href="ecat7r_8c.html#a37414b52ef395686b6a81d6229d13143">ecat7ReadScanheader</a>(fp, mlist.<a class="code" href="structECAT7__MATRIXLIST.html#a691b0a0862d05c2eb983930022a908a7">matdir</a>[mi].<a class="code" href="structECAT7__MatDir.html#a599cd12bfc8ff972afaef41a2cb57aa8">strtblk</a>, &amp;scan_header);
<a name="l00604"></a>00604         <span class="keywordflow">if</span>(ret==0) <a class="code" href="ecat7p_8c.html#ade61cec0f7e15550290193ef0d6e26cc">ecat7PrintScanheader</a>(&amp;scan_header, stdout);
<a name="l00605"></a>00605         <span class="keywordflow">break</span>;
<a name="l00606"></a>00606       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#ad0af87a185fd38674939656d33c410cc">ECAT7_POLARMAP</a>:
<a name="l00607"></a>00607         ret=<a class="code" href="ecat7r_8c.html#a498d383ca08a832895af8ead01e8c756">ecat7ReadPolmapheader</a>(fp, mlist.<a class="code" href="structECAT7__MATRIXLIST.html#a691b0a0862d05c2eb983930022a908a7">matdir</a>[mi].<a class="code" href="structECAT7__MatDir.html#a599cd12bfc8ff972afaef41a2cb57aa8">strtblk</a>, &amp;polmap_header);
<a name="l00608"></a>00608         <span class="keywordflow">if</span>(ret==0) <a class="code" href="ecat7p_8c.html#a7b20d17081345d4f4ede5d4791e18e31">ecat7PrintPolmapheader</a>(&amp;polmap_header, stdout);
<a name="l00609"></a>00609         <span class="keywordflow">break</span>;
<a name="l00610"></a>00610       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#af9e3bc8017c230f899191645d98bdeec">ECAT7_2DSCAN</a>:
<a name="l00611"></a>00611         ret=<a class="code" href="ecat7r_8c.html#aa37d19fc4f30868ea0b062d39d9d8450">ecat7Read2DScanheader</a>(fp, mlist.<a class="code" href="structECAT7__MATRIXLIST.html#a691b0a0862d05c2eb983930022a908a7">matdir</a>[mi].<a class="code" href="structECAT7__MatDir.html#a599cd12bfc8ff972afaef41a2cb57aa8">strtblk</a>, &amp;scan2D_header);
<a name="l00612"></a>00612         <span class="keywordflow">if</span>(ret==0) <a class="code" href="ecat7p_8c.html#aaa6831e8494e81833098b42b37e3f96a">ecat7Print2DScanheader</a>(&amp;scan2D_header, stdout);
<a name="l00613"></a>00613         <span class="keywordflow">break</span>;
<a name="l00614"></a>00614       <span class="keywordflow">case</span> <a class="code" href="ecat7_8h.html#ab5a1f9cd7509c51d715dbb24dd808a75">ECAT7_2DNORM</a>:
<a name="l00615"></a>00615         ret=<a class="code" href="ecat7r_8c.html#ad9fd9a7a7dc9cabfddf398c32b01bdce">ecat7Read2DNormheader</a>(fp, mlist.<a class="code" href="structECAT7__MATRIXLIST.html#a691b0a0862d05c2eb983930022a908a7">matdir</a>[mi].<a class="code" href="structECAT7__MatDir.html#a599cd12bfc8ff972afaef41a2cb57aa8">strtblk</a>, &amp;norm2D_header);
<a name="l00616"></a>00616         <span class="keywordflow">if</span>(ret==0) <a class="code" href="ecat7p_8c.html#aff22c6c730539472220919691780016d">ecat7Print2DNormheader</a>(&amp;norm2D_header, stdout);
<a name="l00617"></a>00617         <span class="keywordflow">break</span>;
<a name="l00618"></a>00618       <span class="keywordflow">default</span>:
<a name="l00619"></a>00619         fprintf(stderr, <span class="stringliteral">&quot;Error: matrix filetype %d is not yet supported.\n&quot;</span>,
<a name="l00620"></a>00620           mh.<a class="code" href="structecat7__mainheader.html#a1914b3a0ebf3077d090752d6ef66c757">file_type</a>);
<a name="l00621"></a>00621         <a class="code" href="ecat7ml_8c.html#a570804c248c25f15c172568043a8f0a5">ecat7EmptyMatlist</a>(&amp;mlist);
<a name="l00622"></a>00622         <span class="keywordflow">return</span>(8);
<a name="l00623"></a>00623     }
<a name="l00624"></a>00624     <span class="keywordflow">if</span>(ret) {
<a name="l00625"></a>00625       fprintf(stderr, <span class="stringliteral">&quot;Error %d in reading subheader.\n&quot;</span>, ret);
<a name="l00626"></a>00626       <a class="code" href="ecat7ml_8c.html#a570804c248c25f15c172568043a8f0a5">ecat7EmptyMatlist</a>(&amp;mlist); <span class="keywordflow">return</span>(5);
<a name="l00627"></a>00627     }
<a name="l00628"></a>00628     nr++; <span class="comment">// counter</span>
<a name="l00629"></a>00629   } <span class="comment">/* next matrix */</span>
<a name="l00630"></a>00630   <a class="code" href="ecat7ml_8c.html#a570804c248c25f15c172568043a8f0a5">ecat7EmptyMatlist</a>(&amp;mlist);
<a name="l00631"></a>00631   
<a name="l00632"></a>00632   <span class="keywordflow">if</span>(nr==0 &amp;&amp; (plane&gt;=0 || frame&gt;=0)) {
<a name="l00633"></a>00633     fprintf(stderr, <span class="stringliteral">&quot;Error: specified matrices not found.\n&quot;</span>);
<a name="l00634"></a>00634     <span class="keywordflow">return</span>(11);
<a name="l00635"></a>00635   }
<a name="l00636"></a>00636 
<a name="l00637"></a>00637   <span class="keywordflow">return</span>(0);
<a name="l00638"></a>00638 }
<a name="l00639"></a>00639 <span class="comment">/*****************************************************************************/</span>
<a name="l00640"></a>00640 
<a name="l00641"></a>00641 <span class="comment">/*****************************************************************************/</span>
<a name="l00642"></a>00642 
</pre></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>