Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
DicomNestedPhantomParameterisation Class Reference

Implements a G4VNestedParameterisation. More...

#include <DicomNestedPhantomParameterisation.hh>

Inheritance diagram for DicomNestedPhantomParameterisation:
G4VNestedParameterisation G4VPVParameterisation G4VVolumeMaterialScanner

Public Member Functions

 DicomNestedPhantomParameterisation (const G4ThreeVector &voxelSize, std::vector< G4Material * > &mat, G4int fnZ_=0, G4int fnY_=0, G4int fnX_=0)
 
 ~DicomNestedPhantomParameterisation ()
 
G4Material * ComputeMaterial (G4VPhysicalVolume *currentVol, const G4int repNo, const G4VTouchable *parentTouch)
 
G4int GetNumberOfMaterials () const
 
G4Material * GetMaterial (G4int idx) const
 
unsigned int GetMaterialIndex (unsigned int nx, unsigned int ny, unsigned int nz) const
 
unsigned int GetMaterialIndex (unsigned int copyNo) const
 
void SetMaterialIndices (size_t *matInd)
 
void SetNoVoxel (unsigned int nx, unsigned int ny, unsigned int nz)
 
void ComputeTransformation (const G4int no, G4VPhysicalVolume *currentPV) const
 
void ComputeDimensions (G4Box &, const G4int, const G4VPhysicalVolume *) const
 
- Public Member Functions inherited from G4VNestedParameterisation
 G4VNestedParameterisation ()
 
virtual ~G4VNestedParameterisation ()
 
virtual G4VSolid * ComputeSolid (const G4int no, G4VPhysicalVolume *thisVol)
 
G4Material * ComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
 
virtual G4bool IsNested () const
 
virtual G4VVolumeMaterialScanner * GetMaterialScanner ()
 
- Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()
 
virtual ~G4VPVParameterisation ()
 
- Public Member Functions inherited from G4VVolumeMaterialScanner
 G4VVolumeMaterialScanner ()
 
virtual ~G4VVolumeMaterialScanner ()
 

Detailed Description

Implements a G4VNestedParameterisation.

Definition at line 66 of file DicomNestedPhantomParameterisation.hh.

Constructor & Destructor Documentation

DicomNestedPhantomParameterisation::DicomNestedPhantomParameterisation ( const G4ThreeVector &  voxelSize,
std::vector< G4Material * > &  mat,
G4int  fnZ_ = 0,
G4int  fnY_ = 0,
G4int  fnX_ = 0 
)

Definition at line 46 of file DicomNestedPhantomParameterisation.cc.

49 :
50  //G4VNestedParameterisation(),
51  fdX(voxelSize.x()), fdY(voxelSize.y()), fdZ(voxelSize.z()),
52  fnX(fnX_), fnY(fnY_), fnZ(fnZ_),
53  fMaterials(mat),
54  fMaterialIndices(0)
55 {
56  ReadColourData();
57 }
double x() const
double z() const
double y() const
DicomNestedPhantomParameterisation::~DicomNestedPhantomParameterisation ( )

Definition at line 60 of file DicomNestedPhantomParameterisation.cc.

61 {
62 }

Member Function Documentation

void DicomNestedPhantomParameterisation::ComputeDimensions ( G4Box &  box,
const G4int  ,
const G4VPhysicalVolume *   
) const
virtual

Reimplemented from G4VNestedParameterisation.

Definition at line 208 of file DicomNestedPhantomParameterisation.cc.

References G4Box::SetXHalfLength(), G4Box::SetYHalfLength(), and G4Box::SetZHalfLength().

209 {
210  box.SetXHalfLength(fdX);
211  box.SetYHalfLength(fdY);
212  box.SetZHalfLength(fdZ);
213 }
void SetZHalfLength(G4double dz)
Definition: G4Box.cc:172
void SetYHalfLength(G4double dy)
Definition: G4Box.cc:152
void SetXHalfLength(G4double dx)
Definition: G4Box.cc:132
G4Material * DicomNestedPhantomParameterisation::ComputeMaterial ( G4VPhysicalVolume *  currentVol,
const G4int  repNo,
const G4VTouchable *  parentTouch 
)
virtual

Implements G4VNestedParameterisation.

