Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DicomFileMgr.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * 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 GEANT4 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 Geant4 Software license. *
24 // ********************************************************************
25 //
26 #ifndef DicomFileMgr__HH
27 #define DicomFileMgr__HH
28 #include <vector>
29 #include <map>
30 #include "globals.hh"
31 
32 #include "dcmtk/dcmdata/dcfilefo.h"
33 class DicomVFile;
34 class DicomFileCT;
35 class DicomFileStructure;
36 class DicomFilePlan;
37 class DicomFilePET;
38 class DcmDataset;
39 
40 //typedef std::multimap<OFString,DicomVFile*> msd;
41 typedef std::map<G4double,DicomFileCT*> mdct;
42 typedef std::map<G4double,DicomFilePET*> mdpet;
45 
47 {
48 public:
49  static DicomFileMgr* GetInstance();
51 
52 private:
53  DicomFileMgr();
54 
55 public:
56  std::vector<DicomFileStructure*> GetStructFiles() const {
57  return theStructFiles;
58  }
59 
60  void SetCompression( G4String fComp );
61  void AddFile( G4String fComp );
62  void AddMaterial( std::vector<G4String> data );
63  void AddMaterialDensity( std::vector<G4String> data );
64  void AddCT2Density( std::vector<G4String> data );
65 
66  void Convert( G4String fFileName );
67  void CheckNColumns(std::vector<G4String> wl, size_t vsizeTh );
68  void ProcessFiles();
69  void CheckCTSlices();
70  G4double Hounsfield2density(Uint32 Hval);
71  size_t GetMaterialIndex( G4double Hval );
72  size_t GetMaterialIndexByDensity( G4double density );
73  void BuildCTMaterials();
74  void MergeCTFiles();
75  void CheckPETSlices();
76  void BuildPETActivities();
77  void MergePETFiles();
78  void DumpToTextFile();
80  theStructureNCheck = nsc;
81  }
83  return theStructureNCheck;
84  }
86  theStructureNMaxROI = nsc;
87  }
89  return theStructureNMaxROI;
90  }
92  return fCompression;
93  }
95  return theFileOutName;
96  }
97 
100  return bMaterialsDensity;
101  }
102 
103 protected:
105 
106 private:
107  static DicomFileMgr* theInstance;
108 
109  G4String theFileOutName;
110  // msd theFiles;
111  mdct theCTFiles;
112  std::vector<DicomFileStructure*> theStructFiles;
113  std::vector<DicomFilePlan*> thePlanFiles;
114  mdpet thePETFiles;
115  std::map<G4double,G4String> theMaterials;
116  std::map<G4double,G4String> theMaterialsDensity;
117  std::map<G4int,G4double> theCT2Density;
118 
119  DicomFileCT* theCTFileAll;
120  DicomFilePET* thePETFileAll;
121  G4int theStructureNCheck;
122  G4int theStructureNMaxROI;
123 
124 public:
125  static int verbose;
127 };
128 
129 #endif
G4bool IsMaterialsDensity() const
Definition: DicomFileMgr.hh:99
void CheckPETSlices()
void BuildCTMaterials()
G4double Hounsfield2density(Uint32 Hval)
void SetStructureNCheck(G4int nsc)
Definition: DicomFileMgr.hh:79
std::map< G4double, DicomFilePET * > mdpet
Definition: DicomFileMgr.hh:42
G4int GetCompression() const
Definition: DicomFileMgr.hh:91
G4bool bMaterialsDensity
G4int fCompression
VerbLevel
Definition: DicomFileMgr.hh:43
void MergeCTFiles()
std::vector< DicomFileStructure * > GetStructFiles() const
Definition: DicomFileMgr.hh:56
int G4int
Definition: G4Types.hh:78
std::map< G4double, DicomFileCT * > mdct
Definition: DicomFileMgr.hh:38
void AddMaterialDensity(std::vector< G4String > data)
void ProcessFiles()
const XML_Char const XML_Char * data
Definition: expat.h:268
void SetStructureNMaxROI(G4int nsc)
Definition: DicomFileMgr.hh:85
void SetCompression(G4String fComp)
bool G4bool
Definition: G4Types.hh:79
size_t GetMaterialIndexByDensity(G4double density)
void CheckCTSlices()
void AddCT2Density(std::vector< G4String > data)
static int verbose
G4String GetFileOutName() const
Definition: DicomFileMgr.hh:94
void DumpToTextFile()
void AddFile(G4String fComp)
void MergePETFiles()
void BuildPETActivities()
void CheckNColumns(std::vector< G4String > wl, size_t vsizeTh)
size_t GetMaterialIndex(G4double Hval)
void SetControlPointMetersets()
void AddMaterial(std::vector< G4String > data)
G4int GetStructureNCheck() const
Definition: DicomFileMgr.hh:82
double G4double
Definition: G4Types.hh:76
G4int GetStructureNMaxROI() const
Definition: DicomFileMgr.hh:88
void Convert(G4String fFileName)
Definition: DicomFileMgr.cc:59
static DicomFileMgr * GetInstance()
Definition: DicomFileMgr.cc:41