ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DicomFileMgr.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DicomFileMgr.hh
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:
108 
110  // msd theFiles;
112  std::vector<DicomFileStructure*> theStructFiles;
113  std::vector<DicomFilePlan*> thePlanFiles;
115  std::map<G4double,G4String> theMaterials;
116  std::map<G4double,G4String> theMaterialsDensity;
117  std::map<G4int,G4double> theCT2Density;
118 
123 
124 public:
125  static int verbose;
127 };
128 
129 #endif