62 G4cout <<
" DicomPhantomZSliceHeader reading number of materials " << nmate <<
G4endl;
65 for(
G4int im = 0; im < nmate; im++ ){
66 fin >> mateindex >> matename;
68 G4cout <<
" DicomPhantomZSliceHeader reading material " << im <<
" : " << mateindex <<
" " << matename <<
G4endl;
71 if( ! CheckMaterialExists( matename ) ) {
72 G4Exception(
"DicomPhantomZSliceHeader::DicomPhantomZSliceHeader",
"A material is found in file that is not built in the C++ code",
FatalErrorInArgument,matename.c_str());
75 fMaterialNames.push_back(matename);
79 fin >> fNoVoxelX >> fNoVoxelY >> fNoVoxelZ;
81 G4cout <<
" Number of voxels " << fNoVoxelX <<
" " << fNoVoxelY <<
" " << fNoVoxelZ <<
G4endl;
85 fin >> fMinX >> fMaxX;
86 fin >> fMinY >> fMaxY;
87 fin >> fMinZ >> fMaxZ;
89 G4cout <<
" Extension in X " << fMinX <<
" " << fMaxX << G4endl
90 <<
" Extension in Y " << fMinY <<
" " << fMaxY << G4endl
91 <<
" Extension in Z " << fMinZ <<
" " << fMaxZ <<
G4endl;
97 G4bool DicomPhantomZSliceHeader::CheckMaterialExists(
const G4String& mateName )
102 std::vector<G4Material*>::const_iterator matite;
103 for( matite = matTab->begin(); matite != matTab->end(); matite++ ) {
104 if( (*matite)->GetName() == mateName ) {
126 G4cerr <<
"DicomPhantomZSliceHeader error adding two slice headers: !!! Different number of voxels: "
127 <<
" X= " << fNoVoxelX <<
" =? " << rhs.
GetNoVoxelX()
128 <<
" Y= " << fNoVoxelY <<
" =? " << rhs.
GetNoVoxelY()
129 <<
" Z= " << fNoVoxelZ <<
" =? " << rhs.
GetNoVoxelZ()
136 G4cerr <<
"DicomPhantomZSliceHeader error adding two slice headers: !!! Different extensions: "
137 <<
" Xmin= " << fMinX <<
" =? " << rhs.
GetMinX()
138 <<
" Xmax= " << fMaxX <<
" =? " << rhs.
GetMaxX()
139 <<
" Ymin= " << fMinY <<
" =? " << rhs.
GetMinY()
140 <<
" Ymax= " << fMaxY <<
" =? " << rhs.
GetMaxY()
147 if( fMaterialNames.size() != fMaterialNames2.size() ) {
148 G4cerr <<
"DicomPhantomZSliceHeader error adding two slice headers: !!! Different number of materials: " << fMaterialNames.size() <<
" =? " << fMaterialNames2.size() <<
G4endl;
151 for(
unsigned int ii = 0; ii < fMaterialNames.size(); ii++ ) {
152 if( fMaterialNames[ii] != fMaterialNames2[ii] ) {
153 G4cerr <<
"DicomPhantomZSliceHeader error adding two slice headers: !!! Different material number " << ii <<
" : " << fMaterialNames[ii] <<
" =? " << fMaterialNames2[ii] <<
G4endl;
161 G4cerr <<
"DicomPhantomZSliceHeader error adding two slice headers: !!! Slices are not contiguous in Z "
162 <<
" Zmin= " << fMinZ <<
" & " << rhs.
GetMinZ()
163 <<
" Zmax= " << fMaxZ <<
" & " << rhs.
GetMaxZ()