Subversion Repositories f9daq

Rev

Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 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
 
45
#include <iostream>
46
#include "TVector3.h"
47
class TH2F;
48
 
49
//#include <math.h>
50
#include <map>
51
#include <vector>
52
#include <set>
53
#include <string>
54
 
55
class TH1;
56
class TH2F;
57
class TH3F;
58
class TRandom3;
59
 
60
 typedef unsigned short SINO_TYPE;  //!!NOTE:  Check "Write_sino3D" (.hv file) if SINO_TYPE changes !!
61
 
62
//------------------------------------------------------------------------
63
class PETProjDataMgr
64
{
65
 private:
66
  PETProjDataMgr();
67
  int m_Debug;
68
 public:
69
  ~PETProjDataMgr();
70
 
71
  //! Get the only instance 
72
  static PETProjDataMgr* GetInstance();
73
  void AddEvent(const TVector3& pos1, const TVector3& pos2);
74
  //void ReadFile();
75
  //PETOutput ReadEvent( G4bool& bEof );
76
  void SetProjection(int axialplane, TH2F*h);
77
  void WriteInterfile();
78
  void SetNPlanes(int n){m_NOfPlanes=n;};
79
  void SetNBin(int n){m_NOfBins=n;};
80
  void SetNAng(int n){m_NOfAngles=n;};
81
  void SetDebug(int n){m_Debug=n;};
82
  void SetNumberOfChannels(int n){m_nch=n;};
83
  void SetFilename( const char *fname){ m_Filename= TString(fname); };
84
  void SetRingDiameter( double x){ m_RingDiameter = x; };
85
  void SetAxialDistance( double x){ m_AxialDistance = x; };
86
  TH2F *Phantom(int kaj);
87
  int FwdProject(TH2F *img, TH2F *h=NULL);
88
  int FwdProject(TH3F *img, TH3F *h=NULL);
89
 
90
  int FwdProject(double x,double y, double z, int nmax, TH1 *h=NULL);
91
  TVector3 Hits2Digits(const TVector3 &r);
92
 
93
private:
94
  static PETProjDataMgr* m_Instance;
95
 
96
  double m_AxialDistance;
97
  double m_RingDiameter;
98
  int m_NOfPlanes;
99
  int m_NOfBins;
100
  int m_NOfAngles;
101
  int m_MaxRingDifference;
102
  int m_OutFormat;
103
  int m_nch;
104
  int m_TotalAxialPlanes;
105
  TString m_Filename;
106
  TRandom3 * m_rnd;
107
  //G4bool bDumpCout;
108
 
109
  SINO_TYPE ***m_projections;
110
  SINO_TYPE *m_Buffer;
111
 
112
  unsigned long int m_TotalCoincidences;
113
  unsigned long int m_TotalProjectionCoincidences;
114
 
115
 
116
  FILE *fp;
117
};
118
 
119
#endif
120