Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
DicomHandler.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 // $Id: DicomHandler.hh 92820 2015-09-17 15:22:14Z gcosmo $
27 //
30 //
31 // The code was written by :
32 // *Louis Archambault louis.archambault@phy.ulaval.ca,
33 // *Luc Beaulieu beaulieu@phy.ulaval.ca
34 // +Vincent Hubert-Tremblay at tigre.2@sympatico.ca
35 //
36 //
37 // *Centre Hospitalier Universitaire de Quebec (CHUQ),
38 // Hotel-Dieu de Quebec, departement de Radio-oncologie
39 // 11 cote du palais. Quebec, QC, Canada, G1R 2J6
40 // tel (418) 525-4444 #6720
41 // fax (418) 691 5268
42 //
43 // + Universit Laval, Qubec (QC) Canada
44 //*******************************************************//
45 
46 #ifndef DicomHandler_h
47 #define DicomHandler_h 1
48 
49 #include <cstdio>
50 #include <map>
51 #include <fstream>
52 
53 #include "globals.hh"
54 
55 //*******************************************************
66 //*******************************************************
67 
70 
72 {
73 public:
74 
75  DicomHandler();
76 
77  ~DicomHandler();
78 
79  // static accessor
80  static DicomHandler* Instance();
81 
82  G4int ReadFile(FILE *,char *);
83  G4int ReadData(FILE *,char *); // note: always use readHeader
84  // before readData
85 
86  // use ImageMagick to display the image
87  //G4int displayImage(char[500]);
88 
89  void CheckFileFormat();
90 
91 private:
92  template <class Type> void GetValue(char *, Type &);
93 
94 private:
96 
97  const int DATABUFFSIZE;
98  const int LINEBUFFSIZE;
99  const int FILENAMESIZE;
100 
101  void ReadCalibration();
102  void GetInformation(G4int &, char *);
103  G4float Pixel2density(G4int pixel);
104  void ReadMaterialIndices( std::ifstream& finData);
105  unsigned int GetMaterialIndex( G4float density );
106  void StoreData(std::ofstream& foutG4DCM);
107  void StoreData(DicomPhantomZSliceHeader* dcmPZSH);
109  void read_undefined_nested(FILE *);
110  void read_undefined_item(FILE *);
111 
114  short fRows;
115  short fColumns;
118 
122 
124 
127 
129  std::map<G4float,G4String> fMaterialIndices;
130 
136 
139 
140 };
141 #endif
142 
const int LINEBUFFSIZE
Definition: DicomHandler.hh:98
G4double fSliceThickness
G4bool fImplicitEndian
G4int ReadData(FILE *, char *)
G4int fRescaleSlope
float G4float
Definition: G4Types.hh:77
std::map< G4float, G4String > fMaterialIndices
bool fReadCalibration
void read_undefined_item(FILE *)
void read_undefined_nested(FILE *)
short fCompression
G4double fSliceLocation
const int DATABUFFSIZE
Definition: DicomHandler.hh:97
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
short fPixelRepresentation
G4int ** fTab
G4float Pixel2density(G4int pixel)
G4double * fValueCT
G4int ReadFile(FILE *, char *)
G4double fPixelSpacingX
void GetValue(char *, Type &)
G4String fCt2DensityFile
void CheckFileFormat()
int G4int
Definition: G4Types.hh:78
G4double * fValueDensity
short fBitAllocated
static DicomHandler * Instance()
Definition: DicomHandler.cc:71
static DicomHandler * fInstance
Definition: DicomHandler.hh:95
void StoreData(std::ofstream &foutG4DCM)
void ReadCalibration()
G4bool fLittleEndian
unsigned int GetMaterialIndex(G4float density)
G4String fDriverFile
const int FILENAMESIZE
Definition: DicomHandler.hh:99
G4int fMinPixelValue
G4int read_defined_nested(FILE *, G4int)
G4int fMaxPixelValue
G4int fRescaleIntercept
void GetInformation(G4int &, char *)
G4double fPixelSpacingY
DicomPhantomZSliceMerged * fMergedSlices
void ReadMaterialIndices(std::ifstream &finData)