Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DicomFilePlan Class Reference

#include <DicomFilePlan.hh>

Inheritance diagram for DicomFilePlan:
Collaboration diagram for DicomFilePlan:

Public Member Functions

 DicomFilePlan (DcmDataset *dset)
 
 ~DicomFilePlan ()
 
virtual void ReadData ()
 
void CheckData0 (OFString title, Sint32 val)
 
void DumpToFile ()
 
void SetControlPointMetersets ()
 
- Public Member Functions inherited from DicomVFile
 DicomVFile ()
 
 DicomVFile (DcmDataset *dset)
 
 ~DicomVFile ()
 
void SetFileName (G4String fName)
 

Additional Inherited Members

- Protected Member Functions inherited from DicomVFile
virtual std::vector< G4doubleRead1Data (DcmDataset *dset, DcmTagKey tagKey, G4int nData)
 
virtual OFString Read1DataStr (DcmDataset *dset, DcmTagKey tagKey)
 
- Protected Attributes inherited from DicomVFile
DcmDataset * theDataset
 
G4String fFileName
 

Detailed Description

Definition at line 36 of file DicomFilePlan.hh.

Constructor & Destructor Documentation

DicomFilePlan::DicomFilePlan ( DcmDataset *  dset)

Definition at line 51 of file DicomFilePlan.cc.

51  : DicomVFile(dset)
52 {
53 }
DicomFilePlan::~DicomFilePlan ( )
inline

Definition at line 40 of file DicomFilePlan.hh.

40 {};

Member Function Documentation

void DicomFilePlan::CheckData0 ( OFString  title,
Sint32  val 
)

Definition at line 268 of file DicomFilePlan.cc.

