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

Implements a G4VNestedParameterisation. More...

#include <DicomNestedPhantomParameterisation.hh>

Inheritance diagram for DicomNestedPhantomParameterisation:
Collaboration diagram for DicomNestedPhantomParameterisation:

Public Member Functions

 DicomNestedPhantomParameterisation (const G4ThreeVector &voxelSize, std::vector< G4Material * > &mat, G4int fnZ_=0, G4int fnY_=0, G4int fnX_=0)
 
 ~DicomNestedPhantomParameterisation ()
 
G4MaterialComputeMaterial (G4VPhysicalVolume *currentVol, const G4int repNo, const G4VTouchable *parentTouch)
 
G4int GetNumberOfMaterials () const
 
G4MaterialGetMaterial (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 G4VSolidComputeSolid (const G4int no, G4VPhysicalVolume *thisVol)
 
G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
 
virtual G4bool IsNested () const
 
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
 
- 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 207 of file DicomNestedPhantomParameterisation.cc.

208 {
209  box.SetXHalfLength(fdX);
210  box.SetYHalfLength(fdY);
211  box.SetZHalfLength(fdZ);
212 }
void SetZHalfLength(G4double dz)
Definition: G4Box.cc:174
void SetYHalfLength(G4double dy)
Definition: G4Box.cc:154
void SetXHalfLength(G4double dx)
Definition: G4Box.cc:134

Here is the call graph for this function:

G4Material * DicomNestedPhantomParameterisation::ComputeMaterial ( G4VPhysicalVolume currentVol,
const G4int  repNo,
const G4VTouchable parentTouch 
)
virtual

Implements G4VNestedParameterisation.

Definition at line 122 of file DicomNestedPhantomParameterisation.cc.

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  if(false && physVol && G4VVisManager::GetConcreteInstance()) {
143  G4String mateName = fMaterials.at(matIndex)->GetName();
144  std::string::size_type iuu = mateName.find("__");
145  if( iuu != std::string::npos ) {
146  mateName = mateName.substr( 0, iuu );
147  }
148 
149  if(0 < fColours.count(mateName)) {
150  physVol->GetLogicalVolume()->
151  SetVisAttributes(fColours.find(mateName)->second);
152  } else {
153  physVol->GetLogicalVolume()->
154  SetVisAttributes(fColours.begin()->second);
155  }
156  }
157 
158  return mate;
159 }
static G4VVisManager * GetConcreteInstance()
unsigned int GetMaterialIndex(unsigned int nx, unsigned int ny, unsigned int nz) const
int G4int
Definition: G4Types.hh:78
virtual G4int GetReplicaNumber(G4int depth=0) const
Definition: G4VTouchable.cc:58

Here is the call graph for this function:

void DicomNestedPhantomParameterisation::ComputeTransformation ( const G4int  no,
G4VPhysicalVolume currentPV 
) const
virtual

Implements G4VNestedParameterisation.

Definition at line 193 of file DicomNestedPhantomParameterisation.cc.

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

Here is the call graph for this function:

G4Material * DicomNestedPhantomParameterisation::GetMaterial ( G4int  idx) const
virtual

Implements G4VNestedParameterisation.

Definition at line 184 of file DicomNestedPhantomParameterisation.cc.

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

Here is the caller graph for this function:

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

Definition at line 163 of file DicomNestedPhantomParameterisation.cc.

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

Implements G4VNestedParameterisation.

Definition at line 174 of file DicomNestedPhantomParameterisation.cc.

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

Definition at line 88 of file DicomNestedPhantomParameterisation.hh.

88 { 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: