Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
DicomVFileImage.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 DicomVFileImage__HH
27 #define DicomVFileImage__HH
28 
29 #include "DicomVFile.hh"
30 #include "DicomFileMgr.hh"
31 #include "G4ThreeVector.hh"
32 
34 {
35 public:
37  DicomVFileImage(DcmDataset* dset);
39 
40 public:
41  virtual void ReadData();
42 
43  void operator+=( const DicomVFileImage& rhs );
45  // add two slices that have the same dimensions, merging them in Z
46 
47  void DumpHeaderToTextFile(std::ofstream& fout);
48 
49  // Get and set methods
50  G4int GetNoVoxelX() const { return fNoVoxelX; };
51  G4int GetNoVoxelY() const { return fNoVoxelY; };
52  G4int GetNoVoxelZ() const { return fNoVoxelZ; };
54 
55  G4double GetMinX() const { return fMinX; };
56  G4double GetMinY() const { return fMinY; };
57  G4double GetMinZ() const { return fMinZ; };
58  G4double GetMaxX() const { return fMaxX; };
59  G4double GetMaxY() const { return fMaxY; };
60  G4double GetMaxZ() const { return fMaxZ; };
61 
62  void SetNoVoxelX(const G4int& val) { fNoVoxelX = val; }
63  void SetNoVoxelY(const G4int& val) { fNoVoxelY = val; }
64  void SetNoVoxelZ(const G4int& val) { fNoVoxelZ = val; }
65 
66  void SetMinX(const G4double& val) { fMinX = val; };
67  void SetMaxX(const G4double& val) { fMaxX = val; };
68  void SetMinY(const G4double& val) { fMinY = val; };
69  void SetMaxY(const G4double& val) { fMaxY = val; };
70  void SetMinZ(const G4double& val) { fMinZ = val; };
71  void SetMaxZ(const G4double& val) { fMaxZ = val; };
72 
73  const G4double& GetLocation() const { return fLocation; }
74 
75  void SetLocation(const G4double& val) { fLocation = val; }
76 
79 
80 private:
81  template <typename T> inline bool CheckConsistency(const T&, const T&, G4String);
82 
83  void ReadPixelData();
84  void Print( std::ostream& out );
85 
86 protected:
91 
92  G4int fNoVoxelX, fNoVoxelY, fNoVoxelZ; // number of voxels in each dimensions
93  G4double fMinX,fMinY,fMinZ; // minimum extension of voxels (position of wall)
94  G4double fMaxX,fMaxY,fMaxZ; // maximum extension of voxels (position of wall)
95  G4double fVoxelDimX,fVoxelDimY,fVoxelDimZ; // maximum extension of voxels (position of wall)
96 
99 
100  std::vector<int> fHounsfieldV;
101 
103 };
104 
105 //============================================================================
106 template <typename T>
107 inline bool DicomVFileImage::CheckConsistency(const T& val1, const T& val2,
108  G4String category) {
109  if(val1 != val2) {
110  G4Exception("DicomVFileImager::CheckConsistency",
111  "Consistency Mismatch : Keeping previous value if nonzero",
112  JustWarning, category.c_str());
113  return false;
114  }
115  return true;
116 }
117 
118 #endif
G4double GetMaxZ() const
void SetMaxY(const G4double &val)
G4int GetNoVoxelX() const
void SetMaxZ(const G4double &val)
G4double fRescaleIntercept
DicomVFileImage operator+(const DicomVFileImage &rhs)
void SetMinZ(const G4double &val)
void SetNoVoxelZ(const G4int &val)
void SetNoVoxelX(const G4int &val)
void Print(std::ostream &out)
G4double fRescaleSlope
G4double GetMinY() const
G4double fBitAllocated
G4ThreeVector fOrientationRows
G4double GetMinX() const
void SetMinX(const G4double &val)
double G4double
Definition: G4Types.hh:76
G4double GetMinZ() const
G4ThreeVector fOrientationColumns
std::vector< int > fHounsfieldV
G4ThreeVector GetOrientationRows() const
void SetMinY(const G4double &val)
G4double GetMaxY() const
void SetMaxX(const G4double &val)
void DumpHeaderToTextFile(std::ofstream &fout)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
G4ThreeVector GetOrientationColumns() const
DicomFileMgr * theFileMgr
int G4int
Definition: G4Types.hh:78
void SetNoVoxelY(const G4int &val)
G4int GetNoVoxelZ() const
void SetLocation(const G4double &val)
const G4double & GetLocation() const
void operator+=(const DicomVFileImage &rhs)
bool CheckConsistency(const T &, const T &, G4String)
G4int GetNoVoxelY() const
G4int GetNoVoxels() const
virtual void ReadData()
G4double GetMaxX() const