File indexing completed on 2025-02-23 09:21:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #ifndef DicomFileMgr__HH
0027 #define DicomFileMgr__HH
0028 #include "dcmtk/dcmdata/dcfilefo.h"
0029
0030 #include "globals.hh"
0031
0032 #include <map>
0033 #include <vector>
0034 class DicomVFile;
0035 class DicomFileCT;
0036 class DicomFileStructure;
0037 class DicomFilePlan;
0038 class DicomFilePET;
0039 class DcmDataset;
0040
0041
0042 typedef std::map<G4double, DicomFileCT*> mdct;
0043 typedef std::map<G4double, DicomFilePET*> mdpet;
0044 enum VerbLevel
0045 {
0046 silentVerb = -1,
0047 errorVerb = 0,
0048 warningVerb = 1,
0049 infoVerb = 2,
0050 debugVerb = 3,
0051 testVerb = 4
0052 };
0053
0054 class DicomFileMgr
0055 {
0056 public:
0057 static DicomFileMgr* GetInstance();
0058 ~DicomFileMgr() {};
0059
0060 private:
0061 DicomFileMgr();
0062
0063 public:
0064 std::vector<DicomFileStructure*> GetStructFiles() const { return theStructFiles; }
0065
0066 void SetCompression(G4String fComp);
0067 void AddFile(G4String fComp);
0068 void AddMaterial(std::vector<G4String> data);
0069 void AddMaterialDensity(std::vector<G4String> data);
0070 void AddCT2Density(std::vector<G4String> data);
0071
0072 void Convert(G4String fFileName);
0073 void CheckNColumns(std::vector<G4String> wl, size_t vsizeTh);
0074 void ProcessFiles();
0075 void CheckCTSlices();
0076 G4double Hounsfield2density(Uint32 Hval);
0077 size_t GetMaterialIndex(G4double Hval);
0078 size_t GetMaterialIndexByDensity(G4double density);
0079 void BuildCTMaterials();
0080 void MergeCTFiles();
0081 void CheckPETSlices();
0082 void BuildPETActivities();
0083 void MergePETFiles();
0084 void DumpToTextFile();
0085 void SetStructureNCheck(G4int nsc) { theStructureNCheck = nsc; }
0086 G4int GetStructureNCheck() const { return theStructureNCheck; }
0087 void SetStructureNMaxROI(G4int nsc) { theStructureNMaxROI = nsc; }
0088 G4int GetStructureNMaxROI() const { return theStructureNMaxROI; }
0089 G4int GetCompression() const { return fCompression; }
0090 G4String GetFileOutName() const { return theFileOutName; }
0091
0092 void SetControlPointMetersets();
0093 G4bool IsMaterialsDensity() const { return bMaterialsDensity; }
0094
0095 protected:
0096 G4int fCompression;
0097
0098 private:
0099 static DicomFileMgr* theInstance;
0100
0101 G4String theFileOutName;
0102
0103 mdct theCTFiles;
0104 std::vector<DicomFileStructure*> theStructFiles;
0105 std::vector<DicomFilePlan*> thePlanFiles;
0106 mdpet thePETFiles;
0107 std::map<G4double, G4String> theMaterials;
0108 std::map<G4double, G4String> theMaterialsDensity;
0109 std::map<G4int, G4double> theCT2Density;
0110
0111 DicomFileCT* theCTFileAll;
0112 DicomFilePET* thePETFileAll;
0113 G4int theStructureNCheck;
0114 G4int theStructureNMaxROI;
0115
0116 public:
0117 static G4int verbose;
0118 G4bool bMaterialsDensity;
0119 };
0120
0121 #endif