<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Konstantinos,</p>
    <p>Data values in your datafile appear to be very small, around
      10^-44 (see attached, Float32). I think there is still something
      wrong in your conversion.</p>
    <p>Best regards,</p>
    <p>Thibaut</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 16/05/2017 00:18, Konstantinos P.
      Chatzipapas, MSc wrote:<br>
    </div>
    <blockquote cite="mid:fcd2bd4916a1a29f404657e41281511b@upatras.gr"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p>Hi again,</p>
      <p>Sorry about this. I am re-attaching the files. Something is
        wrong in the previous ones. Question still the same. What is
        wrong?</p>
      <p> </p>
      <p>Kind Regards,</p>
      <p>Konstantinos</p>
      <p> </p>
      <p>Στις 15-05-2017 23:54, Konstantinos P. Chatzipapas, MSc έγραψε:</p>
      <blockquote type="cite" style="padding: 0 0.4em; border-left:
        #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
        <p>Hello,</p>
        <p>It worked, thank you very much. I have one more question.</p>
        <p>I created the files I am attaching. There is something wrong
          again. The reconstructed image is empty.. All black....</p>
        <p>Can you help me on this?</p>
        <p> </p>
        <p>Many thanks,</p>
        <p>Konstantinos</p>
        <p> </p>
        <p>Στις 15-05-2017 18:24, tmerlin έγραψε:</p>
        <blockquote style="padding: 0 0.4em; border-left: #1010ff 2px
          solid; margin: 0;"><!-- node type 8 --><!-- node type 8 --><!-- node type 8 -->
          <p>Hi Konstantinos,</p>
          <p>The out of range projection index errors usually means the
            code can't correctly read the binary datafile as you said.
            Judging from the values in your cdf file, I think something
            went wrong during your conversion. Expected types are float
            for the data, and unsigned integers (4 bytes) for time &
            ids. I suggest trying something like this in your program:</p>
          <p>  uint32_t id1, id2,** timeMS;    float** data;</p>
          <p>  // recover data</p>
          <p>  for (id1=0; id1<bins_elts; id1++)<br>
              {<br>
                for (id2=0; id2<nCrystalsTot; id2++)<br>
                {<br>
                  fwrite((char*)(&timeMS[id1][id2]) , 
            sizeof(uint32_t),  1, pFile);<br>
                  fwrite((char*)(&data[id1][id2]) ,  sizeof(float), 
            1, pFile);<br>
                  fwrite((char*)(&id1) ,  sizeof(uint32_t),  1,
            pFile);<br>
                  fwrite((char*)(&id2) ,  sizeof(uint32_t),  1,
            pFile);<br>
                }<br>
              }</p>
          <p>Besides, I am not sure why your datafile header states
            188811 events, while I would expect 107928 events from your
            numbers (nb of projections * nb of pixels).</p>
          <p>Best regards,</p>
          <p>Thibaut</p>
          <p> </p>
          <br>
          <div class="moz-cite-prefix">On 15/05/2017 12:55, Konstantinos
            P. Chatzipapas, MSc wrote:</div>
          <blockquote style="padding: 0 0.4em; border-left: #1010ff 2px
            solid; margin: 0;">
            <p>Dear users/developers,</p>
            <p>I am trying to create a program that will write
              experimental results to the appropriate .Cdf ascii format.
              I am using this loop:</p>
            <p>  char buffer [20];<br>
                sprintf(buffer, "CDF_CstrProj.Cdf");<br>
                pFile = fopen (buffer, "w");<br>
                for (id1=0; id1<bins_elts; id1++)<br>
                {<br>
                  for (id2=0; id2<nCrystalsTot; id2++)<br>
                  {<br>
                    fprintf(pFile,"%6d ",timeMS[id1][id2]);<br>
                    fprintf(pFile,"%6d ",data[id1][id2]);<br>
                    fprintf(pFile,"%6d ",id1);<br>
                    fprintf(pFile,"%6d ",id2);<br>
                  }<br>
                }</p>
            <p>Where id1 is the projectionID (0-35) and id2 is the
              pixelID (0-2997). Data are the counts. I am using integers
              in data but I have also try it with floats. Then by using
              a .Cdh I try to reconstruct. There is a problem there.
              Probably castor-recon does not recognize the file correct,
              because I am getting this fault repeatedly (the
              "Projection index" only change:</p>
            <p>*****
              oIterativeAlgorithm::StepInnerLoopInsideSubsetLoop() ->
              A problem occured while computing the projection line !<br>
              ***** iScannerSPECTConv::GetPositionsAndOrientations()
              -> Projection index (538976288) out of range [0:35] !<br>
              ***** vProjector::Project() -> A problem occured while
              getting positions and orientations from scanner !<br>
              ***** oProjectorManager::ComputeProjectionLine() -> A
              problem occured while forward projecting an event !</p>
            <p>I am attaching the file in order that you take a look and
              help me.</p>
            <p> </p>
            <p>Thank you in advance,</p>
            <p>Konstantinos</p>
            <p> </p>
            <div>-- <br>
              <div class="pre" style="margin: 0; padding: 0;
                font-family: monospace;">
                <hr> Konstantinos P. Chatzipapas <br>
                 Physicist, MSc <br>
                 Faculty of Medical Physics <br>
                 <strong>University of Patras</strong> <br>
                <br>
                     web page: <em><a moz-do-not-send="true"
                    href="http://www.physicsmag.com">Physics Magazine</a></em></div>
            </div>
            <p> </p>
            <br>
            <fieldset class="mimeAttachmentHeader"></fieldset>
            <br>
            <pre>_______________________________________________
Castor-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Castor-users@lists.castor-project.org">Castor-users@lists.castor-project.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.castor-project.org/listinfo/castor-users">http://lists.castor-project.org/listinfo/castor-users</a>
</pre>
          </blockquote>
          <br>
          <pre class="moz-signature">-- 
Thibaut MERLIN -- PhD

Docteur en Imagerie Médicale au Laboratoire de Traitement de l'Information Medicale (LaTIM - INSERM UMR 1101)
Bâtiment 1
CHRU Morvan - 2, Av. Foch
29609 Brest CEDEX - FRANCE
Tel: 06.75.12.24.90</pre>
          <!-- node type 8 --><br>
          <div class="pre" style="margin: 0; padding: 0; font-family:
            monospace;">_______________________________________________<br>
            Castor-users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Castor-users@lists.castor-project.org">Castor-users@lists.castor-project.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.castor-project.org/listinfo/castor-users">http://lists.castor-project.org/listinfo/castor-users</a></div>
        </blockquote>
        <!-- html ignored --><br>
        <div class="pre" style="margin: 0; padding: 0; font-family:
          monospace">_______________________________________________<br>
          Castor-users mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:Castor-users@lists.castor-project.org">Castor-users@lists.castor-project.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.castor-project.org/listinfo/castor-users">http://lists.castor-project.org/listinfo/castor-users</a></div>
      </blockquote>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Thibaut MERLIN -- PhD

Docteur en Imagerie Médicale au Laboratoire de Traitement de l'Information Medicale (LaTIM - INSERM UMR 1101)
Bâtiment 1
CHRU Morvan - 2, Av. Foch
29609 Brest CEDEX - FRANCE
Tel: 06.75.12.24.90</pre>
  </body>
</html>