Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 #include "DicomBeamControlPoint.hh" 27 28 #include "DicomBeamDevicePos.hh" 29 #include "dcmtk/dcmrt/seq/drtcps.h" // for Co 30 31 #include "globals.hh" 32 33 //....oooOO0OOooo........oooOO0OOooo........oo 34 DicomBeamControlPoint::DicomBeamControlPoint(D 35 D 36 { 37 OFString fstr; 38 Sint32 fint; 39 Float64 ffloat; 40 Float32 ffloat32; 41 OFVector<Float64> fvfloat; 42 43 cpItem.getControlPointIndex(fint); 44 G4cout << " @ DicomBeamControlPoint: " << f 45 G4cout << " " 46 << " ControlPointIndex " << fint << G 47 SetIndex(fint); 48 if (cpItem.getNominalBeamEnergy(ffloat) != E 49 if (point0) ffloat = point0->GetNominalBea 50 } 51 G4cout << " " 52 << " NominalBeamEnergy " << ffloat << 53 SetNominalBeamEnergy(ffloat); 54 cpItem.getDoseRateSet(ffloat); // != EC_Nor 55 G4cout << " " 56 << " DoseRateSet " << ffloat << G4end 57 58 DRTBeamLimitingDevicePositionSequence beamLD 59 G4cout << " @ NUMBER OF BeamLimitingDeviceP 60 << G4endl; 61 beamLDPS.gotoFirstItem(); 62 for (size_t i3 = 0; i3 < beamLDPS.getNumberO 63 DRTBeamLimitingDevicePositionSequence::Ite 64 DicomBeamDevicePos* dbd = new DicomBeamDev 65 AddDevice(dbd); 66 67 beamLDPS.gotoNextItem(); 68 } 69 70 cpItem.getGantryAngle(ffloat); 71 G4cout << " " 72 << " GantryAngle " << ffloat << G4end 73 74 cpItem.getGantryRotationDirection(fstr); // 75 G4cout << " " 76 << " GantryRotationDirection " << fst 77 if (fstr == "CC") { // counter-clockwise 78 SetGantryAngle(-ffloat); 79 } 80 else if (fstr == "CW" || fstr == "NONE" || f 81 SetGantryAngle(ffloat); 82 } 83 if (cpItem.getBeamLimitingDeviceAngle(ffloat 84 if (point0) ffloat = point0->GetBeamLimiti 85 } 86 G4cout << " " 87 << " BeamLimitingDeviceAngle " << ffl 88 89 if (cpItem.getBeamLimitingDeviceRotationDire 90 if (point0) fstr = point0->GetBeamLimiting 91 } 92 if (fstr == "CC") { // counter-clockwise 93 SetBeamLimitingDeviceAngle(-ffloat); 94 } 95 else if (fstr == "CW" || fstr == "NONE" || f 96 SetBeamLimitingDeviceAngle(ffloat); 97 } 98 G4cout << " " 99 << " BeamLimitingDeviceRotationDirect 100 SetBeamLimitingDeviceRotationDirection(fstr) 101 102 if (cpItem.getPatientSupportAngle(ffloat) != 103 if (point0) fstr = point0->GetPatientSuppo 104 } 105 G4cout << " " 106 << " PatientSupportAngle " << ffloat 107 108 if (cpItem.getPatientSupportRotationDirectio 109 if (point0) fstr = point0->GetPatientSuppo 110 } 111 G4cout << " " 112 << " PatientSupportRotationDirection 113 SetPatientSupportRotationDirection(fstr); 114 if (fstr == "CC") { // counter-clockwise 115 SetPatientSupportAngle(-ffloat); 116 } 117 else if (fstr == "CW" || fstr == "NONE" || f 118 SetPatientSupportAngle(ffloat); 119 } 120 121 if (cpItem.getTableTopEccentricAngle(ffloat) 122 if (point0) ffloat = point0->GetTableTopEc 123 } 124 G4cout << " " 125 << " TableTopEccentricAngle " << fflo 126 127 if (cpItem.getTableTopEccentricRotationDirec 128 if (point0) fstr = point0->GetTableTopEcce 129 } 130 if (fstr == "CC") { // counter-clockwise 131 SetTableTopEccentricAngle(-ffloat); 132 } 133 else if (fstr == "CW" || fstr == "NONE" || f 134 SetTableTopEccentricAngle(ffloat); 135 } 136 G4cout << " " 137 << " TableTopEccentricRotationDirecti 138 SetTableTopEccentricRotationDirection(fstr); 139 140 G4ThreeVector isoCenter; 141 if (cpItem.getIsocenterPosition(fvfloat) != 142 if (point0) isoCenter = point0->GetIsocent 143 } 144 else { 145 isoCenter = G4ThreeVector(fvfloat[0], fvfl 146 } 147 G4cout << " " 148 << " IsocenterPosition " << isoCenter 149 SetIsocenterPosition(isoCenter); 150 151 if (cpItem.getSourceToSurfaceDistance(ffloat 152 if (point0) ffloat = point0->GetSourceToSu 153 } 154 G4cout << " " 155 << " SourceToSurfaceDistance " << ffl 156 SetSourceToSurfaceDistance(ffloat); 157 158 cpItem.getCumulativeMetersetWeight(ffloat); 159 G4cout << " " 160 << " CumulativeMetersetWeight " << ff 161 SetCumulativeMetersetWeight(ffloat); 162 163 if (cpItem.getGantryPitchAngle(ffloat32) != 164 if (point0) ffloat32 = point0->GetGantryPi 165 } 166 G4cout << " " 167 << " GantryPitchAngle " << ffloat32 < 168 SetGantryPitchAngle(ffloat32); 169 170 if (cpItem.getSurfaceEntryPoint(ffloat) != E 171 if (point0) ffloat = point0->GetSurfaceEnt 172 } 173 G4cout << " " 174 << " SurfaceEntryPoint " << ffloat << 175 SetSurfaceEntryPoint(ffloat); 176 177 if (cpItem.getTableTopEccentricAxisDistance( 178 if (point0) ffloat = point0->GetTableTopEc 179 } 180 G4cout << " " 181 << " TableTopEccentricAxisDistance " 182 SetTableTopEccentricAxisDistance(ffloat); 183 184 if (cpItem.getTableTopLateralPosition(ffloat 185 if (point0) ffloat = point0->GetTableTopLa 186 } 187 G4cout << " " 188 << " TableTopLateralPosition " << ffl 189 SetTableTopLateralPosition(ffloat); 190 191 if (cpItem.getTableTopLongitudinalPosition(f 192 if (point0) ffloat = point0->GetTableTopLo 193 } 194 G4cout << " " 195 << " TableTopLongitudinalPosition " < 196 SetTableTopLongitudinalPosition(ffloat); 197 198 if (cpItem.getTableTopPitchAngle(ffloat32) ! 199 if (point0) ffloat32 = point0->GetTableTop 200 } 201 G4cout << " " 202 << " TableTopPitchAngle " << ffloat32 203 204 if (cpItem.getTableTopPitchRotationDirection 205 if (point0) fstr = point0->GetTableTopPitc 206 } 207 if (fstr == "CC") { // counter-clockwise 208 SetTableTopPitchAngle(-ffloat32); 209 } 210 else if (fstr == "CW" || fstr == "NONE" || f 211 SetTableTopPitchAngle(ffloat32); 212 } 213 G4cout << " " 214 << " TableTopPitchRotationDirection " 215 SetTableTopPitchRotationDirection(fstr); 216 217 if (cpItem.getTableTopRollAngle(ffloat32) != 218 if (point0) ffloat32 = point0->GetTableTop 219 } 220 G4cout << " " 221 << " TableTopRollAngle " << ffloat32 222 223 if (cpItem.getTableTopRollRotationDirection( 224 if (point0) fstr = point0->GetTableTopRoll 225 } 226 if (fstr == "CC") { // counter-clockwise 227 SetTableTopRollAngle(-ffloat32); 228 } 229 else if (fstr == "CW" || fstr == "NONE" || f 230 SetTableTopRollAngle(ffloat32); 231 } 232 G4cout << " " 233 << " TableTopRollRotationDirection " 234 SetTableTopRollRotationDirection(fstr); 235 236 if (cpItem.getTableTopVerticalPosition(ffloa 237 if (point0) ffloat = point0->GetTableTopVe 238 } 239 G4cout << " " 240 << " TableTopVerticalPosition " << ff 241 SetTableTopVerticalPosition(ffloat); 242 243 // --- get DICOM sequence attributes --- 244 // t DRTWedgePositionSequence &getWed 245 // t const DRTWedgePositionSequence & 246 } 247 248 //....oooOO0OOooo........oooOO0OOooo........oo 249 void DicomBeamControlPoint::Print(std::ostream 250 251 //....oooOO0OOooo........oooOO0OOooo........oo 252 void DicomBeamControlPoint::DumpToFile(std::of 253 { 254 fout << ":P ControlPointIndex " << theIndex 255 fout << ":P NominalBeamEnergy " << theNomina 256 fout << ":P IsocenterPositionX " << theIsoce 257 fout << ":P IsocenterPositionY " << theIsoce 258 fout << ":P IsocenterPositionZ " << theIsoce 259 260 // std::string iistr = std::to_string(theCo 261 fout << ":P SourceToSurfaceDistance " << the 262 fout << ":P GantryAngle " << theGantryAngle 263 fout << ":P BeamLimitingDeviceAngle " << the 264 fout << ":P PatientSupportAngle " << thePati 265 fout << ":P TableTopEccentricAngle " << theT 266 fout << ":P SourceToSurfaceDistance " << the 267 fout << ":P MetersetWeight " << theMetersetW 268 fout << ":P GantryPitchAngle " << theGantryP 269 fout << ":P SurfaceEntryPoint " << theSurfac 270 fout << ":P TableTopEccentricAxisDistance " 271 fout << ":P TableTopLateralPosition " << the 272 fout << ":P TableTopLongitudinalPosition " < 273 fout << ":P TableTopPitchAngle " << theTable 274 fout << ":P TableTopRollAngle " << theTableT 275 fout << ":P TableTopVerticalPosition " << th 276 277 for (size_t ii = 0; ii < theDevices.size(); 278 theDevices[ii]->DumpToFile(fout); 279 } 280 } 281