59{
60
61
63 if (argc == 1)
65
67 char* part = std::getenv("DICOM_PARTIAL_PARAM");
68 G4bool bPartial = (part &&
G4String(part) ==
"1") ?
true : false;
69
71 CLHEP::HepRandom::setTheSeed(G4long(24534575684783));
72 G4long seeds[2];
73 seeds[0] = G4long(534524575674523);
74 seeds[1] = G4long(526345623452457);
75 CLHEP::HepRandom::setTheSeeds(seeds);
76
77
78 G4int nthreads = G4GetEnv<G4int>("DICOM_NTHREADS", G4Thread::hardware_concurrency());
79 auto* runManager = G4RunManagerFactory::CreateRunManager();
80 runManager->SetNumberOfThreads(nthreads);
81
82 G4cout << "\n\n\tDICOM2 running with "
83 << runManager->GetNumberOfThreads()
84 << " threads\n\n" << G4endl;
85
87
88#ifdef G4_DCMTK
90#else
92#endif
93
94 if( !bPartial )
95 {
96#ifdef G4_DCMTK
98 char* env_inpfile = std::getenv("DICOM_INPUT_FILE");
99 if(env_inpfile)
100 inpfile = env_inpfile;
101
104#else
105
108#endif
109
110
111 char* nest = std::getenv( "DICOM_NESTED_PARAM" );
112 if( nest &&
G4String(nest) ==
"1" ) {
114 } else {
116 }
117 } else {
119 }
120 runManager->SetUserInitialization(theGeometry);
121
122
123
124
126 phys->SetDefaultCutValue(0.5*CLHEP::mm);
127 runManager->SetUserInitialization(phys);
128
129
131
132 runManager->Initialize();
133
135
136
137
139
140
141 visManager->Initialize();
142
143
144 G4UImanager* UImanager = G4UImanager::GetUIpointer();
145
147 t.Start();
148
149
150
151 if ( ! ui ) {
152
153 G4String command =
"/control/execute ";
155 UImanager->ApplyCommand(command+fileName);
156 }
157 else {
158
159 UImanager->ApplyCommand("/control/execute vis.mac");
160 ui->SessionStart();
161 delete ui;
162 }
163
164 t.Stop();
165
166
167
168
169
170
171 delete visManager;
172 delete runManager;
173
174 if( !bPartial )
175 {
176#ifdef G4_DCMTK
177 delete theFileMgr;
178#endif
179 }
180
181 G4cout << "\n[" << argv[0] << "] Primary execution time: " << t << "\n"
182 << G4endl;
183}
Action initialization class.
static DicomFileMgr * GetInstance()
void Convert(G4String fFileName)
static DicomHandler * Instance()
Manages intersections of DICOM files with volumes.
Construct the phantom using DicomPhantomParameterisationColour.
Construct a DICOM Geant4 geometry produced from the intersetion of a DICOM file and a volume.
DicomRegularDetectorConstruction class.