Changeset 1347 for trunk/source/visualization/gMocren/src
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (14 years ago)
- Location:
- trunk/source/visualization/gMocren/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/gMocren/src/CVS/Entries
r1346 r1347 1 /G4GMocrenFile.cc/1.2/Mon Oct 12 10:04:35 2009//Tgeant4-09-04-ref-00 2 /G4GMocrenFileCTtoDensityMap.cc/1.2/Wed Dec 16 17:51:27 2009//Tgeant4-09-04-ref-00 3 /G4GMocrenFileSceneHandler.cc/1.18/Wed Nov 10 23:53:23 2010//Tgeant4-09-04-ref-00 4 /G4GMocrenFileViewer.cc/1.4/Wed Nov 10 23:53:23 2010//Tgeant4-09-04-ref-00 5 /G4GMocrenIO.cc/1.6/Wed Nov 10 23:53:23 2010//Tgeant4-09-04-ref-00 6 /G4GMocrenMessenger.cc/1.2/Mon Oct 12 10:04:35 2009//Tgeant4-09-04-ref-00 1 7 D -
trunk/source/visualization/gMocren/src/G4GMocrenFile.cc
r1337 r1347 26 26 // 27 27 // $Id: G4GMocrenFile.cc,v 1.2 2009/10/12 10:04:35 akimura Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.1 7 2010/09/03 16:01:21 gcosmoExp $28 // GEANT4 tag $Name: $27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.18 2010/11/10 23:53:23 akimura Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 43 43 44 44 #include "globals.hh" 45 #include "G4VisManager.hh" 46 45 47 #include "G4GMocrenFile.hh" 46 48 #include "G4GMocrenFileSceneHandler.hh" … … 156 158 G4GMocrenFileSceneHandler::~G4GMocrenFileSceneHandler () 157 159 { 158 if(GFDEBUG) G4cerr << "***** ~G4GMocrenFileSceneHandler" << G4endl; 160 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 161 G4cout << "***** ~G4GMocrenFileSceneHandler" << G4endl; 159 162 160 163 if(kGddDest) { … … 199 202 if( i == MAX_FILE_INDEX ) 200 203 { 201 G4cerr << "===========================================" << G4endl; 202 G4cerr << "WARNING MESSAGE from GMocrenFile driver: " << G4endl; 203 G4cerr << " This file name is the final one in the " << G4endl; 204 G4cerr << " automatic updation of the output file name." << G4endl; 205 G4cerr << " You may overwrite existing files, i.e. " << G4endl; 206 G4cerr << " g4_XX.gdd." << G4endl; 207 G4cerr << "===========================================" << G4endl; 204 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) { 205 G4cout << "===========================================" << G4endl; 206 G4cout << "WARNING MESSAGE from GMocrenFile driver: " << G4endl; 207 G4cout << " This file name is the final one in the " << G4endl; 208 G4cout << " automatic updation of the output file name." << G4endl; 209 G4cout << " You may overwrite existing files, i.e. " << G4endl; 210 G4cout << " g4_XX.gdd." << G4endl; 211 G4cout << "===========================================" << G4endl; 212 } 208 213 } 209 214 … … 231 236 } // for 232 237 233 G4c err<< "======================================================================" << G4endl;234 G4c err<< "Output file: " << kGddFileName << G4endl;235 G4c err<< "Destination directory (current dir if NULL): " << kGddDestDir << G4endl;236 G4c err<< "Maximum number of files in the destination directory: " << kMaxFileNum << G4endl;237 G4c err<< "Note:" << G4endl;238 G4c err<< " * The maximum number is customizable as: " << G4endl;239 G4c err<< " % setenv G4GMocrenFile_MAX_FILE_NUM number " << G4endl;240 G4c err<< " * The destination directory is customizable as:" << G4endl;241 G4c err<< " % setenv G4GMocrenFile_DEST_DIR dir_name/ " << G4endl;242 G4c err<< " ** Do not forget \"/\" at the end of the dir_name, e.g. \"./tmp/\"." << G4endl;243 //G4c err<< " dir_name, e.g. \"./tmp/\"." << G4endl;244 G4c err<< G4endl;245 G4c err<< "Maximum number of trajectories is set to " << MAX_NUM_TRAJECTORIES << "."<< G4endl;246 G4c err<< "======================================================================" << G4endl;238 G4cout << "======================================================================" << G4endl; 239 G4cout << "Output file: " << kGddFileName << G4endl; 240 G4cout << "Destination directory (current dir if NULL): " << kGddDestDir << G4endl; 241 G4cout << "Maximum number of files in the destination directory: " << kMaxFileNum << G4endl; 242 G4cout << "Note:" << G4endl; 243 G4cout << " * The maximum number is customizable as: " << G4endl; 244 G4cout << " % setenv G4GMocrenFile_MAX_FILE_NUM number " << G4endl; 245 G4cout << " * The destination directory is customizable as:" << G4endl; 246 G4cout << " % setenv G4GMocrenFile_DEST_DIR dir_name/ " << G4endl; 247 G4cout << " ** Do not forget \"/\" at the end of the dir_name, e.g. \"./tmp/\"." << G4endl; 248 //G4cout << " dir_name, e.g. \"./tmp/\"." << G4endl; 249 G4cout << G4endl; 250 G4cout << "Maximum number of trajectories is set to " << MAX_NUM_TRAJECTORIES << "."<< G4endl; 251 G4cout << "======================================================================" << G4endl; 247 252 248 253 } // G4GMocrenFileSceneHandler::SetGddFileName() … … 252 257 void G4GMocrenFileSceneHandler::BeginSavingGdd( void ) 253 258 { 254 if(GFDEBUG) G4cerr << "***** BeginSavingGdd (called)" << G4endl; 259 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 260 G4cout << "***** BeginSavingGdd (called)" << G4endl; 255 261 256 262 if( !IsSavingGdd() ) { 257 263 258 if(GFDEBUG ) {259 G4c err<< "***** (started) " ;260 G4c err<< "(open g4.gdd, ##)" << G4endl;264 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) { 265 G4cout << "***** (started) " ; 266 G4cout << "(open g4.gdd, ##)" << G4endl; 261 267 } 262 268 … … 294 300 295 301 } else { 296 G4c err<< "cann't open the file : " << fname << G4endl;302 G4cout << "cann't open the file : " << fname << G4endl; 297 303 } 298 304 */ … … 322 328 void G4GMocrenFileSceneHandler::EndSavingGdd ( void ) 323 329 { 324 if(GFDEBUG) G4cerr << "***** EndSavingGdd (called)" << G4endl; 330 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 331 G4cout << "***** EndSavingGdd (called)" << G4endl; 325 332 326 333 if(IsSavingGdd()) { 327 if(GFDEBUG) G4cerr << "***** (started) (close " 328 << kGddFileName << ")" << G4endl; 334 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 335 G4cout << "***** (started) (close " 336 << kGddFileName << ")" << G4endl; 329 337 330 338 if(kGddDest) kGddDest.close(); … … 483 491 484 492 485 if(GFDEBUG) G4cerr << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl; 493 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 494 G4cout << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl; 486 495 487 496 //----- Send saving command and heading comment … … 511 520 void G4GMocrenFileSceneHandler::AddPrimitive (const G4Polyline& polyline) 512 521 { 513 if(GFDEBUG) G4cerr << "***** AddPrimitive" << G4endl; 522 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 523 G4cout << "***** AddPrimitive" << G4endl; 514 524 515 525 … … 591 601 { 592 602 //----- 593 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4NURBS )" << G4endl; 603 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 604 G4cout << "***** AddPrimitive( G4NURBS )" << G4endl; 594 605 595 606 //----- Initialize if necessary … … 607 618 608 619 //----- 609 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Text )" << G4endl; 620 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 621 G4cout << "***** AddPrimitive( G4Text )" << G4endl; 610 622 611 623 //----- Initialize IF NECESSARY … … 622 634 623 635 //----- 624 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Circle )" << G4endl; 636 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 637 G4cout << "***** AddPrimitive( G4Circle )" << G4endl; 625 638 626 639 //----- Initialize IF NECESSARY … … 638 651 639 652 //----- 640 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Square )" << G4endl; 653 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 654 G4cout << "***** AddPrimitive( G4Square )" << G4endl; 641 655 642 656 //----- Initialize if necessary … … 650 664 { 651 665 //----- 652 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Polyhedron )" << G4endl; 666 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 667 G4cout << "***** AddPrimitive( G4Polyhedron )" << G4endl; 653 668 654 669 … … 678 693 break; 679 694 default: 680 G4cerr << 681 "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl; 695 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 696 G4cout << 697 "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl; 682 698 G4PhysicalVolumeModel* pPVModel = 683 699 dynamic_cast<G4PhysicalVolumeModel*>(fpModel); 684 if (pPVModel) G4cerr << 685 "Volume " << pPVModel->GetCurrentPV()->GetName() << 686 ", Solid " << pPVModel->GetCurrentLV()->GetSolid()->GetName() << 687 " (" << pPVModel->GetCurrentLV()->GetSolid()->GetEntityType(); 688 G4cerr << 689 "\nG4Polyhedron facet with " << i << " edges" << G4endl; 700 if (pPVModel) 701 if(G4VisManager::GetVerbosity() >= G4VisManager::errors) 702 G4cout << "Volume " << pPVModel->GetCurrentPV()->GetName() << 703 ", Solid " << pPVModel->GetCurrentLV()->GetSolid()->GetName() << 704 " (" << pPVModel->GetCurrentLV()->GetSolid()->GetEntityType(); 705 706 if(G4VisManager::GetVerbosity() >= G4VisManager::errors) 707 G4cout << 708 "\nG4Polyhedron facet with " << i << " edges" << G4endl; 690 709 } 691 710 } … … 700 719 701 720 //----- 702 if(GFDEBUG) G4cerr << "***** GFEndModeling (called)" << G4endl; 721 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 722 G4cout << "***** GFEndModeling (called)" << G4endl; 703 723 704 724 if( GFIsInModeling() ) { 705 725 706 if(GFDEBUG ) {707 G4c err<< "***** GFEndModeling (started) " ;708 G4c err<< "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl;726 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) { 727 G4cout << "***** GFEndModeling (started) " ; 728 G4cout << "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl; 709 729 } 710 730 … … 723 743 void G4GMocrenFileSceneHandler::BeginPrimitives (const G4Transform3D& objectTransformation) 724 744 { 725 if(GFDEBUG) G4cerr << "***** BeginPrimitives " << G4endl; 745 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 746 G4cout << "***** BeginPrimitives " << G4endl; 726 747 727 748 GFBeginModeling(); … … 736 757 void G4GMocrenFileSceneHandler::EndPrimitives () 737 758 { 738 if(GFDEBUG) G4cerr << "***** EndPrimitives " << G4endl; 759 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 760 G4cout << "***** EndPrimitives " << G4endl; 739 761 740 762 G4VSceneHandler::EndPrimitives (); … … 747 769 void G4GMocrenFileSceneHandler::AddSolid( const G4Box& box ) 748 770 { 749 if(GFDEBUG) G4cerr << "***** AddSolid ( box )" << G4endl; 771 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 772 G4cout << "***** AddSolid ( box )" << G4endl; 750 773 751 774 if(GFDEBUG_DET > 0) … … 1279 1302 G4GMocrenFileSceneHandler::AddSolid( const G4Tubs& tubes ) 1280 1303 { 1281 if(GFDEBUG) G4cerr << "***** AddSolid ( tubes )" << G4endl; 1304 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1305 G4cout << "***** AddSolid ( tubes )" << G4endl; 1282 1306 1283 1307 //----- skip drawing invisible primitive … … 1321 1345 G4GMocrenFileSceneHandler::AddSolid( const G4Cons& cons ) 1322 1346 { 1323 if(GFDEBUG) G4cerr << "***** AddSolid ( cons )" << G4endl; 1347 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1348 G4cout << "***** AddSolid ( cons )" << G4endl; 1324 1349 1325 1350 //----- skip drawing invisible primitive … … 1338 1363 void G4GMocrenFileSceneHandler::AddSolid ( const G4Trd& trd ) 1339 1364 { 1340 if(GFDEBUG) G4cerr << "***** AddSolid ( trd )" << G4endl; 1365 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1366 G4cout << "***** AddSolid ( trd )" << G4endl; 1341 1367 1342 1368 … … 1356 1382 void G4GMocrenFileSceneHandler::AddSolid ( const G4Sphere& sphere ) 1357 1383 { 1358 if(GFDEBUG) G4cerr << "***** AddSolid ( sphere )" << G4endl; 1384 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1385 G4cout << "***** AddSolid ( sphere )" << G4endl; 1359 1386 1360 1387 //----- skip drawing invisible primitive … … 1373 1400 void G4GMocrenFileSceneHandler::AddSolid (const G4Para& para) 1374 1401 { 1375 if(GFDEBUG) G4cerr << "***** AddSolid ( para )" << G4endl; 1402 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1403 G4cout << "***** AddSolid ( para )" << G4endl; 1376 1404 1377 1405 //----- skip drawing invisible primitive … … 1390 1418 void G4GMocrenFileSceneHandler::AddSolid (const G4Trap& trap) 1391 1419 { 1392 if(GFDEBUG) G4cerr << "***** AddSolid ( trap )" << G4endl; 1420 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1421 G4cout << "***** AddSolid ( trap )" << G4endl; 1393 1422 1394 1423 //----- skip drawing invisible primitive … … 1408 1437 G4GMocrenFileSceneHandler::AddSolid( const G4Torus& torus ) 1409 1438 { 1410 if(GFDEBUG) G4cerr << "***** AddSolid ( torus )" << G4endl; 1439 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1440 G4cout << "***** AddSolid ( torus )" << G4endl; 1411 1441 1412 1442 //----- skip drawing invisible primitive … … 1452 1482 1453 1483 if(GFDEBUG_TRK) { 1454 std::cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << std::endl;1484 G4cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << G4endl; 1455 1485 G4TrajectoriesModel * pTrModel = dynamic_cast<G4TrajectoriesModel*>(fpModel); 1456 1486 if (!pTrModel) { -
trunk/source/visualization/gMocren/src/G4GMocrenFileViewer.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GMocrenFileViewer.cc,v 1. 3 2009/12/03 11:44:42akimura Exp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4GMocrenFileViewer.cc,v 1.4 2010/11/10 23:53:23 akimura Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 41 41 #include <cassert> 42 42 43 #include "G4VisManager.hh" 43 44 #include "G4Scene.hh" 44 45 #include "G4Vector3D.hh" … … 93 94 { 94 95 if(GFDEBUG) 95 G4cerr << "***** G4GMocrenFileViewer::SetView(): No effects" << G4endl; 96 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 97 G4cout << "***** G4GMocrenFileViewer::SetView(): No effects" << G4endl; 96 98 97 99 // Do nothing, since DAWN is running as a different process. … … 105 107 { 106 108 if(GFDEBUG) 107 G4cerr << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl; 109 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 110 G4cout << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl; 108 111 109 112 //if(kSceneHandler.kGddDest) { … … 121 124 { 122 125 if(GFDEBUG) 123 G4cerr << "***** G4GMocrenFileViewer::DrawView () " << G4endl; 126 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 127 G4cout << "***** G4GMocrenFileViewer::DrawView () " << G4endl; 124 128 125 129 //----- … … 140 144 { 141 145 if(GFDEBUG) 142 G4cerr << "***** G4GMocrenFileViewer::ShowView () " << G4endl; 146 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 147 G4cout << "***** G4GMocrenFileViewer::ShowView () " << G4endl; 143 148 144 149 if( kSceneHandler.GFIsInModeling() ) -
trunk/source/visualization/gMocren/src/G4GMocrenIO.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GMocrenIO.cc,v 1. 5 2009/12/03 11:44:42akimura Exp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4GMocrenIO.cc,v 1.6 2010/11/10 23:53:23 akimura Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 40 40 // 41 41 #include "G4GMocrenIO.hh" 42 43 42 #include <iostream> 44 43 #include <ctime> … … 47 46 #include <cstdlib> 48 47 #include <cstring> 48 49 #include "globals.hh" 50 #include "G4VisManager.hh" 51 49 52 #if defined(_WIN32) 50 53 #define LITTLE_ENDIAN 1234 … … 97 100 } 98 101 if(!stat) { 99 std::cerr << "Warning: operator + " 100 << " Cannot do the operator +" 101 << std::endl; 102 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 103 G4cout << "Warning: operator + " 104 << " Cannot do the operator +" 105 << G4endl; 102 106 return *this; 103 107 } … … 137 141 } 138 142 if(!stat) { 139 std::cerr << "Warning: operator += " << std::endl 140 << " Cannot do the operator +=" 141 << std::endl; 143 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 144 G4cout << "Warning: operator += " << G4endl 145 << " Cannot do the operator +=" 146 << G4endl; 142 147 return *this; 143 148 } … … 263 268 int _num) { 264 269 if(_num >= (int)kTrack.size()) { 265 std::cerr << "GMocrenTrack::getStep(...) Error: " 266 << "invalid step # : " << _num << std::endl; 270 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 271 G4cout << "GMocrenTrack::getStep(...) Error: " 272 << "invalid step # : " << _num << G4endl; 267 273 return; 268 274 } … … 313 319 int _num) { 314 320 if(_num >= (int)kDetector.size()) { 315 std::cerr << "GMocrenDetector::getEdge(...) Error: " 316 << "invalid edge # : " << _num << std::endl; 321 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 322 G4cout << "GMocrenDetector::getEdge(...) Error: " 323 << "invalid edge # : " << _num << G4endl; 317 324 return; 318 325 } … … 458 465 459 466 if(DEBUG || kVerbose > 0) 460 std::cout << ">>>>>>> store data (ver.4) <<<<<<<" << std::endl;467 G4cout << ">>>>>>> store data (ver.4) <<<<<<<" << G4endl; 461 468 if(DEBUG || kVerbose > 0) 462 std::cout << " " << kFileName << std::endl;469 G4cout << " " << kFileName << G4endl; 463 470 464 471 // output file open … … 466 473 std::ios_base::out|std::ios_base::binary); 467 474 if(DEBUG || kVerbose > 0) 468 std::cout << " file open status: " << ofile << std::endl;475 G4cout << " file open status: " << ofile << G4endl; 469 476 470 477 // file identifier … … 480 487 ofile.write((char *)&littleEndian, sizeof(char)); 481 488 if(DEBUG || kVerbose > 0) { 482 // std::cout << "Endian: " << (int)kLittleEndianOutput << std::endl;483 std::cout << "Endian: " << (int)littleEndian << std::endl;489 //G4cout << "Endian: " << (int)kLittleEndianOutput << G4endl; 490 G4cout << "Endian: " << (int)littleEndian << G4endl; 484 491 } 485 492 … … 505 512 ofile.write((char *)cmt, 1024); 506 513 if(DEBUG || kVerbose > 0) { 507 std::cout << "Data comment : "508 << kComment << std::endl;514 G4cout << "Data comment : " 515 << kComment << G4endl; 509 516 } 510 517 … … 518 525 } 519 526 if(DEBUG || kVerbose > 0) { 520 std::cout << "Voxel spacing : ("527 G4cout << "Voxel spacing : (" 521 528 << kVoxelSpacing[0] << ", " 522 529 << kVoxelSpacing[1] << ", " 523 530 << kVoxelSpacing[2] 524 << ") mm " << std::endl;531 << ") mm " << G4endl; 525 532 } 526 533 … … 583 590 584 591 if(DEBUG || kVerbose > 0) { 585 std::cout << "Each pointer to data : "592 G4cout << "Each pointer to data : " 586 593 << kPointerToModalityData << ", "; 587 594 for(int i = 0; i < nDoseDist; i++) { 588 std::cout << kPointerToDoseDistData[i] << ", ";589 } 590 std::cout << kPointerToROIData << ", "595 G4cout << kPointerToDoseDistData[i] << ", "; 596 } 597 G4cout << kPointerToROIData << ", " 591 598 << kPointerToTrackData << ", " 592 599 << kPointerToDetectorData 593 << std::endl;600 << G4endl; 594 601 } 595 602 … … 613 620 614 621 if(DEBUG || kVerbose > 0) { 615 std::cout << "Modality image size : ("622 G4cout << "Modality image size : (" 616 623 << size[0] << ", " 617 624 << size[1] << ", " 618 625 << size[2] << ")" 619 << std::endl;626 << G4endl; 620 627 } 621 628 … … 643 650 } 644 651 if(DEBUG || kVerbose > 0) { 645 std::cout << "Modality image min., max., scale : "652 G4cout << "Modality image min., max., scale : " 646 653 << minmax[0] << ", " 647 654 << minmax[1] << ", " 648 << scale << std::endl;655 << scale << G4endl; 649 656 } 650 657 651 658 // modality image 652 659 int psize = size[0]*size[1]; 653 if(DEBUG || kVerbose > 0) std::cout << "Modality image : ";660 if(DEBUG || kVerbose > 0) G4cout << "Modality image : "; 654 661 for(int i = 0; i < size[2]; i++) { 655 662 short * image = kModality.getImage(i); … … 663 670 } 664 671 665 if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";666 } 667 if(DEBUG || kVerbose > 0) std::cout << std::endl;672 if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", "; 673 } 674 if(DEBUG || kVerbose > 0) G4cout << G4endl; 668 675 669 676 // modality desity map for CT value 670 677 size_t msize = minmax[1] - minmax[0]+1; 671 678 if(DEBUG || kVerbose > 0) 672 std::cout << "modality image : " << minmax[0] << ", " << minmax[1] << std::endl;679 G4cout << "modality image : " << minmax[0] << ", " << minmax[1] << G4endl; 673 680 float * pdmap = new float[msize]; 674 681 for(int i = 0; i < (int)msize; i++) pdmap[i] =kModalityImageDensityMap[i]; … … 684 691 685 692 if(DEBUG || kVerbose > 0) { 686 std::cout << "density map : " << std::ends;693 G4cout << "density map : " << std::ends; 687 694 for(int i = 0; i < (int)msize; i+=50) 688 std::cout <<kModalityImageDensityMap[i] << ", ";689 std::cout << std::endl;695 G4cout <<kModalityImageDensityMap[i] << ", "; 696 G4cout << G4endl; 690 697 } 691 698 delete [] pdmap; … … 709 716 } 710 717 if(DEBUG || kVerbose > 0) { 711 std::cout << "Dose dist. [" << ndose << "] image size : ("718 G4cout << "Dose dist. [" << ndose << "] image size : (" 712 719 << size[0] << ", " 713 720 << size[1] << ", " 714 721 << size[2] << ")" 715 << std::endl;722 << G4endl; 716 723 } 717 724 … … 732 739 ofile.write((char *)cdunit, 12); 733 740 if(DEBUG || kVerbose > 0) { 734 std::cout << "Dose dist. unit : " << kDoseUnit << std::endl;741 G4cout << "Dose dist. unit : " << kDoseUnit << G4endl; 735 742 } 736 743 … … 746 753 } 747 754 if(DEBUG || kVerbose > 0) { 748 std::cout << "Dose dist. [" << ndose755 G4cout << "Dose dist. [" << ndose 749 756 << "] image min., max., scale : " 750 757 << minmax[0] << ", " 751 758 << minmax[1] << ", " 752 << scale << std::endl;759 << scale << G4endl; 753 760 } 754 761 … … 770 777 for(int j = 0; j < dsize; j++) { 771 778 if(dimage[j] < 0) 772 std::cout << "[" << j << "," << z << "]"779 G4cout << "[" << j << "," << z << "]" 773 780 << dimage[j] << ", "; 774 781 } 775 782 } 776 783 } 777 if(DEBUG || kVerbose > 0) std::cout << std::endl;784 if(DEBUG || kVerbose > 0) G4cout << G4endl; 778 785 delete [] dimage; 779 786 … … 790 797 } 791 798 if(DEBUG || kVerbose > 0) { 792 std::cout << "Dose dist. [" << ndose799 G4cout << "Dose dist. [" << ndose 793 800 << "]image relative location : (" 794 801 << iCenter[0] << ", " 795 802 << iCenter[1] << ", " 796 << iCenter[2] << ")" << std::endl;803 << iCenter[2] << ")" << G4endl; 797 804 } 798 805 … … 803 810 ofile.write((char *)name.c_str(), 80); 804 811 if(DEBUG || kVerbose > 0) { 805 std::cout << "Dose dist. name : " << name << std::endl;812 G4cout << "Dose dist. name : " << name << G4endl; 806 813 } 807 814 … … 821 828 } 822 829 if(DEBUG || kVerbose > 0) { 823 std::cout << "ROI image size : ("830 G4cout << "ROI image size : (" 824 831 << size[0] << ", " 825 832 << size[1] << ", " 826 833 << size[2] << ")" 827 << std::endl;834 << G4endl; 828 835 } 829 836 … … 847 854 } 848 855 if(DEBUG || kVerbose > 0) { 849 std::cout << "ROI image min., max., scale : "856 G4cout << "ROI image min., max., scale : " 850 857 << minmax[0] << ", " 851 858 << minmax[1] << ", " 852 << scale << std::endl;859 << scale << G4endl; 853 860 } 854 861 … … 879 886 } 880 887 if(DEBUG || kVerbose > 0) { 881 std::cout << "ROI image relative location : ("888 G4cout << "ROI image relative location : (" 882 889 << iCenter[0] << ", " 883 890 << iCenter[1] << ", " 884 << iCenter[2] << ")" << std::endl;891 << iCenter[2] << ")" << G4endl; 885 892 } 886 893 } … … 898 905 } 899 906 if(DEBUG || kVerbose > 0) { 900 std::cout << "# of tracks : "901 << ntrk << std::endl;907 G4cout << "# of tracks : " 908 << ntrk << G4endl; 902 909 } 903 910 … … 913 920 } 914 921 if(DEBUG || kVerbose > 0) { 915 std::cout << "# of steps : " << nsteps << std::endl;922 G4cout << "# of steps : " << nsteps << G4endl; 916 923 } 917 924 … … 950 957 } 951 958 if(DEBUG || kVerbose > 0) { 952 std::cout << "# of detectors : "953 << ndet << std::endl;959 G4cout << "# of detectors : " 960 << ndet << G4endl; 954 961 } 955 962 … … 965 972 } 966 973 if(DEBUG || kVerbose > 0) { 967 std::cout << "# of edges in a detector : " << nedges << std::endl;974 G4cout << "# of edges in a detector : " << nedges << G4endl; 968 975 } 969 976 … … 985 992 if(DEBUG || kVerbose > 0) { 986 993 if(ne < 1) { 987 std::cout << " edge : (" << edgePoints[0] << ", "994 G4cout << " edge : (" << edgePoints[0] << ", " 988 995 << edgePoints[1] << ", " 989 996 << edgePoints[2] << ") - (" 990 997 << edgePoints[3] << ", " 991 998 << edgePoints[4] << ", " 992 << edgePoints[5] << ")" << std::endl;999 << edgePoints[5] << ")" << G4endl; 993 1000 } 994 1001 } … … 1000 1007 ofile.write((char *)dcolor, 3); 1001 1008 if(DEBUG || kVerbose > 0) { 1002 std::cout << " rgb : (" << (int)dcolor[0] << ", "1009 G4cout << " rgb : (" << (int)dcolor[0] << ", " 1003 1010 << (int)dcolor[1] << ", " 1004 << (int)dcolor[2] << ")" << std::endl;1011 << (int)dcolor[2] << ")" << G4endl; 1005 1012 } 1006 1013 … … 1010 1017 ofile.write((char *)dname.c_str(), 80); 1011 1018 if(DEBUG || kVerbose > 0) { 1012 std::cout << " detector name : " << dname << std::endl;1019 G4cout << " detector name : " << dname << G4endl; 1013 1020 1014 1021 } … … 1021 1028 ofile.close(); 1022 1029 if(DEBUG || kVerbose > 0) 1023 std::cout << ">>>> closed gdd file: " << kFileName << std::endl;1030 G4cout << ">>>> closed gdd file: " << kFileName << G4endl; 1024 1031 1025 1032 return true; … … 1027 1034 bool G4GMocrenIO::storeData3() { 1028 1035 1029 if(kVerbose > 0) std::cout << ">>>>>>> store data (ver.3) <<<<<<<" << std::endl;1030 if(kVerbose > 0) std::cout << " " << kFileName << std::endl;1036 if(kVerbose > 0) G4cout << ">>>>>>> store data (ver.3) <<<<<<<" << G4endl; 1037 if(kVerbose > 0) G4cout << " " << kFileName << G4endl; 1031 1038 1032 1039 bool DEBUG = false;// … … 1055 1062 ofile.write((char *)cmt, 1024); 1056 1063 if(DEBUG || kVerbose > 0) { 1057 std::cout << "Data comment : "1058 << kComment << std::endl;1064 G4cout << "Data comment : " 1065 << kComment << G4endl; 1059 1066 } 1060 1067 … … 1062 1069 ofile.write((char *)kVoxelSpacing, 12); 1063 1070 if(DEBUG || kVerbose > 0) { 1064 std::cout << "Voxel spacing : ("1071 G4cout << "Voxel spacing : (" 1065 1072 << kVoxelSpacing[0] << ", " 1066 1073 << kVoxelSpacing[1] << ", " 1067 1074 << kVoxelSpacing[2] 1068 << ") mm " << std::endl;1075 << ") mm " << G4endl; 1069 1076 } 1070 1077 … … 1090 1097 ofile.write((char *)&kPointerToTrackData, 4); 1091 1098 if(DEBUG || kVerbose > 0) { 1092 std::cout << "Each pointer to data : "1099 G4cout << "Each pointer to data : " 1093 1100 << kPointerToModalityData << ", "; 1094 1101 for(int i = 0; i < nDoseDist; i++) { 1095 std::cout << kPointerToDoseDistData[i] << ", ";1096 } 1097 std::cout << kPointerToROIData << ", "1098 << kPointerToTrackData << std::endl;1102 G4cout << kPointerToDoseDistData[i] << ", "; 1103 } 1104 G4cout << kPointerToROIData << ", " 1105 << kPointerToTrackData << G4endl; 1099 1106 } 1100 1107 … … 1110 1117 ofile.write((char *)size, 3*sizeof(int)); 1111 1118 if(DEBUG || kVerbose > 0) { 1112 std::cout << "Modality image size : ("1119 G4cout << "Modality image size : (" 1113 1120 << size[0] << ", " 1114 1121 << size[1] << ", " 1115 1122 << size[2] << ")" 1116 << std::endl;1123 << G4endl; 1117 1124 } 1118 1125 … … 1129 1136 ofile.write((char *)&scale, 4); 1130 1137 if(DEBUG || kVerbose > 0) { 1131 std::cout << "Modality image min., max., scale : "1138 G4cout << "Modality image min., max., scale : " 1132 1139 << minmax[0] << ", " 1133 1140 << minmax[1] << ", " 1134 << scale << std::endl;1141 << scale << G4endl; 1135 1142 } 1136 1143 1137 1144 // modality image 1138 1145 int psize = size[0]*size[1]; 1139 if(DEBUG || kVerbose > 0) std::cout << "Modality image : ";1146 if(DEBUG || kVerbose > 0) G4cout << "Modality image : "; 1140 1147 for(int i = 0; i < size[2]; i++) { 1141 1148 short * image = kModality.getImage(i); 1142 1149 ofile.write((char *)image, psize*sizeof(short)); 1143 1150 1144 if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";1145 } 1146 if(DEBUG || kVerbose > 0) std::cout << std::endl;1151 if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", "; 1152 } 1153 if(DEBUG || kVerbose > 0) G4cout << G4endl; 1147 1154 1148 1155 // modality desity map for CT value … … 1152 1159 ofile.write((char *)pdmap, msize*sizeof(float)); 1153 1160 if(DEBUG || kVerbose > 0) { 1154 std::cout << "density map : " << std::ends;1161 G4cout << "density map : " << std::ends; 1155 1162 for(int i = 0; i < (int)msize; i+=50) 1156 std::cout <<kModalityImageDensityMap[i] << ", ";1157 std::cout << std::endl;1163 G4cout <<kModalityImageDensityMap[i] << ", "; 1164 G4cout << G4endl; 1158 1165 } 1159 1166 delete [] pdmap; … … 1171 1178 ofile.write((char *)size, 3*sizeof(int)); 1172 1179 if(DEBUG || kVerbose > 0) { 1173 std::cout << "Dose dist. [" << ndose << "] image size : ("1180 G4cout << "Dose dist. [" << ndose << "] image size : (" 1174 1181 << size[0] << ", " 1175 1182 << size[1] << ", " 1176 1183 << size[2] << ")" 1177 << std::endl;1184 << G4endl; 1178 1185 } 1179 1186 … … 1185 1192 ofile.write((char *)kDoseUnit.c_str(), 12); 1186 1193 if(DEBUG || kVerbose > 0) { 1187 std::cout << "Dose dist. unit : " << kDoseUnit << std::endl;1194 G4cout << "Dose dist. unit : " << kDoseUnit << G4endl; 1188 1195 } 1189 1196 … … 1194 1201 ofile.write((char *)&scale, 4); 1195 1202 if(DEBUG || kVerbose > 0) { 1196 std::cout << "Dose dist. [" << ndose1203 G4cout << "Dose dist. [" << ndose 1197 1204 << "] image min., max., scale : " 1198 1205 << minmax[0] << ", " 1199 1206 << minmax[1] << ", " 1200 << scale << std::endl;1207 << scale << G4endl; 1201 1208 } 1202 1209 … … 1211 1218 for(int j = 0; j < dsize; j++) { 1212 1219 if(dimage[j] < 0) 1213 std::cout << "[" << j << "," << z << "]"1220 G4cout << "[" << j << "," << z << "]" 1214 1221 << dimage[j] << ", "; 1215 1222 } 1216 1223 } 1217 1224 } 1218 if(DEBUG || kVerbose > 0) std::cout << std::endl;1225 if(DEBUG || kVerbose > 0) G4cout << G4endl; 1219 1226 delete [] dimage; 1220 1227 … … 1225 1232 ofile.write((char *)iCenter, 3*4); // 3*sizeof(int) 1226 1233 if(DEBUG || kVerbose > 0) { 1227 std::cout << "Dose dist. [" << ndose1234 G4cout << "Dose dist. [" << ndose 1228 1235 << "]image relative location : (" 1229 1236 << iCenter[0] << ", " 1230 1237 << iCenter[1] << ", " 1231 << iCenter[2] << ")" << std::endl;1238 << iCenter[2] << ")" << G4endl; 1232 1239 } 1233 1240 } … … 1240 1247 ofile.write((char *)size, 3*sizeof(int)); 1241 1248 if(DEBUG || kVerbose > 0) { 1242 std::cout << "ROI image size : ("1249 G4cout << "ROI image size : (" 1243 1250 << size[0] << ", " 1244 1251 << size[1] << ", " 1245 1252 << size[2] << ")" 1246 << std::endl;1253 << G4endl; 1247 1254 } 1248 1255 … … 1255 1262 ofile.write((char *)&scale, sizeof(float)); 1256 1263 if(DEBUG || kVerbose > 0) { 1257 std::cout << "ROI image min., max., scale : "1264 G4cout << "ROI image min., max., scale : " 1258 1265 << minmax[0] << ", " 1259 1266 << minmax[1] << ", " 1260 << scale << std::endl;1267 << scale << G4endl; 1261 1268 } 1262 1269 … … 1274 1281 ofile.write((char *)iCenter, 3*sizeof(int)); 1275 1282 if(DEBUG || kVerbose > 0) { 1276 std::cout << "ROI image relative location : ("1283 G4cout << "ROI image relative location : (" 1277 1284 << iCenter[0] << ", " 1278 1285 << iCenter[1] << ", " 1279 << iCenter[2] << ")" << std::endl;1286 << iCenter[2] << ")" << G4endl; 1280 1287 } 1281 1288 } … … 1286 1293 ofile.write((char *)&ntrk, sizeof(int)); 1287 1294 if(DEBUG || kVerbose > 0) { 1288 std::cout << "# of tracks : "1289 << ntrk << std::endl;1295 G4cout << "# of tracks : " 1296 << ntrk << G4endl; 1290 1297 } 1291 1298 // track position … … 1297 1304 int ntcolor = int(kStepColors.size()); 1298 1305 if(ntrk != ntcolor) 1299 std::cerr << "# of track color information must be the same as # of tracks." 1300 << std::endl; 1306 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 1307 G4cout << "# of track color information must be the same as # of tracks." 1308 << G4endl; 1301 1309 unsigned char white[3] = {255,255,255}; // default color 1302 1310 for(int i = 0; i < ntrk; i++) { … … 1325 1333 bool G4GMocrenIO::storeData2() { 1326 1334 1327 if(kVerbose > 0) std::cout << ">>>>>>> store data (ver.2) <<<<<<<" << std::endl;1328 if(kVerbose > 0) std::cout << " " << kFileName << std::endl;1335 if(kVerbose > 0) G4cout << ">>>>>>> store data (ver.2) <<<<<<<" << G4endl; 1336 if(kVerbose > 0) G4cout << " " << kFileName << G4endl; 1329 1337 1330 1338 bool DEBUG = false;// … … 1361 1369 ofile.write((char *)kVoxelSpacing, 12); 1362 1370 if(DEBUG || kVerbose > 0) { 1363 std::cout << "Voxel spacing : ("1371 G4cout << "Voxel spacing : (" 1364 1372 << kVoxelSpacing[0] << ", " 1365 1373 << kVoxelSpacing[1] << ", " 1366 1374 << kVoxelSpacing[2] 1367 << ") mm " << std::endl;1375 << ") mm " << G4endl; 1368 1376 } 1369 1377 … … 1381 1389 ofile.write((char *)&kPointerToTrackData, 4); 1382 1390 if(DEBUG || kVerbose > 0) { 1383 std::cout << "Each pointer to data : "1391 G4cout << "Each pointer to data : " 1384 1392 << kPointerToModalityData << ", " 1385 1393 << kPointerToDoseDistData[0] << ", " 1386 1394 << kPointerToROIData << ", " 1387 << kPointerToTrackData << std::endl;1395 << kPointerToTrackData << G4endl; 1388 1396 } 1389 1397 … … 1399 1407 ofile.write((char *)size, 3*sizeof(int)); 1400 1408 if(DEBUG || kVerbose > 0) { 1401 std::cout << "Modality image size : ("1409 G4cout << "Modality image size : (" 1402 1410 << size[0] << ", " 1403 1411 << size[1] << ", " 1404 1412 << size[2] << ")" 1405 << std::endl;1413 << G4endl; 1406 1414 } 1407 1415 … … 1418 1426 ofile.write((char *)&scale, 4); 1419 1427 if(DEBUG || kVerbose > 0) { 1420 std::cout << "Modality image min., max., scale : "1428 G4cout << "Modality image min., max., scale : " 1421 1429 << minmax[0] << ", " 1422 1430 << minmax[1] << ", " 1423 << scale << std::endl;1431 << scale << G4endl; 1424 1432 } 1425 1433 1426 1434 // modality image 1427 1435 int psize = size[0]*size[1]; 1428 if(DEBUG || kVerbose > 0) std::cout << "Modality image : ";1436 if(DEBUG || kVerbose > 0) G4cout << "Modality image : "; 1429 1437 for(int i = 0; i < size[2]; i++) { 1430 1438 short * image =kModality.getImage(i); 1431 1439 ofile.write((char *)image, psize*sizeof(short)); 1432 1440 1433 if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";1434 } 1435 if(DEBUG || kVerbose > 0) std::cout << std::endl;1441 if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", "; 1442 } 1443 if(DEBUG || kVerbose > 0) G4cout << G4endl; 1436 1444 1437 1445 // modality desity map for CT value … … 1441 1449 ofile.write((char *)pdmap, msize*sizeof(float)); 1442 1450 if(DEBUG || kVerbose > 0) { 1443 std::cout << "density map : " << std::ends;1451 G4cout << "density map : " << std::ends; 1444 1452 for(int i = 0; i < (int)msize; i+=50) 1445 std::cout <<kModalityImageDensityMap[i] << ", ";1446 std::cout << std::endl;1453 G4cout <<kModalityImageDensityMap[i] << ", "; 1454 G4cout << G4endl; 1447 1455 } 1448 1456 delete [] pdmap; … … 1458 1466 ofile.write((char *)size, 3*sizeof(int)); 1459 1467 if(DEBUG || kVerbose > 0) { 1460 std::cout << "Dose dist. image size : ("1468 G4cout << "Dose dist. image size : (" 1461 1469 << size[0] << ", " 1462 1470 << size[1] << ", " 1463 1471 << size[2] << ")" 1464 << std::endl;1472 << G4endl; 1465 1473 } 1466 1474 … … 1473 1481 ofile.write((char *)&scale, sizeof(float)); 1474 1482 if(DEBUG || kVerbose > 0) { 1475 std::cout << "Dose dist. image min., max., scale : "1483 G4cout << "Dose dist. image min., max., scale : " 1476 1484 << minmax[0] << ", " 1477 1485 << minmax[1] << ", " 1478 << scale << std::endl;1486 << scale << G4endl; 1479 1487 } 1480 1488 … … 1489 1497 for(int j = 0; j < dsize; j++) { 1490 1498 if(dimage[j] < 0) 1491 std::cout << "[" << j << "," << z << "]"1499 G4cout << "[" << j << "," << z << "]" 1492 1500 << dimage[j] << ", "; 1493 1501 } 1494 1502 } 1495 1503 } 1496 if(DEBUG || kVerbose > 0) std::cout << std::endl;1504 if(DEBUG || kVerbose > 0) G4cout << G4endl; 1497 1505 delete [] dimage; 1498 1506 … … 1503 1511 ofile.write((char *)iCenter, 3*sizeof(int)); 1504 1512 if(DEBUG || kVerbose > 0) { 1505 std::cout << "Dose dist. image relative location : ("1513 G4cout << "Dose dist. image relative location : (" 1506 1514 << iCenter[0] << ", " 1507 1515 << iCenter[1] << ", " 1508 << iCenter[2] << ")" << std::endl;1516 << iCenter[2] << ")" << G4endl; 1509 1517 } 1510 1518 … … 1517 1525 ofile.write((char *)size, 3*sizeof(int)); 1518 1526 if(DEBUG || kVerbose > 0) { 1519 std::cout << "ROI image size : ("1527 G4cout << "ROI image size : (" 1520 1528 << size[0] << ", " 1521 1529 << size[1] << ", " 1522 1530 << size[2] << ")" 1523 << std::endl;1531 << G4endl; 1524 1532 } 1525 1533 … … 1532 1540 ofile.write((char *)&scale, sizeof(float)); 1533 1541 if(DEBUG || kVerbose > 0) { 1534 std::cout << "ROI image min., max., scale : "1542 G4cout << "ROI image min., max., scale : " 1535 1543 << minmax[0] << ", " 1536 1544 << minmax[1] << ", " 1537 << scale << std::endl;1545 << scale << G4endl; 1538 1546 } 1539 1547 … … 1551 1559 ofile.write((char *)iCenter, 3*sizeof(int)); 1552 1560 if(DEBUG || kVerbose > 0) { 1553 std::cout << "ROI image relative location : ("1561 G4cout << "ROI image relative location : (" 1554 1562 << iCenter[0] << ", " 1555 1563 << iCenter[1] << ", " 1556 << iCenter[2] << ")" << std::endl;1564 << iCenter[2] << ")" << G4endl; 1557 1565 } 1558 1566 } … … 1564 1572 ofile.write((char *)&ntrk, sizeof(int)); 1565 1573 if(DEBUG || kVerbose > 0) { 1566 std::cout << "# of tracks : "1567 << ntrk << std::endl;1574 G4cout << "# of tracks : " 1575 << ntrk << G4endl; 1568 1576 } 1569 1577 for(int i = 0; i < ntrk; i++) { … … 1591 1599 std::ifstream ifile(kFileName.c_str(), std::ios_base::in|std::ios_base::binary); 1592 1600 if(!ifile) { 1593 std::cerr << "Cannot open file: " << kFileName 1594 << " in G4GMocrenIO::retrieveData()." << std::endl; 1601 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 1602 G4cout << "Cannot open file: " << kFileName 1603 << " in G4GMocrenIO::retrieveData()." << G4endl; 1595 1604 return false; 1596 1605 } … … 1606 1615 if(std::strncmp(verid, "gMocren", 7) == 0) { 1607 1616 if(ver == 0x03) { 1608 std::cout << ">>>>>>> retrieve data (ver.3) <<<<<<<" << std::endl;1609 std::cout << " " << kFileName << std::endl;1617 G4cout << ">>>>>>> retrieve data (ver.3) <<<<<<<" << G4endl; 1618 G4cout << " " << kFileName << G4endl; 1610 1619 retrieveData3(); 1611 1620 } else if (ver == 0x04) { 1612 std::cout << ">>>>>>> retrieve data (ver.4) <<<<<<<" << std::endl;1613 std::cout << " " << kFileName << std::endl;1621 G4cout << ">>>>>>> retrieve data (ver.4) <<<<<<<" << G4endl; 1622 G4cout << " " << kFileName << G4endl; 1614 1623 retrieveData4(); 1615 1624 } else { 1616 std::cerr << "Error -- invalid file version : " << (int)ver 1617 << std::endl; 1618 std::cerr << " " << kFileName << std::endl; 1625 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) { 1626 G4cout << "Error -- invalid file version : " << (int)ver 1627 << G4endl; 1628 G4cout << " " << kFileName << G4endl; 1629 } 1619 1630 std::exit(-1); 1620 1631 } 1621 1632 } else if(std::strncmp(verid, "GRAPE", 5) == 0) { 1622 std::cout << ">>>>>>> retrieve data (ver.2) <<<<<<<" << std::endl;1623 std::cout << " " << kFileName << std::endl;1633 G4cout << ">>>>>>> retrieve data (ver.2) <<<<<<<" << G4endl; 1634 G4cout << " " << kFileName << G4endl; 1624 1635 retrieveData2(); 1625 1636 } else { 1626 std::cerr << kFileName << " was not gdd file." << std::endl; 1637 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 1638 G4cout << kFileName << " was not gdd file." << G4endl; 1627 1639 return false; 1628 1640 } … … 1644 1656 std::ifstream ifile(kFileName.c_str(), std::ios_base::in|std::ios_base::binary); 1645 1657 if(!ifile) { 1646 std::cerr << "Cannot open file: " << kFileName 1647 << " in G4GMocrenIO::retrieveData3()." << std::endl; 1658 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 1659 G4cout << "Cannot open file: " << kFileName 1660 << " in G4GMocrenIO::retrieveData3()." << G4endl; 1648 1661 return false; 1649 1662 } … … 1662 1675 ss << (int)ver; 1663 1676 kVersion = ss.str(); 1664 if(DEBUG || kVerbose > 0) std::cout << "File version : " << kVersion << std::endl;1677 if(DEBUG || kVerbose > 0) G4cout << "File version : " << kVersion << G4endl; 1665 1678 1666 1679 // endian 1667 1680 ifile.read((char *)&kLittleEndianInput, sizeof(char)); 1668 1681 if(DEBUG || kVerbose > 0) { 1669 std::cout << "Endian : ";1682 G4cout << "Endian : "; 1670 1683 if(kLittleEndianInput == 1) 1671 std::cout << " little" << std::endl;1684 G4cout << " little" << G4endl; 1672 1685 else { 1673 std::cout << " big" << std::endl;1686 G4cout << " big" << G4endl; 1674 1687 } 1675 1688 } … … 1686 1699 setComment(scmt); 1687 1700 if(DEBUG || kVerbose > 0) { 1688 std::cout << "Data comment : "1689 << kComment << std::endl;1701 G4cout << "Data comment : " 1702 << kComment << G4endl; 1690 1703 } 1691 1704 … … 1696 1709 convertEndian(ctmp+8, kVoxelSpacing[2]); 1697 1710 if(DEBUG || kVerbose > 0) { 1698 std::cout << "Voxel spacing : ("1711 G4cout << "Voxel spacing : (" 1699 1712 << kVoxelSpacing[0] << ", " 1700 1713 << kVoxelSpacing[1] << ", " 1701 1714 << kVoxelSpacing[2] 1702 << ") mm " << std::endl;1715 << ") mm " << G4endl; 1703 1716 } 1704 1717 … … 1734 1747 1735 1748 if(DEBUG || kVerbose > 0) { 1736 std::cout << "Each pointer to data : "1749 G4cout << "Each pointer to data : " 1737 1750 << kPointerToModalityData << ", "; 1738 1751 for(int i = 0; i < nDoseDist; i++) 1739 std::cout << kPointerToDoseDistData[i] << ", ";1740 std::cout << kPointerToROIData << ", "1752 G4cout << kPointerToDoseDistData[i] << ", "; 1753 G4cout << kPointerToROIData << ", " 1741 1754 << kPointerToTrackData << ", " 1742 1755 << kPointerToDetectorData 1743 << std::endl;1756 << G4endl; 1744 1757 } 1745 1758 … … 1749 1762 kPointerToROIData == 0 && kPointerToTrackData == 0) { 1750 1763 if(DEBUG || kVerbose > 0) { 1751 std::cout << "No data." << std::endl;1764 G4cout << "No data." << G4endl; 1752 1765 } 1753 1766 return false; … … 1774 1787 convertEndian(ctmp+2*sizeof(int), size[2]); 1775 1788 if(DEBUG || kVerbose > 0) { 1776 std::cout << "Modality image size : ("1789 G4cout << "Modality image size : (" 1777 1790 << size[0] << ", " 1778 1791 << size[1] << ", " 1779 1792 << size[2] << ")" 1780 << std::endl;1793 << G4endl; 1781 1794 } 1782 1795 kModality.setSize(size); … … 1810 1823 kModality.setScale(dscale = scale); 1811 1824 if(DEBUG || kVerbose > 0) { 1812 std::cout << "Modality image min., max., scale : "1825 G4cout << "Modality image min., max., scale : " 1813 1826 << minmax[0] << ", " 1814 1827 << minmax[1] << ", " 1815 << scale << std::endl;1828 << scale << G4endl; 1816 1829 } 1817 1830 1818 1831 // modality density 1819 1832 int psize = size[0]*size[1]; 1820 if(DEBUG || kVerbose > 0) std::cout << "Modality image (" << psize << "): ";1833 if(DEBUG || kVerbose > 0) G4cout << "Modality image (" << psize << "): "; 1821 1834 char * cimage = new char[psize*sizeof(short)]; 1822 1835 for(int i = 0; i < size[2]; i++) { … … 1828 1841 kModality.addImage(mimage); 1829 1842 1830 if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";1831 } 1832 if(DEBUG || kVerbose > 0) std::cout << std::endl;1843 if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", "; 1844 } 1845 if(DEBUG || kVerbose > 0) G4cout << G4endl; 1833 1846 delete [] cimage; 1834 1847 1835 1848 // modality desity map for CT value 1836 1849 size_t msize = minmax[1]-minmax[0]+1; 1837 if(DEBUG || kVerbose > 0) std::cout << "msize: " << msize << std::endl;1850 if(DEBUG || kVerbose > 0) G4cout << "msize: " << msize << G4endl; 1838 1851 char * pdmap = new char[msize*sizeof(float)]; 1839 1852 ifile.read((char *)pdmap, msize*sizeof(float)); … … 1844 1857 } 1845 1858 if(DEBUG || kVerbose > 0) { 1846 std::cout << "density map : " << std::ends;1859 G4cout << "density map : " << std::ends; 1847 1860 for(int i = 0; i < 10; i++) 1848 std::cout <<kModalityImageDensityMap[i] << ", ";1849 std::cout << std::endl;1850 for(int i = 0; i < 10; i++) std::cout << "..";1851 std::cout << std::endl;1861 G4cout <<kModalityImageDensityMap[i] << ", "; 1862 G4cout << G4endl; 1863 for(int i = 0; i < 10; i++) G4cout << ".."; 1864 G4cout << G4endl; 1852 1865 for(size_t i =kModalityImageDensityMap.size() - 10; i <kModalityImageDensityMap.size(); i++) 1853 std::cout <<kModalityImageDensityMap[i] << ", ";1854 std::cout << std::endl;1866 G4cout <<kModalityImageDensityMap[i] << ", "; 1867 G4cout << G4endl; 1855 1868 } 1856 1869 … … 1869 1882 convertEndian(ctmp+2*sizeof(int), size[2]); 1870 1883 if(DEBUG || kVerbose > 0) { 1871 std::cout << "Dose dist. image size : ("1884 G4cout << "Dose dist. image size : (" 1872 1885 << size[0] << ", " 1873 1886 << size[1] << ", " 1874 1887 << size[2] << ")" 1875 << std::endl;1888 << G4endl; 1876 1889 } 1877 1890 kDose[ndose].setSize(size); … … 1889 1902 setDoseDistUnit(sdunit, ndose); 1890 1903 if(DEBUG || kVerbose > 0) { 1891 std::cout << "Dose dist. unit : " << kDoseUnit << std::endl;1904 G4cout << "Dose dist. unit : " << kDoseUnit << G4endl; 1892 1905 } 1893 1906 … … 1902 1915 1903 1916 if(DEBUG || kVerbose > 0) { 1904 std::cout << "Dose dist. image min., max., scale : "1917 G4cout << "Dose dist. image min., max., scale : " 1905 1918 << dminmax[0] << ", " 1906 1919 << dminmax[1] << ", " 1907 << scale << std::endl;1920 << scale << G4endl; 1908 1921 } 1909 1922 1910 1923 // dose distribution image 1911 1924 int dsize = size[0]*size[1]; 1912 if(DEBUG || kVerbose > 0) std::cout << "Dose dist. (" << dsize << "): ";1925 if(DEBUG || kVerbose > 0) G4cout << "Dose dist. (" << dsize << "): "; 1913 1926 char * di = new char[dsize*sizeof(short)]; 1914 1927 short * shimage = new short[dsize]; … … 1922 1935 kDose[ndose].addImage(dimage); 1923 1936 1924 if(DEBUG || kVerbose > 0) std::cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";1937 if(DEBUG || kVerbose > 0) G4cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", "; 1925 1938 1926 1939 if(DEBUG || kVerbose > 0) { 1927 1940 for(int j = 0; j < dsize; j++) { 1928 1941 if(dimage[j] < 0) 1929 std::cout << "[" << j << "," << z << "]"1942 G4cout << "[" << j << "," << z << "]" 1930 1943 << dimage[j] << ", "; 1931 1944 } … … 1934 1947 delete [] shimage; 1935 1948 delete [] di; 1936 if(DEBUG || kVerbose > 0) std::cout << std::endl;1949 if(DEBUG || kVerbose > 0) G4cout << G4endl; 1937 1950 1938 1951 ifile.read((char *)ctmp, 3*4); // 3*sizeof(int) … … 1944 1957 1945 1958 if(DEBUG || kVerbose > 0) { 1946 std::cout << "Dose dist. image relative location : ("1959 G4cout << "Dose dist. image relative location : (" 1947 1960 << fCenter[0] << ", " 1948 1961 << fCenter[1] << ", " 1949 << fCenter[2] << ")" << std::endl;1962 << fCenter[2] << ")" << G4endl; 1950 1963 } 1951 1964 … … 1957 1970 setDoseDistName(dosename, ndose); 1958 1971 if(DEBUG || kVerbose > 0) { 1959 std::cout << "Dose dist. name : " << dosename << std::endl;1972 G4cout << "Dose dist. name : " << dosename << G4endl; 1960 1973 } 1961 1974 … … 1974 1987 kRoi[0].setSize(size); 1975 1988 if(DEBUG || kVerbose > 0) { 1976 std::cout << "ROI image size : ("1989 G4cout << "ROI image size : (" 1977 1990 << size[0] << ", " 1978 1991 << size[1] << ", " 1979 1992 << size[2] << ")" 1980 << std::endl;1993 << G4endl; 1981 1994 } 1982 1995 … … 1992 2005 kRoi[0].setScale(dscale = scale); 1993 2006 if(DEBUG || kVerbose > 0) { 1994 std::cout << "ROI image min., max., scale : "2007 G4cout << "ROI image min., max., scale : " 1995 2008 << minmax[0] << ", " 1996 2009 << minmax[1] << ", " 1997 << scale << std::endl;2010 << scale << G4endl; 1998 2011 } 1999 2012 … … 2020 2033 kRoi[0].setCenterPosition(fCenter); 2021 2034 if(DEBUG || kVerbose > 0) { 2022 std::cout << "ROI image relative location : ("2035 G4cout << "ROI image relative location : (" 2023 2036 << fCenter[0] << ", " 2024 2037 << fCenter[1] << ", " 2025 << fCenter[2] << ")" << std::endl;2038 << fCenter[2] << ")" << G4endl; 2026 2039 } 2027 2040 … … 2036 2049 convertEndian(ctmp, ntrk); 2037 2050 if(DEBUG || kVerbose > 0) { 2038 std::cout << "# of tracks: " << ntrk << std::endl;2051 G4cout << "# of tracks: " << ntrk << G4endl; 2039 2052 } 2040 2053 … … 2071 2084 if(DEBUG || kVerbose > 0) { 2072 2085 if(i < 5) { 2073 std::cout << i << ": " ;2074 for(int j = 0; j < 3; j++) std::cout << steps[0][j] << " ";2086 G4cout << i << ": " ; 2087 for(int j = 0; j < 3; j++) G4cout << steps[0][j] << " "; 2075 2088 int nstp = steps.size(); 2076 std::cout << "<-> ";2077 for(int j = 3; j < 6; j++) std::cout << steps[nstp-1][j] << " ";2078 std::cout << " rgb( ";2079 for(int j = 0; j < 3; j++) std::cout << (int)rgb[j] << " ";2080 std::cout << ")" << std::endl;2089 G4cout << "<-> "; 2090 for(int j = 3; j < 6; j++) G4cout << steps[nstp-1][j] << " "; 2091 G4cout << " rgb( "; 2092 for(int j = 0; j < 3; j++) G4cout << (int)rgb[j] << " "; 2093 G4cout << ")" << G4endl; 2081 2094 } 2082 2095 } … … 2096 2109 2097 2110 if(DEBUG || kVerbose > 0) { 2098 std::cout << "# of detectors : "2099 << ndet << std::endl;2111 G4cout << "# of detectors : " 2112 << ndet << G4endl; 2100 2113 } 2101 2114 … … 2107 2120 convertEndian(ctmp, nedges); 2108 2121 if(DEBUG || kVerbose > 0) { 2109 std::cout << "# of edges in a detector : " << nedges << std::endl;2122 G4cout << "# of edges in a detector : " << nedges << G4endl; 2110 2123 } 2111 2124 … … 2123 2136 2124 2137 if(DEBUG || kVerbose > 0) { 2125 std::cout << " first edge : (" << detector[0][0] << ", "2138 G4cout << " first edge : (" << detector[0][0] << ", " 2126 2139 << detector[0][1] << ", " 2127 2140 << detector[0][2] << ") - (" 2128 2141 << detector[0][3] << ", " 2129 2142 << detector[0][4] << ", " 2130 << detector[0][5] << ")" << std::endl;2143 << detector[0][5] << ")" << G4endl; 2131 2144 } 2132 2145 … … 2135 2148 ifile.read((char *)dcolor, 3); 2136 2149 if(DEBUG || kVerbose > 0) { 2137 std::cout << " detector color : rgb("2150 G4cout << " detector color : rgb(" 2138 2151 << (int)dcolor[0] << ", " 2139 2152 << (int)dcolor[1] << ", " 2140 << (int)dcolor[2] << std::endl;2153 << (int)dcolor[2] << G4endl; 2141 2154 } 2142 2155 … … 2147 2160 std::string dname = cname; 2148 2161 if(DEBUG || kVerbose > 0) { 2149 std::cout << " detector name : " << dname << std::endl;2162 G4cout << " detector name : " << dname << G4endl; 2150 2163 } 2151 2164 … … 2174 2187 std::ifstream ifile(kFileName.c_str(), std::ios_base::in|std::ios_base::binary); 2175 2188 if(!ifile) { 2176 std::cerr << "Cannot open file: " << kFileName 2177 << " in G4GMocrenIO::retrieveData3()." << std::endl; 2189 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 2190 G4cout << "Cannot open file: " << kFileName 2191 << " in G4GMocrenIO::retrieveData3()." << G4endl; 2178 2192 return false; 2179 2193 } … … 2192 2206 ss << (int)ver; 2193 2207 kVersion = ss.str(); 2194 if(DEBUG || kVerbose > 0) std::cout << "File version : " << kVersion << std::endl;2208 if(DEBUG || kVerbose > 0) G4cout << "File version : " << kVersion << G4endl; 2195 2209 2196 2210 // endian 2197 2211 ifile.read((char *)&kLittleEndianInput, sizeof(char)); 2198 2212 if(DEBUG || kVerbose > 0) { 2199 std::cout << "Endian : ";2213 G4cout << "Endian : "; 2200 2214 if(kLittleEndianInput == 1) 2201 std::cout << " little" << std::endl;2215 G4cout << " little" << G4endl; 2202 2216 else { 2203 std::cout << " big" << std::endl;2217 G4cout << " big" << G4endl; 2204 2218 } 2205 2219 } … … 2215 2229 setComment(scmt); 2216 2230 if(DEBUG || kVerbose > 0) { 2217 std::cout << "Data comment : "2218 << kComment << std::endl;2231 G4cout << "Data comment : " 2232 << kComment << G4endl; 2219 2233 } 2220 2234 … … 2225 2239 convertEndian(ctmp+8, kVoxelSpacing[2]); 2226 2240 if(DEBUG || kVerbose > 0) { 2227 std::cout << "Voxel spacing : ("2241 G4cout << "Voxel spacing : (" 2228 2242 << kVoxelSpacing[0] << ", " 2229 2243 << kVoxelSpacing[1] << ", " 2230 2244 << kVoxelSpacing[2] 2231 << ") mm " << std::endl;2245 << ") mm " << G4endl; 2232 2246 } 2233 2247 … … 2258 2272 convertEndian(ctmp, kPointerToTrackData); 2259 2273 if(DEBUG || kVerbose > 0) { 2260 std::cout << "Each pointer to data : "2274 G4cout << "Each pointer to data : " 2261 2275 << kPointerToModalityData << ", "; 2262 2276 for(int i = 0; i < nDoseDist; i++) 2263 std::cout << kPointerToDoseDistData[0] << ", ";2264 std::cout << kPointerToROIData << ", "2265 << kPointerToTrackData << std::endl;2277 G4cout << kPointerToDoseDistData[0] << ", "; 2278 G4cout << kPointerToROIData << ", " 2279 << kPointerToTrackData << G4endl; 2266 2280 } 2267 2281 … … 2269 2283 kPointerToROIData == 0 && kPointerToTrackData == 0) { 2270 2284 if(DEBUG || kVerbose > 0) { 2271 std::cout << "No data." << std::endl;2285 G4cout << "No data." << G4endl; 2272 2286 } 2273 2287 return false; … … 2294 2308 convertEndian(ctmp+2*sizeof(int), size[2]); 2295 2309 if(DEBUG || kVerbose > 0) { 2296 std::cout << "Modality image size : ("2310 G4cout << "Modality image size : (" 2297 2311 << size[0] << ", " 2298 2312 << size[1] << ", " 2299 2313 << size[2] << ")" 2300 << std::endl;2314 << G4endl; 2301 2315 } 2302 2316 kModality.setSize(size); … … 2329 2343 kModality.setScale(dscale = scale); 2330 2344 if(DEBUG || kVerbose > 0) { 2331 std::cout << "Modality image min., max., scale : "2345 G4cout << "Modality image min., max., scale : " 2332 2346 << minmax[0] << ", " 2333 2347 << minmax[1] << ", " 2334 << scale << std::endl;2348 << scale << G4endl; 2335 2349 } 2336 2350 2337 2351 // modality density 2338 2352 int psize = size[0]*size[1]; 2339 if(DEBUG || kVerbose > 0) std::cout << "Modality image (" << psize << "): ";2353 if(DEBUG || kVerbose > 0) G4cout << "Modality image (" << psize << "): "; 2340 2354 char * cimage = new char[psize*sizeof(short)]; 2341 2355 for(int i = 0; i < size[2]; i++) { … … 2347 2361 kModality.addImage(mimage); 2348 2362 2349 if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";2350 } 2351 if(DEBUG || kVerbose > 0) std::cout << std::endl;2363 if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", "; 2364 } 2365 if(DEBUG || kVerbose > 0) G4cout << G4endl; 2352 2366 delete [] cimage; 2353 2367 2354 2368 // modality desity map for CT value 2355 2369 size_t msize = minmax[1]-minmax[0]+1; 2356 if(DEBUG || kVerbose > 0) std::cout << "msize: " << msize << std::endl;2370 if(DEBUG || kVerbose > 0) G4cout << "msize: " << msize << G4endl; 2357 2371 char * pdmap = new char[msize*sizeof(float)]; 2358 2372 ifile.read((char *)pdmap, msize*sizeof(float)); … … 2363 2377 } 2364 2378 if(DEBUG || kVerbose > 0) { 2365 std::cout << "density map : " << std::ends;2379 G4cout << "density map : " << std::ends; 2366 2380 for(int i = 0; i < 10; i++) 2367 std::cout <<kModalityImageDensityMap[i] << ", ";2368 std::cout << std::endl;2369 for(int i = 0; i < 10; i++) std::cout << "..";2370 std::cout << std::endl;2381 G4cout <<kModalityImageDensityMap[i] << ", "; 2382 G4cout << G4endl; 2383 for(int i = 0; i < 10; i++) G4cout << ".."; 2384 G4cout << G4endl; 2371 2385 for(size_t i =kModalityImageDensityMap.size() - 10; i <kModalityImageDensityMap.size(); i++) 2372 std::cout <<kModalityImageDensityMap[i] << ", ";2373 std::cout << std::endl;2386 G4cout <<kModalityImageDensityMap[i] << ", "; 2387 G4cout << G4endl; 2374 2388 } 2375 2389 … … 2388 2402 convertEndian(ctmp+2*sizeof(int), size[2]); 2389 2403 if(DEBUG || kVerbose > 0) { 2390 std::cout << "Dose dist. image size : ("2404 G4cout << "Dose dist. image size : (" 2391 2405 << size[0] << ", " 2392 2406 << size[1] << ", " 2393 2407 << size[2] << ")" 2394 << std::endl;2408 << G4endl; 2395 2409 } 2396 2410 kDose[ndose].setSize(size); … … 2407 2421 setDoseDistUnit(sdunit, ndose); 2408 2422 if(DEBUG || kVerbose > 0) { 2409 std::cout << "Dose dist. unit : " << kDoseUnit << std::endl;2423 G4cout << "Dose dist. unit : " << kDoseUnit << G4endl; 2410 2424 } 2411 2425 … … 2420 2434 2421 2435 if(DEBUG || kVerbose > 0) { 2422 std::cout << "Dose dist. image min., max., scale : "2436 G4cout << "Dose dist. image min., max., scale : " 2423 2437 << dminmax[0] << ", " 2424 2438 << dminmax[1] << ", " 2425 << scale << std::endl;2439 << scale << G4endl; 2426 2440 } 2427 2441 2428 2442 // dose distribution image 2429 2443 int dsize = size[0]*size[1]; 2430 if(DEBUG || kVerbose > 0) std::cout << "Dose dist. (" << dsize << "): ";2444 if(DEBUG || kVerbose > 0) G4cout << "Dose dist. (" << dsize << "): "; 2431 2445 char * di = new char[dsize*sizeof(short)]; 2432 2446 short * shimage = new short[dsize]; … … 2440 2454 kDose[ndose].addImage(dimage); 2441 2455 2442 if(DEBUG || kVerbose > 0) std::cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";2456 if(DEBUG || kVerbose > 0) G4cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", "; 2443 2457 2444 2458 if(DEBUG || kVerbose > 0) { 2445 2459 for(int j = 0; j < dsize; j++) { 2446 2460 if(dimage[j] < 0) 2447 std::cout << "[" << j << "," << z << "]"2461 G4cout << "[" << j << "," << z << "]" 2448 2462 << dimage[j] << ", "; 2449 2463 } … … 2452 2466 delete [] shimage; 2453 2467 delete [] di; 2454 if(DEBUG || kVerbose > 0) std::cout << std::endl;2468 if(DEBUG || kVerbose > 0) G4cout << G4endl; 2455 2469 2456 2470 ifile.read((char *)ctmp, 3*4); // 3*sizeof(int) … … 2462 2476 2463 2477 if(DEBUG || kVerbose > 0) { 2464 std::cout << "Dose dist. image relative location : ("2478 G4cout << "Dose dist. image relative location : (" 2465 2479 << fCenter[0] << ", " 2466 2480 << fCenter[1] << ", " 2467 << fCenter[2] << ")" << std::endl;2481 << fCenter[2] << ")" << G4endl; 2468 2482 } 2469 2483 … … 2483 2497 kRoi[0].setSize(size); 2484 2498 if(DEBUG || kVerbose > 0) { 2485 std::cout << "ROI image size : ("2499 G4cout << "ROI image size : (" 2486 2500 << size[0] << ", " 2487 2501 << size[1] << ", " 2488 2502 << size[2] << ")" 2489 << std::endl;2503 << G4endl; 2490 2504 } 2491 2505 … … 2501 2515 kRoi[0].setScale(dscale = scale); 2502 2516 if(DEBUG || kVerbose > 0) { 2503 std::cout << "ROI image min., max., scale : "2517 G4cout << "ROI image min., max., scale : " 2504 2518 << minmax[0] << ", " 2505 2519 << minmax[1] << ", " 2506 << scale << std::endl;2520 << scale << G4endl; 2507 2521 } 2508 2522 … … 2529 2543 kRoi[0].setCenterPosition(fCenter); 2530 2544 if(DEBUG || kVerbose > 0) { 2531 std::cout << "ROI image relative location : ("2545 G4cout << "ROI image relative location : (" 2532 2546 << fCenter[0] << ", " 2533 2547 << fCenter[1] << ", " 2534 << fCenter[2] << ")" << std::endl;2548 << fCenter[2] << ")" << G4endl; 2535 2549 } 2536 2550 … … 2545 2559 convertEndian(ctmp, ntrk); 2546 2560 if(DEBUG || kVerbose > 0) { 2547 std::cout << "# of tracks: " << ntrk << std::endl;2561 G4cout << "# of tracks: " << ntrk << G4endl; 2548 2562 } 2549 2563 … … 2556 2570 2557 2571 ifile.read((char *)ctmp, sizeof(float)*3); 2558 if(DEBUG || kVerbose > 0) if(i < 10) std::cout << i << ": " ;2572 if(DEBUG || kVerbose > 0) if(i < 10) G4cout << i << ": " ; 2559 2573 for(int j = 0; j < 3; j++) { 2560 2574 convertEndian(ctmp+j*sizeof(float), tp[j]); 2561 if(DEBUG || kVerbose > 0) if(i < 10) std::cout << tp[j] << ", ";2575 if(DEBUG || kVerbose > 0) if(i < 10) G4cout << tp[j] << ", "; 2562 2576 } 2563 2577 … … 2565 2579 for(int j = 0; j < 3; j++) { 2566 2580 convertEndian(ctmp+j*sizeof(float), tp[j+3]); 2567 if(DEBUG || kVerbose > 0) if(i < 10) std::cout << tp[j+3] << ", ";2581 if(DEBUG || kVerbose > 0) if(i < 10) G4cout << tp[j+3] << ", "; 2568 2582 } 2569 2583 addTrack(tp); 2570 if(DEBUG || kVerbose > 0) if(i < 10) std::cout << std::endl;2584 if(DEBUG || kVerbose > 0) if(i < 10) G4cout << G4endl; 2571 2585 2572 2586 // v4 … … 2610 2624 std::ifstream ifile(kFileName.c_str(), std::ios_base::in|std::ios_base::binary); 2611 2625 if(!ifile) { 2612 std::cerr << "Cannot open file: " << kFileName 2613 << " in G4GMocrenIO::retrieveData2()." << std::endl; 2626 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 2627 G4cout << "Cannot open file: " << kFileName 2628 << " in G4GMocrenIO::retrieveData2()." << G4endl; 2614 2629 return false; 2615 2630 } … … 2628 2643 ss << (int)ver; 2629 2644 kVersion = ss.str(); 2630 if(DEBUG || kVerbose > 0) std::cout << "File version : " << kVersion << std::endl;2645 if(DEBUG || kVerbose > 0) G4cout << "File version : " << kVersion << G4endl; 2631 2646 2632 2647 // id of version 1 … … 2641 2656 ifile.read((char *)&kLittleEndianInput, sizeof(char)); 2642 2657 if(DEBUG || kVerbose > 0) { 2643 std::cout << "Endian : ";2658 G4cout << "Endian : "; 2644 2659 if(kLittleEndianInput == 1) 2645 std::cout << " little" << std::endl;2660 G4cout << " little" << G4endl; 2646 2661 else { 2647 std::cout << " big" << std::endl;2662 G4cout << " big" << G4endl; 2648 2663 } 2649 2664 } … … 2655 2670 convertEndian(ctmp+8, kVoxelSpacing[2]); 2656 2671 if(DEBUG || kVerbose > 0) { 2657 std::cout << "Voxel spacing : ("2672 G4cout << "Voxel spacing : (" 2658 2673 << kVoxelSpacing[0] << ", " 2659 2674 << kVoxelSpacing[1] << ", " 2660 2675 << kVoxelSpacing[2] 2661 << ") mm " << std::endl;2676 << ") mm " << G4endl; 2662 2677 } 2663 2678 … … 2681 2696 convertEndian(ctmp, kPointerToTrackData); 2682 2697 if(DEBUG || kVerbose > 0) { 2683 std::cout << "Each pointer to data : "2698 G4cout << "Each pointer to data : " 2684 2699 << kPointerToModalityData << ", " 2685 2700 << kPointerToDoseDistData[0] << ", " 2686 2701 << kPointerToROIData << ", " 2687 << kPointerToTrackData << std::endl;2702 << kPointerToTrackData << G4endl; 2688 2703 } 2689 2704 … … 2691 2706 kPointerToROIData == 0 && kPointerToTrackData == 0) { 2692 2707 if(DEBUG || kVerbose > 0) { 2693 std::cout << "No data." << std::endl;2708 G4cout << "No data." << G4endl; 2694 2709 } 2695 2710 return false; … … 2716 2731 convertEndian(ctmp+2*sizeof(int), size[2]); 2717 2732 if(DEBUG || kVerbose > 0) { 2718 std::cout << "Modality image size : ("2733 G4cout << "Modality image size : (" 2719 2734 << size[0] << ", " 2720 2735 << size[1] << ", " 2721 2736 << size[2] << ")" 2722 << std::endl;2737 << G4endl; 2723 2738 } 2724 2739 kModality.setSize(size); … … 2745 2760 kModality.setScale(dscale = scale); 2746 2761 if(DEBUG || kVerbose > 0) { 2747 std::cout << "Modality image min., max., scale : "2762 G4cout << "Modality image min., max., scale : " 2748 2763 << minmax[0] << ", " 2749 2764 << minmax[1] << ", " 2750 << scale << std::endl;2765 << scale << G4endl; 2751 2766 } 2752 2767 2753 2768 // modality density 2754 2769 int psize = size[0]*size[1]; 2755 if(DEBUG || kVerbose > 0) std::cout << "Modality image (" << psize << "): ";2770 if(DEBUG || kVerbose > 0) G4cout << "Modality image (" << psize << "): "; 2756 2771 char * cimage = new char[psize*sizeof(short)]; 2757 2772 for(int i = 0; i < size[2]; i++) { … … 2763 2778 kModality.addImage(mimage); 2764 2779 2765 if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";2766 } 2767 if(DEBUG || kVerbose > 0) std::cout << std::endl;2780 if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", "; 2781 } 2782 if(DEBUG || kVerbose > 0) G4cout << G4endl; 2768 2783 delete [] cimage; 2769 2784 2770 2785 // modality desity map for CT value 2771 2786 size_t msize = minmax[1]-minmax[0]+1; 2772 if(DEBUG || kVerbose > 0) std::cout << "msize: " << msize << std::endl;2787 if(DEBUG || kVerbose > 0) G4cout << "msize: " << msize << G4endl; 2773 2788 char * pdmap = new char[msize*sizeof(float)]; 2774 2789 ifile.read((char *)pdmap, msize*sizeof(float)); … … 2779 2794 } 2780 2795 if(DEBUG || kVerbose > 0) { 2781 std::cout << "density map : " << std::ends;2796 G4cout << "density map : " << std::ends; 2782 2797 for(int i = 0; i < 10; i++) 2783 std::cout <<kModalityImageDensityMap[i] << ", ";2784 std::cout << std::endl;2785 for(int i = 0; i < 10; i++) std::cout << "..";2786 std::cout << std::endl;2798 G4cout <<kModalityImageDensityMap[i] << ", "; 2799 G4cout << G4endl; 2800 for(int i = 0; i < 10; i++) G4cout << ".."; 2801 G4cout << G4endl; 2787 2802 for(size_t i =kModalityImageDensityMap.size() - 10; i <kModalityImageDensityMap.size(); i++) 2788 std::cout <<kModalityImageDensityMap[i] << ", ";2789 std::cout << std::endl;2803 G4cout <<kModalityImageDensityMap[i] << ", "; 2804 G4cout << G4endl; 2790 2805 } 2791 2806 … … 2804 2819 convertEndian(ctmp+2*sizeof(int), size[2]); 2805 2820 if(DEBUG || kVerbose > 0) { 2806 std::cout << "Dose dist. image size : ("2821 G4cout << "Dose dist. image size : (" 2807 2822 << size[0] << ", " 2808 2823 << size[1] << ", " 2809 2824 << size[2] << ")" 2810 << std::endl;2825 << G4endl; 2811 2826 } 2812 2827 kDose[0].setSize(size); … … 2826 2841 2827 2842 if(DEBUG || kVerbose > 0) { 2828 std::cout << "Dose dist. image min., max., scale : "2843 G4cout << "Dose dist. image min., max., scale : " 2829 2844 << dminmax[0] << ", " 2830 2845 << dminmax[1] << ", " 2831 << scale << std::endl;2846 << scale << G4endl; 2832 2847 } 2833 2848 2834 2849 // dose distribution image 2835 2850 int dsize = size[0]*size[1]; 2836 if(DEBUG || kVerbose > 0) std::cout << "Dose dist. (" << dsize << "): ";2851 if(DEBUG || kVerbose > 0) G4cout << "Dose dist. (" << dsize << "): "; 2837 2852 char * di = new char[dsize*sizeof(short)]; 2838 2853 short * shimage = new short[dsize]; … … 2846 2861 kDose[0].addImage(dimage); 2847 2862 2848 if(DEBUG || kVerbose > 0) std::cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";2863 if(DEBUG || kVerbose > 0) G4cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", "; 2849 2864 2850 2865 if(DEBUG || kVerbose > 0) { 2851 2866 for(int j = 0; j < dsize; j++) { 2852 2867 if(dimage[j] < 0) 2853 std::cout << "[" << j << "," << z << "]"2868 G4cout << "[" << j << "," << z << "]" 2854 2869 << dimage[j] << ", "; 2855 2870 } … … 2858 2873 delete [] shimage; 2859 2874 delete [] di; 2860 if(DEBUG || kVerbose > 0) std::cout << std::endl;2875 if(DEBUG || kVerbose > 0) G4cout << G4endl; 2861 2876 2862 2877 /* ver 1 … … 2902 2917 2903 2918 if(DEBUG || kVerbose > 0) { 2904 std::cout << "Dose dist. image relative location : ("2919 G4cout << "Dose dist. image relative location : (" 2905 2920 << fCenter[0] << ", " 2906 2921 << fCenter[1] << ", " 2907 << fCenter[2] << ")" << std::endl;2922 << fCenter[2] << ")" << G4endl; 2908 2923 } 2909 2924 … … 2923 2938 kRoi[0].setSize(size); 2924 2939 if(DEBUG || kVerbose > 0) { 2925 std::cout << "ROI image size : ("2940 G4cout << "ROI image size : (" 2926 2941 << size[0] << ", " 2927 2942 << size[1] << ", " 2928 2943 << size[2] << ")" 2929 << std::endl;2944 << G4endl; 2930 2945 } 2931 2946 … … 2941 2956 kRoi[0].setScale(dscale = scale); 2942 2957 if(DEBUG || kVerbose > 0) { 2943 std::cout << "ROI image min., max., scale : "2958 G4cout << "ROI image min., max., scale : " 2944 2959 << minmax[0] << ", " 2945 2960 << minmax[1] << ", " 2946 << scale << std::endl;2961 << scale << G4endl; 2947 2962 } 2948 2963 … … 2969 2984 kRoi[0].setCenterPosition(fCenter); 2970 2985 if(DEBUG || kVerbose > 0) { 2971 std::cout << "ROI image relative location : ("2986 G4cout << "ROI image relative location : (" 2972 2987 << fCenter[0] << ", " 2973 2988 << fCenter[1] << ", " 2974 << fCenter[2] << ")" << std::endl;2989 << fCenter[2] << ")" << G4endl; 2975 2990 } 2976 2991 … … 2985 3000 convertEndian(ctmp, ntrk); 2986 3001 if(DEBUG || kVerbose > 0) { 2987 std::cout << "# of tracks: " << ntrk << std::endl;3002 G4cout << "# of tracks: " << ntrk << G4endl; 2988 3003 } 2989 3004 … … 2997 3012 2998 3013 ifile.read((char *)ctmp, sizeof(float)*3); 2999 if(DEBUG || kVerbose > 0) if(i < 10) std::cout << i << ": " ;3014 if(DEBUG || kVerbose > 0) if(i < 10) G4cout << i << ": " ; 3000 3015 for(int j = 0; j < 3; j++) { 3001 3016 convertEndian(ctmp+j*sizeof(float), tp[j]); 3002 if(DEBUG || kVerbose > 0) if(i < 10) std::cout << tp[j] << ", ";3017 if(DEBUG || kVerbose > 0) if(i < 10) G4cout << tp[j] << ", "; 3003 3018 } 3004 3019 … … 3006 3021 for(int j = 0; j < 3; j++) { 3007 3022 convertEndian(ctmp+j*sizeof(float), tp[j+3]); 3008 if(DEBUG || kVerbose > 0) if(i < 10) std::cout << tp[j+3] << ", ";3023 if(DEBUG || kVerbose > 0) if(i < 10) G4cout << tp[j+3] << ", "; 3009 3024 } 3010 3025 … … 3014 3029 addTrack(trkv4, trkcolorv4); 3015 3030 3016 if(DEBUG || kVerbose > 0) if(i < 10) std::cout << std::endl;3031 if(DEBUG || kVerbose > 0) if(i < 10) G4cout << G4endl; 3017 3032 } 3018 3033 … … 3217 3232 setPointerToTrackData(pointer0); 3218 3233 } 3219 if(kVerbose > 0) std::cout << " pointer to the track data :"3220 << kPointerToTrackData << std::endl;3234 if(kVerbose > 0) G4cout << " pointer to the track data :" 3235 << kPointerToTrackData << G4endl; 3221 3236 3222 3237 // pointer to detector data … … 3227 3242 kPointerToDetectorData = 0; 3228 3243 } 3229 if(kVerbose > 0) std::cout << " pointer to the detector data :"3230 << kPointerToDetectorData << std::endl;3244 if(kVerbose > 0) G4cout << " pointer to the detector data :" 3245 << kPointerToDetectorData << G4endl; 3231 3246 3232 3247 } … … 3431 3446 rval = minmax[1]; 3432 3447 for(int i = 0; i < nmap; i++) { 3433 // std::cout << kModalityImageDensityMap[i] << std::endl;3448 //G4cout << kModalityImageDensityMap[i] << G4endl; 3434 3449 if(_dens <= kModalityImageDensityMap[i]) { 3435 3450 rval = i + minmax[0]; … … 3558 3573 3559 3574 if(_data == NULL) { 3560 std::cerr << "In G4GMocrenIO::getShortDoseDist(), " 3561 << "first argument is NULL pointer. " 3562 << "The argument must be allocated array." 3563 << std::endl; 3575 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 3576 G4cout << "In G4GMocrenIO::getShortDoseDist(), " 3577 << "first argument is NULL pointer. " 3578 << "The argument must be allocated array." 3579 << G4endl; 3564 3580 std::exit(-1); 3565 3581 } … … 3599 3615 void G4GMocrenIO::getDoseDist(double * & _image, int _z, int _num) { 3600 3616 3601 std::cout << " <" << (void*)_image << "> ";3617 G4cout << " <" << (void*)_image << "> "; 3602 3618 if(isDoseEmpty()) { 3603 3619 _image = 0; 3604 3620 } else { 3605 3621 _image = kDose[_num].getImage(_z); 3606 std::cout << " <" << (void*)_image << "> ";3607 std::cout << _image[100] << " ";3622 G4cout << " <" << (void*)_image << "> "; 3623 G4cout << _image[100] << " "; 3608 3624 } 3609 3625 } … … 3660 3676 bool G4GMocrenIO::mergeDoseDist(std::vector<class GMocrenDataPrimitive<double> > & _dose) { 3661 3677 if(kDose.size() != _dose.size()) { 3662 std::cerr << "G4GMocrenIO::mergeDoseDist() : Error" << std::endl; 3663 std::cerr << " Unable to merge the dose distributions,"<< std::endl; 3664 std::cerr << " because of different size of dose maps."<< std::endl; 3678 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) { 3679 G4cout << "G4GMocrenIO::mergeDoseDist() : Error" << G4endl; 3680 G4cout << " Unable to merge the dose distributions,"<< G4endl; 3681 G4cout << " because of different size of dose maps."<< G4endl; 3682 } 3665 3683 return false; 3666 3684 } … … 3670 3688 std::vector<class GMocrenDataPrimitive<double> >::iterator itr2 = _dose.begin(); 3671 3689 for(int i = 0; i < num; i++, itr1++, itr2++) { 3672 if(kVerbose > 0) std::cerr << "merged dose distribution [" << i << "]" << std::endl; 3690 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 3691 if(kVerbose > 0) 3692 G4cout << "merged dose distribution [" << i << "]" << G4endl; 3673 3693 *itr1 += *itr2; 3674 3694 } … … 3689 3709 bool G4GMocrenIO::isDoseEmpty() { 3690 3710 if(kDose.empty()) { 3691 //std::cerr << "!!! dose distribution data is empty." << std::endl; 3711 //if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 3712 // G4cout << "!!! dose distribution data is empty." << G4endl; 3692 3713 return true; 3693 3714 } else { … … 3794 3815 bool G4GMocrenIO::isROIEmpty() { 3795 3816 if(kRoi.empty()) { 3796 //std::cerr << "!!! ROI data is empty." << std::endl; 3817 //if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 3818 // G4cout << "!!! ROI data is empty." << G4endl; 3797 3819 return true; 3798 3820 } else { … … 3883 3905 3884 3906 if(_num > (int)kTracks.size()) { 3885 std::cerr << "ERROR in getTrack() : " << std::endl; 3907 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 3908 G4cout << "ERROR in getTrack() : " << G4endl; 3886 3909 std::exit(-1); 3887 3910 } … … 3942 3965 3943 3966 if(_num > (int)kDetectors.size()) { 3944 std::cerr << "ERROR in getDetector() : " << std::endl; 3967 if (G4VisManager::GetVerbosity() >= G4VisManager::errors) 3968 G4cout << "ERROR in getDetector() : " << G4endl; 3945 3969 std::exit(-1); 3946 3970 } -
trunk/source/visualization/gMocren/src/G4GMocrenMessenger.cc
r1337 r1347 26 26 // 27 27 // $Id: G4GMocrenMessenger.cc,v 1.2 2009/10/12 10:04:35 akimura Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 //
Note: See TracChangeset
for help on using the changeset viewer.