Definition at line 122 of file DicomNestedPhantomParameterisation.cc.

References G4VVisManager::GetConcreteInstance(), G4VPhysicalVolume::GetLogicalVolume(), GetMaterialIndex(), G4VTouchable::GetReplicaNumber(), and iz.

124 {
125 
126  // protection for initialization and vis at idle state
127  //
128  if(parentTouch==0) return fMaterials[0];
129 
130  // Copy number of voxels.
131  // Copy number of X and Y are obtained from replication number.
132  // Copy nymber of Z is the copy number of current voxel.
133  G4int ix = parentTouch->GetReplicaNumber(0);
134  G4int iy = parentTouch->GetReplicaNumber(1);
135 
136  G4int copyID = ix + fnX*iy + fnX*fnY*iz;
137 
138  unsigned int matIndex = GetMaterialIndex(copyID);
139  static G4Material* mate = 0;
140  mate = fMaterials[matIndex];
141 
142 
143  if(false && physVol && G4VVisManager::GetConcreteInstance()) {
144  G4String mateName = fMaterials.at(matIndex)->GetName();
145  std::string::size_type iuu = mateName.find("__");
146  if( iuu != std::string::npos ) {
147  mateName = mateName.substr( 0, iuu );
148  }
149 
150  if(0 < fColours.count(mateName)) {
151  physVol->GetLogicalVolume()->
152  SetVisAttributes(fColours.find(mateName)->second);
153  } else {
154  physVol->GetLogicalVolume()->
155  SetVisAttributes(fColours.begin()->second);
156  }
157  }
158 
159  return mate;
160 }
static G4VVisManager * GetConcreteInstance()
unsigned int GetMaterialIndex(unsigned int nx, unsigned int ny, unsigned int nz) const
int G4int
Definition: G4Types.hh:78
G4double iz
Definition: TRTMaterials.hh:39
virtual G4int GetReplicaNumber(G4int depth=0) const
Definition: G4VTouchable.cc:58
void DicomNestedPhantomParameterisation::ComputeTransformation ( const G4int  no,
G4VPhysicalVolume *  currentPV 
) const
virtual

Implements G4VNestedParameterisation.

Definition at line 194 of file DicomNestedPhantomParameterisation.cc.

References G4VPhysicalVolume::SetTranslation().

195 {
196  // Position of voxels.
197  // x and y positions are already defined in DetectorConstruction by using
198  // replicated volume. Here only we need to define is z positions of voxels.
199  physVol->SetTranslation(G4ThreeVector(0.,0.,(2.*static_cast<double>(copyNo)
200  +1.)*fdZ - fdZ*fnZ));
201 }
CLHEP::Hep3Vector G4ThreeVector
G4Material * DicomNestedPhantomParameterisation::GetMaterial ( G4int  idx) const
virtual

Implements G4VNestedParameterisation.

Definition at line 185 of file DicomNestedPhantomParameterisation.cc.

186 {
187  return fMaterials[i];
188 }
unsigned int DicomNestedPhantomParameterisation::GetMaterialIndex ( unsigned int  nx,
unsigned int  ny,
unsigned int  nz 
) const

Referenced by ComputeMaterial().

unsigned int DicomNestedPhantomParameterisation::GetMaterialIndex ( unsigned int  copyNo) const

Definition at line 164 of file DicomNestedPhantomParameterisation.cc.

165 {
166  //return *(fMaterialIndices+copyNo);
167  return fMaterialIndices[copyNo];
168 }
G4int DicomNestedPhantomParameterisation::GetNumberOfMaterials ( ) const
virtual

Implements G4VNestedParameterisation.

Definition at line 175 of file DicomNestedPhantomParameterisation.cc.

176 {
177  return fMaterials.size();
178 }
void DicomNestedPhantomParameterisation::SetMaterialIndices ( size_t *  matInd)
inline

Definition at line 89 of file DicomNestedPhantomParameterisation.hh.

89 { fMaterialIndices = matInd; }
void DicomNestedPhantomParameterisation::SetNoVoxel ( unsigned int  nx,
unsigned int  ny,
unsigned int  nz 
)

Definition at line 113 of file DicomNestedPhantomParameterisation.cc.

114 {
115  fnX = nx;
116  fnY = ny;
117  fnZ = nz;
118 }

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