Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // << 27 /// \file medical/DICOM/src/DicomNestedParamDe 26 /// \file medical/DICOM/src/DicomNestedParamDetectorConstruction.cc 28 /// \brief Implementation of the DicomNestedPa 27 /// \brief Implementation of the DicomNestedParamDetectorConstruction class 29 // 28 // 30 // History: 29 // History: 31 // Pedro Arce << 30 // Pedro Arce 32 // 31 // 33 //******************************************** 32 //******************************************************* 34 33 35 #include "DicomNestedParamDetectorConstruction << 34 #include "globals.hh" 36 << 37 #include "DicomNestedPhantomParameterisation.h << 38 35 39 #include "G4Box.hh" 36 #include "G4Box.hh" 40 #include "G4LogicalVolume.hh" 37 #include "G4LogicalVolume.hh" 41 #include "G4PVParameterised.hh" << 42 #include "G4PVPlacement.hh" << 43 #include "G4VPhysicalVolume.hh" 38 #include "G4VPhysicalVolume.hh" 44 #include "G4VisAttributes.hh" << 39 #include "G4PVPlacement.hh" 45 #include "globals.hh" << 40 #include "G4PVParameterised.hh" >> 41 >> 42 #include "DicomNestedParamDetectorConstruction.hh" >> 43 #include "DicomNestedPhantomParameterisation.hh" 46 44 47 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 48 DicomNestedParamDetectorConstruction::DicomNes << 46 DicomNestedParamDetectorConstruction::DicomNestedParamDetectorConstruction() : DicomDetectorConstruction() 49 : DicomDetectorConstruction() << 47 { 50 {} << 48 } 51 49 52 //....oooOO0OOooo........oooOO0OOooo........oo 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 53 DicomNestedParamDetectorConstruction::~DicomNe << 51 DicomNestedParamDetectorConstruction::~DicomNestedParamDetectorConstruction() >> 52 { >> 53 } 54 54 55 //....oooOO0OOooo........oooOO0OOooo........oo 55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 56 void DicomNestedParamDetectorConstruction::Con 56 void DicomNestedParamDetectorConstruction::ConstructPhantom() 57 { 57 { 58 #ifdef G4VERBOSE 58 #ifdef G4VERBOSE 59 G4cout << "DicomNestedParamDetectorConstruct 59 G4cout << "DicomNestedParamDetectorConstruction::ConstructPhantom " << G4endl; 60 #endif 60 #endif 61 61 62 //----- Replication of Water Phantom Volume. 62 //----- Replication of Water Phantom Volume. 63 //--- Y Slice 63 //--- Y Slice 64 G4String yRepName("RepY"); 64 G4String yRepName("RepY"); 65 G4VSolid* solYRep = 65 G4VSolid* solYRep = 66 new G4Box(yRepName, fNoVoxelsX * fVoxelHal << 66 new G4Box(yRepName,fNVoxelX*fVoxelHalfDimX,fVoxelHalfDimY,fNVoxelZ*fVoxelHalfDimZ); 67 G4LogicalVolume* logYRep = new G4LogicalVolu << 67 G4LogicalVolume* logYRep = 68 new G4PVReplica(yRepName, logYRep, fContaine << 68 new G4LogicalVolume(solYRep,fAir,yRepName); 69 << 69 new G4PVReplica(yRepName,logYRep,fContainer_logic,kYAxis,fNVoxelY,fVoxelHalfDimY*2.); 70 logYRep->SetVisAttributes(new G4VisAttribute << 71 70 72 //--- X Slice 71 //--- X Slice 73 G4String xRepName("RepX"); 72 G4String xRepName("RepX"); 74 G4VSolid* solXRep = 73 G4VSolid* solXRep = 75 new G4Box(xRepName, fVoxelHalfDimX, fVoxel << 74 new G4Box(xRepName,fVoxelHalfDimX,fVoxelHalfDimY,fNVoxelZ*fVoxelHalfDimZ); 76 G4LogicalVolume* logXRep = new G4LogicalVolu << 75 G4LogicalVolume* logXRep = 77 new G4PVReplica(xRepName, logXRep, logYRep, << 76 new G4LogicalVolume(solXRep,fAir,xRepName); 78 << 77 new G4PVReplica(xRepName,logXRep,logYRep,kXAxis,fNVoxelX,fVoxelHalfDimX*2.); 79 logXRep->SetVisAttributes(new G4VisAttribute << 80 78 81 //----- Voxel solid and logical volumes 79 //----- Voxel solid and logical volumes 82 //--- Z Slice 80 //--- Z Slice 83 G4VSolid* solVoxel = new G4Box("phantom", fV << 81 G4VSolid* solVoxel = 84 G4LogicalVolume* logicVoxel = new G4LogicalV << 82 new G4Box("phantom",fVoxelHalfDimX,fVoxelHalfDimY,fVoxelHalfDimZ); 85 << 83 G4LogicalVolume* logicVoxel = new G4LogicalVolume(solVoxel,fAir,"phantom"); 86 logicVoxel->SetVisAttributes(new G4VisAttrib << 87 84 88 // 85 // 89 // Parameterisation for transformation of vo 86 // Parameterisation for transformation of voxels. 90 // (voxel size is fixed in this example. << 87 // (voxel size is fixed in this example. 91 // e.g. nested parameterisation handles m << 88 // e.g. nested parameterisation handles material and transfomation of voxels.) 92 // and transfomation of voxels.) << 89 G4ThreeVector voxelSize(fVoxelHalfDimX,fVoxelHalfDimY,fVoxelHalfDimZ); 93 G4ThreeVector voxelSize(fVoxelHalfDimX, fVox << 90 DicomNestedPhantomParameterisation* param 94 DicomNestedPhantomParameterisation* param = << 91 = new DicomNestedPhantomParameterisation(voxelSize,fMaterials); 95 new DicomNestedPhantomParameterisation(vox << 92 96 << 93 new G4PVParameterised("phantom", // their name 97 new G4PVParameterised("phantom", // their n << 94 logicVoxel, // their logical volume 98 logicVoxel, // their << 95 logXRep, // Mother logical volume 99 logXRep, // Mother lo << 96 kZAxis, // Are placed along this axis 100 kZAxis, // Are placed << 97 // kUndefined, // Are placed along this axis 101 // kUndefined, << 98 fNVoxelZ, // Number of cells 102 // Are placed along t << 99 param); // Parameterisation. 103 fNoVoxelsZ, // Number << 100 104 param); // Parameteri << 101 param->SetMaterialIndices( fMateIDs ); 105 << 102 param->SetNoVoxel( fNVoxelX, fNVoxelY, fNVoxelZ ); 106 param->SetMaterialIndices(fMateIDs); << 107 param->SetNoVoxels(fNoVoxelsX, fNoVoxelsY, f << 108 << 109 // phantom_phys->SetRegularStructureId(0); << 110 103 111 // Z logical volume << 112 SetScorer(logicVoxel); << 113 } 104 } 114 105