51 fNucleusMaterial1 = nucleus1;
52 fCytoplasmMaterial1 = cytoplasm1;
53 fNucleusMaterial2 = nucleus2;
54 fCytoplasmMaterial2 = cytoplasm2;
55 fNucleusMaterial3 = nucleus3;
56 fCytoplasmMaterial3 = cytoplasm3;
59 G4int shiftX, shiftY, shiftZ;
61 G4double denCyto1, denCyto2, denCyto3, denNucl1, denNucl2, denNucl3;
79 fMap = fopen(
"phantom.dat",
"r");
85 ncols = fscanf(fMap,
"%i %i %i",&fPhantomTotalPixels,&fNucleusTotalPixels,&fCytoplasmTotalPixels);
87 fMaterial =
new G4double[fPhantomTotalPixels];
88 fMass =
new G4double[fPhantomTotalPixels];
89 fTissueType =
new G4int[fPhantomTotalPixels];
94 ncols = fscanf(fMap,
"%lf %lf %lf",&fDimCellBoxX,&fDimCellBoxY,&fDimCellBoxZ);
101 if (nlines == 2) ncols = fscanf(fMap,
"%i %i %i",&shiftX,&shiftY,&shiftZ);
103 if (nlines == 3) ncols = fscanf(fMap,
"%lf %lf %lf",&denCyto1, &denCyto2, &denCyto3);
105 if (nlines == 4) ncols = fscanf(fMap,
"%lf %lf %lf",&denNucl1, &denNucl2, &denNucl3);
107 if (nlines > 4) ncols = fscanf(fMap,
"%lf %lf %lf %lf %lf %lf",&x,&y,&z,&mat,&den,&tmp);
109 if (ncols < 0)
break;
116 fMapCell[nlines-5]=v;
117 fMaterial[nlines-5]=
mat;
122 if( fMaterial[nlines-5] == 2 )
124 if( fMass[nlines-5] == 1 )
126 fTissueType[nlines-5]=2;
128 if( fMass[nlines-5] == 2 )
130 fTissueType[nlines-5]=2;
132 if( fMass[nlines-5] == 3 )
134 fTissueType[nlines-5]=2;
138 else if( fMaterial[nlines-5] == 1 )
140 if( fMass[nlines-5] == 1 )
142 fTissueType[nlines-5]=1;
144 if( fMass[nlines-5] == 2 )
146 fTissueType[nlines-5]=2;
148 if( fMass[nlines-5] == 3 )
150 fTissueType[nlines-5]=1;
156 if (std::abs(mat-2)<1.
e-30)
158 if (std::abs(den-1)<1.
e-30) density = denNucl1*(
g/
cm3);
159 if (std::abs(den-2)<1.e-30) density = denNucl2*(
g/
cm3);
160 if (std::abs(den-3)<1.e-30) density = denNucl3*(
g/
cm3);
161 fNucleusMass = fNucleusMass + density * fDimCellBoxX * fDimCellBoxY * fDimCellBoxZ ;
164 if (std::abs(mat-1)<1.e-30)
166 if (std::abs(den-1)<1
e-30) density = denCyto1*(
g/
cm3);
167 if (std::abs(den-2)<1
e-30) density = denCyto2*(
g/
cm3);
168 if (std::abs(den-3)<1
e-30) density = denCyto3*(
g/
cm3);
169 fCytoplasmMass = fCytoplasmMass + density * fDimCellBoxX * fDimCellBoxY * fDimCellBoxZ ;
182 fNucleusAttributes1->SetForceSolid(
false);
186 fNucleusAttributes2->SetForceSolid(
false);
190 fNucleusAttributes3->SetForceSolid(
false);
196 fCytoplasmAttributes1->SetForceSolid(
false);
200 fCytoplasmAttributes2->SetForceSolid(
false);
204 fCytoplasmAttributes3->SetForceSolid(
false);
229 fMapCell[copyNo].
x()*fDimCellBoxX,
230 fMapCell[copyNo].
y()*fDimCellBoxY,
231 fMapCell[copyNo].
z()*fDimCellBoxZ
252 if(
fMass[copyNo] == 1 )
257 if(
fMass[copyNo] == 2 )
262 if(
fMass[copyNo] == 3 )
271 if(
fMass[copyNo] == 1 )
276 if(
fMass[copyNo] == 2 )
282 if(
fMass[copyNo] == 3 )
G4Material * ComputeMaterial(const G4int copyNo, G4VPhysicalVolume *physVol, const G4VTouchable *)
static constexpr double micrometer
virtual ~CellParameterisation()
G4LogicalVolume * GetLogicalVolume() const
G4Material * fCytoplasmMaterial3
void SetTranslation(const G4ThreeVector &v)
G4Material * GetMaterial() const
static constexpr double g
G4Material * fNucleusMaterial2
G4Material * fCytoplasmMaterial2
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
void SetVisAttributes(const G4VisAttributes *pVA)
G4Material * fCytoplasmMaterial1
G4Material * fNucleusMaterial1
G4Material * fNucleusMaterial3
void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
G4VisAttributes * fNucleusAttributes1
static CellParameterisation * gInstance
G4VisAttributes * fNucleusAttributes2
void SetColour(const G4Colour &)
G4VisAttributes * fCytoplasmAttributes1
G4VisAttributes * fCytoplasmAttributes2
static constexpr double cm3
G4VisAttributes * fCytoplasmAttributes3
CellParameterisation(G4Material *nucleus1, G4Material *cytoplasm1, G4Material *nucleus2, G4Material *cytoplasm2, G4Material *nucleus3, G4Material *cytoplasm3)
G4VisAttributes * fNucleusAttributes3