Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
264 f9daq 1
//
2
// ********************************************************************
3
// * License and Disclaimer                                           *
4
// *                                                                  *
5
// * The  GAMOS software  is  copyright of the Copyright  Holders  of *
6
// * the GAMOS Collaboration.  It is provided  under  the  terms  and *
7
// * conditions of the GAMOS Software License,  included in the  file *
8
// * LICENSE and available at  http://fismed.ciemat.es/GAMOS/license .*
9
// * These include a list of copyright holders.                       *
10
// *                                                                  *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work  make  any representation or  warranty, express or implied, *
14
// * regarding  this  software system or assume any liability for its *
15
// * use.  Please see the license in the file  LICENSE  and URL above *
16
// * for the full disclaimer and the limitation of liability.         *
17
// *                                                                  *
18
// * This  code  implementation is the result of  the  scientific and *
19
// * technical work of the GAMOS collaboration.                       *
20
// * By using,  copying,  modifying or  distributing the software (or *
21
// * any work based  on the software)  you  agree  to acknowledge its *
22
// * use  in  resulting  scientific  publications,  and indicate your *
23
// * acceptance of all terms of the GAMOS Software license.           *
24
// ********************************************************************
25
//
26
 
27
#ifndef PETProjDataMgr_h
28
#define PETProjDataMgr_h
29
 
30
/*---------------------------------------------------------------------------  
31
ClassName:   PETProjDataMgr
32
Author:      M. Canadas, P. Arce
33
Changes:     01/11: creation
34
 
35
-------------------------------------------------------------------------
36
// Description
37
 
38
    PET output (List-mode X Y Z) into projection data (sinograms).
39
 
40
    Output data: Sinograms for PET image reconstruction. Interfile format, STIR compatible (.hs/.s),
41
                 STIR Software for Tomographic Image Reconstruction: http://stir.sourceforge.net/main.htm    
42
 
43
-----------------------------------------------------------------------*/
44
#include <stdlib.h>
45
#include <stdio.h>
46
#include <stdint.h>
47
#include "H1D.h"  
48
#include "H2D.h"  
49
#include "H3D.h"  
50
 
51
#include "daq.h"  
52
 
53
 
54
 typedef unsigned short SINO_TYPE;  //!!NOTE:  Check "Write_sino3D" (.hv file) if SINO_TYPE changes !!
55
 
56
 struct PETProjDataMgr {
57
 
58
        int m_Debug;           
59
  double m_AxialDistance;
60
  double m_RingDiameter;
61
  int m_NOfPlanes;
62
  int m_NOfBins;
63
  int m_NOfAngles;
64
  int m_MaxRingDifference;
65
  int m_OutFormat;
66
  int m_nch;
67
  int m_TotalAxialPlanes;
68
  char m_Filename;
69
 
70
  //G4bool bDumpCout;
71
 
72
  SINO_TYPE ***m_projections;
73
  SINO_TYPE *m_Buffer;
74
 
75
  unsigned long int m_TotalCoincidences;
76
  unsigned long int m_TotalProjectionCoincidences;
77
 
78
 
79
 
80
 
81
        };
82
//-----------------------------------------------------------------------
83
  int PETProjDataMgrInit();
84
  void PETProjDataMgrFree();
85
 
86
  void AddEvent(const HVector3 pos1, const HVector3 pos2);
87
  //void ReadFile();
88
  //PETOutput ReadEvent( G4bool& bEof );
89
  void SetProjection(int axialplane, int h2d);
90
  void WriteInterfile(const char *fname);
91
  void SetNPlanes(int n);
92
  void SetNBin(int n);
93
  void SetNAng(int n);
94
  void SetDebug(int n);
95
  void SetNumberOfChannels(int n);
96
 
97
  void SetRingDiameter( double x);
98
  void SetAxialDistance( double x);
99
  int Phantom(int kaj);
100
  int FwdProject2d(int img2d, int h2d);
101
  int FwdProject3d(int img3d, int h3d);
102
 
103
  int FwdProject(double x,double y, double z, int nmax, int h1d);
104
  HVector3 Hits2Digits(const HVector3 r);
105
 
106
 
107
 
108
  struct PETProjDataMgr* GetInstance();
109
#endif
110