269 {
270  if( val != 0 ){
271  G4Exception("DicomFilePlan::CheckData",
272  "DFP003",
274  (title + " exists, and code is not ready ").c_str());
275  }
276 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
subroutine title
Definition: hijing1.383.f:5980

Here is the call graph for this function:

Here is the caller graph for this function:

void DicomFilePlan::DumpToFile ( )

Definition at line 287 of file DicomFilePlan.cc.

288 {
289  for( size_t ii = 0; ii < theBeams.size(); ii++ ){
290  theBeams[ii]->DumpToFile();
291  }
292 }
void DicomFilePlan::ReadData ( )
virtual

Implements DicomVFile.

Definition at line 56 of file DicomFilePlan.cc.

57 {
58  DRTPlanIOD rtplan;
59  OFCondition result = rtplan.read(*theDataset);
60  if (!result.good()) {
61  G4Exception("DicomFilePlan::ReadData",
62  "DFS001",
64  result.text());
65  }
66  OFString fstr;
67  Sint32 fint;
68  Float64 ffloat;
69  OFVector<Float64> fvfloat;
70 
71  DRTFractionGroupSequence frgSeq = rtplan.getFractionGroupSequence();
72  if( frgSeq.isEmpty() ) {
73  G4Exception("DicomFilePlan::ReadData",
74  "DFS002",
76  "DRTFractionGroupSequence is empty");
77  }
78  G4cout << "@@@@@ NUMBER OF FractionSequences " << frgSeq.getNumberOfItems() << G4endl;
79  frgSeq.gotoFirstItem();
80  for( size_t i1 = 0; i1 < frgSeq.getNumberOfItems(); i1++ ) {
81  DRTFractionGroupSequence::Item &rfgItem = frgSeq.getCurrentItem();
82  rfgItem.getBeamDoseMeaning(fstr);
83  G4cout << " " << i1 << " BeamDoseMeaning " << fstr << G4endl;
84  rfgItem.getFractionGroupDescription(fstr);
85  G4cout << " " << i1 << " FractionGroupDescription " << fstr << G4endl;
86  rfgItem.getFractionGroupNumber(fint);
87  G4cout << " " << i1 << " FractionGroupNumber " << fint << G4endl;
88  rfgItem.getFractionPattern(fstr);
89  G4cout << " " << i1 << " FractionPattern " << fstr << G4endl;
90  rfgItem.getNumberOfBeams(fint);
91  G4cout << " " << i1 << " NumberOfBeams " << fint << G4endl;
92  theNumberOfBeams = fint;
93  rfgItem.getNumberOfBrachyApplicationSetups(fint);
94  G4cout << " " << i1 << " NumberOfBrachyApplicationSetups " << fint << G4endl;
95  CheckData0(" NumberOfBrachyApplicationSetups ", fint);
96  rfgItem.getNumberOfFractionPatternDigitsPerDay(fint);
97  G4cout << " " << i1 << " NumberOfFractionPatternDigitsPerDay " << fint << G4endl;
98  rfgItem.getNumberOfFractionsPlanned(fint);
99  G4cout << " " << i1 << " NumberOfFractionsPlanned " << fint << G4endl;
100  rfgItem.getRepeatFractionCycleLength(fint);
101  G4cout << " " << i1 << " RepeatFractionCycleLength " << fint << G4endl;
102  DRTReferencedBeamSequenceInRTFractionSchemeModule refBeamSeq =
103  rfgItem.getReferencedBeamSequence();
104  G4cout << " @@@ NUMBER OF ReferencedBeamSequences " << refBeamSeq.getNumberOfItems() << G4endl;
105 
106  refBeamSeq.gotoFirstItem();
107  for( size_t i2 = 0; i2 < refBeamSeq.getNumberOfItems(); i2++ ) {
108  DicomBeam* db = new DicomBeam();
109  theBeams.push_back(db);
110  DRTReferencedBeamSequenceInRTFractionSchemeModule::Item &rbsItem =
111  refBeamSeq.getCurrentItem();
112  rbsItem.getBeamDeliveryDurationLimit(ffloat);
113  G4cout << " " << i2 << " BeamDeliveryDurationLimit " << ffloat << G4endl;
114  rbsItem.getBeamDose(ffloat);
115  G4cout << " " << i2 << " BeamDose " << ffloat << G4endl; // dose at dose point
116  rbsItem.getBeamDoseSpecificationPoint(fvfloat);
117  G4cout << " " << i2 << " BeamDoseSpecificationPoint (" << fvfloat[0] << "," << fvfloat[1]
118  << "," << fvfloat[2] << ")" << G4endl;
119  db->SetDoseSpecificationPoint(G4ThreeVector(fvfloat[0],fvfloat[1],fvfloat[2]));
120  rbsItem.getBeamMeterset(ffloat);
121  G4cout << " " << i2 << " BeamMeterset " << ffloat << G4endl;
122  db->SetMeterset(ffloat);
123  rbsItem.getReferencedBeamNumber(fint);
124  G4cout << " " << i2 << " ReferencedBeamNumber " << fint << G4endl;
125 
126  refBeamSeq.gotoNextItem();
127  }
128 
129  frgSeq.gotoNextItem();
130  }
131 
132 
133  DRTBeamSequence beamSeq = rtplan.getBeamSequence();
134  if( beamSeq.isEmpty() ) {
135  G4Exception("DicomFilePlan::ReadData",
136  "DFS002",
137  JustWarning,
138  "DRTBeamSequence is empty");
139  }
140  G4cout << "@@@@@ NUMBER OF BeamSequences " << beamSeq.getNumberOfItems() << G4endl;
141  beamSeq.gotoFirstItem();
142  for( size_t i1 = 0; i1 < beamSeq.getNumberOfItems(); i1++ ) {
143  DicomBeam* db = theBeams[i1];
144  DRTBeamSequence::Item &beamItem = beamSeq.getCurrentItem();
145 
146  beamItem.getManufacturer(fstr);
147  G4cout << " " << i1 << " Manufacturer " << fstr << G4endl;
148  beamItem.getManufacturerModelName(fstr);
149  G4cout << " " << i1 << " ManufacturerModelName " << fstr << G4endl;
150  beamItem.getTreatmentMachineName(fstr);
151  G4cout << " " << i1 << " TreatmentMachineName " << fstr << G4endl;
152  beamItem.getPrimaryDosimeterUnit(fstr);
153  G4cout << " " << i1 << " PrimaryDosimeterUnit " << fstr << G4endl;
154  beamItem.getSourceAxisDistance(ffloat);
155  G4cout << " " << i1 << " SourceAxisDistance " << ffloat << G4endl;
156  db->SetSourceAxisDistance(ffloat);
157 
158  DRTBeamLimitingDeviceSequenceInRTBeamsModule beamLDS = beamItem.getBeamLimitingDeviceSequence();
159  G4cout << " @@@ NUMBER OF BeamLimitingDeviceSequence " << beamLDS.getNumberOfItems() << G4endl;
160  beamLDS.gotoFirstItem();
161  for( size_t i2 = 0; i2 < beamLDS.getNumberOfItems(); i2++ ) {
162  DRTBeamLimitingDeviceSequenceInRTBeamsModule::Item bldsItem = beamLDS.getCurrentItem();
163  DicomBeamDeviceRef* dbd = new DicomBeamDeviceRef(bldsItem);
164  db->AddDevice(dbd);
165 
166  beamLDS.gotoNextItem();
167  }
168 
169  beamItem.getBeamNumber(fint);
170  G4cout << " " << i1 << " BeamNumber " << fint << G4endl;
171  db->SetNumber(fint);
172  beamItem.getBeamName(fstr);
173  G4cout << " " << i1 << " BeamName " << fstr << G4endl;
174  beamItem.getBeamDescription(fstr);
175  G4cout << " " << i1 << " BeamDescription " << fstr << G4endl;
176  beamItem.getBeamType(fstr);
177  G4cout << " " << i1 << " BeamType " << fstr << G4endl;
178  beamItem.getRadiationType(fstr);
179  G4cout << " " << i1 << " RadiationType " << fstr << G4endl;
180  db->SetRadiationType(fstr);
181  beamItem.getTreatmentDeliveryType(fstr);
182  G4cout << " " << i1 << " TreatmentDeliveryType " << fstr << G4endl;
183  beamItem.getNumberOfWedges(fint);
184  G4cout << " " << i1 << " NumberOfWedges " << fint << G4endl;
185  DRTWedgeSequence beamWedge = beamItem.getWedgeSequence();
186  beamWedge.gotoFirstItem();
187  for( size_t i2 = 0; i2 < beamWedge.getNumberOfItems(); i2++ ) {
188  DRTWedgeSequence::Item bwedItem = beamWedge.getCurrentItem();
189  DicomBeamWedge* dbwed = new DicomBeamWedge( bwedItem );
190  db->AddWedge( dbwed );
191  beamWedge.gotoNextItem();
192  }
193 
194  beamItem.getNumberOfCompensators(fint);
195  G4cout << " " << i1 << " NumberOfCompensators " << fint << G4endl;
196  DRTCompensatorSequence beamCompens = beamItem.getCompensatorSequence();
197  beamCompens.gotoFirstItem();
198  for( size_t i2 = 0; i2 < beamCompens.getNumberOfItems(); i2++ ) {
199  DRTCompensatorSequence::Item bcompItem = beamCompens.getCurrentItem();
200  DicomBeamCompensator* dbcomp = new DicomBeamCompensator( bcompItem );
201  db->AddCompensator( dbcomp );
202  beamCompens.gotoNextItem();
203  }
204 
205  beamItem.getNumberOfBoli(fint);
206  G4cout << " " << i1 << " NumberOfBoli " << fint << G4endl;
207  //Bolus has no relevant info (see drtrbos1.h)
208 
209  beamItem.getNumberOfBlocks(fint);
210  G4cout << " " << i1 << " NumberOfBlocks " << fint << G4endl;
211  DRTBlockSequenceInRTBeamsModule beamBlock = beamItem.getBlockSequence();
212  beamBlock.gotoFirstItem();
213  for( size_t i2 = 0; i2 < beamBlock.getNumberOfItems(); i2++ ) {
214  DRTBlockSequenceInRTBeamsModule::Item bblItem = beamBlock.getCurrentItem();
215  DicomBeamBlock* dbbl = new DicomBeamBlock( bblItem );
216  db->AddBlock( dbbl );
217  beamBlock.gotoNextItem();
218  }
219 
220  beamItem.getFinalCumulativeMetersetWeight(fstr);
221  G4cout << " " << i1 << " FinalCumulativeMetersetWeight " << fstr << G4endl;
222  beamItem.getDeviceSerialNumber(fstr);
223  G4cout << " " << i1 << " DeviceSerialNumber " << fstr << G4endl;
224  beamItem.getHighDoseTechniqueType(fstr);
225  G4cout << " " << i1 << " HighDoseTechniqueType " << fstr << G4endl;
226  beamItem.getInstitutionAddress(fstr);
227  G4cout << " " << i1 << " InstitutionAddress " << fstr << G4endl;
228  beamItem.getInstitutionName(fstr);
229  G4cout << " " << i1 << " InstitutionName " << fstr << G4endl;
230  beamItem.getInstitutionalDepartmentName(fstr);
231  G4cout << " " << i1 << " InstitutionalDepartmentName " << fstr << G4endl;
232  beamItem.getReferencedPatientSetupNumber(fint);
233  G4cout << " " << i1 << " ReferencedPatientSetupNumber " << fint << G4endl;
234  beamItem.getReferencedToleranceTableNumber(fint);
235  G4cout << " " << i1 << " ReferencedToleranceTableNumber " << fint << G4endl;
236  beamItem.getTotalBlockTrayFactor(ffloat);
237  G4cout << " " << i1 << " TotalBlockTrayFactor " << ffloat << G4endl;
238  beamItem.getTotalCompensatorTrayFactor(ffloat);
239  G4cout << " " << i1 << " TotalCompensatorTrayFactor " << ffloat << G4endl;
240 
241  beamItem.getNumberOfControlPoints(fint);
242  DRTControlPointSequence controlPSeq = beamItem.getControlPointSequence();
243  G4cout << " @@@ NUMBER OF ControlPointSequences " << controlPSeq.getNumberOfItems() << " = "
244  << fint << G4endl;
245  controlPSeq.gotoFirstItem();
246  DicomBeamControlPoint* dbcp0 = 0;
247  // Only first ControlPoint has some info if it does not change
248  for( size_t i2 = 0; i2 < controlPSeq.getNumberOfItems(); i2++ ) {
249  DRTControlPointSequence::Item &cpItem = controlPSeq.getCurrentItem();
250  if( db->GetNControlPoints() != 0 ) dbcp0 = db->GetControlPoint(0);
251  DicomBeamControlPoint* dbcp = new DicomBeamControlPoint( cpItem, dbcp0 );
252  db->AddControlPoint( dbcp );
253  controlPSeq.gotoNextItem();
254 
255  }
256 
257  beamSeq.gotoNextItem();
258  }
259 
260  //(300a,0180) SQ (Sequence with explicit length #=1) # 30, 1 PatientSetupSequence
261  //(300c,0060) SQ (Sequence with explicit length #=1) # 112, 1 ReferencedStructureSetSequence
262  //(300e,0002) CS [UNAPPROVED] # 10, 1 ApprovalStatus
263  //(7fe0,0010) OW (no value available) # 0, 1 PixelData
264 
265 }
G4double G4ParticleHPJENDLHEData::G4double result
void SetMeterset(Float64 dat)
Definition: DicomBeam.hh:50
CLHEP::Hep3Vector G4ThreeVector
void SetRadiationType(OFString dat)
Definition: DicomBeam.hh:59
void AddDevice(DicomVBeamDevice *db)
Definition: DicomBeam.hh:62
void CheckData0(OFString title, Sint32 val)
void SetDoseSpecificationPoint(G4ThreeVector point)
Definition: DicomBeam.hh:47
DicomBeamControlPoint * GetControlPoint(size_t ii)
Definition: DicomBeam.hh:80
G4GLOB_DLL std::ostream G4cout
void AddCompensator(DicomBeamCompensator *db)
Definition: DicomBeam.hh:68
DcmDataset * theDataset
Definition: DicomVFile.hh:52
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void AddControlPoint(DicomBeamControlPoint *db)
Definition: DicomBeam.hh:65
size_t GetNControlPoints() const
Definition: DicomBeam.hh:77
void AddWedge(DicomBeamWedge *db)
Definition: DicomBeam.hh:74
#define G4endl
Definition: G4ios.hh:61
void SetSourceAxisDistance(Float64 dat)
Definition: DicomBeam.hh:53
void SetNumber(Sint32 dat)
Definition: DicomBeam.hh:56
void AddBlock(DicomBeamBlock *db)
Definition: DicomBeam.hh:71

Here is the call graph for this function:

Here is the caller graph for this function:

void DicomFilePlan::SetControlPointMetersets ( )

Definition at line 279 of file DicomFilePlan.cc.

280 {
281  for( size_t ii = 0; ii < theBeams.size(); ii++ ){
282  theBeams[ii]->SetControlPointMetersets();
283  }
284 }

The documentation for this class was generated from the following files: