File indexing completed on 2025-02-23 09:21:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef DICOMNESTEDPARAMETERISATION_HH
0032 #define DICOMNESTEDPARAMETERISATION_HH
0033
0034 #include "G4ThreeVector.hh"
0035 #include "G4Types.hh"
0036 #include "G4VNestedParameterisation.hh"
0037 #include "G4VTouchable.hh"
0038
0039 #include <map>
0040 #include <vector>
0041
0042 class G4VPhysicalVolume;
0043 class G4VSolid;
0044 class G4Material;
0045 class G4VisAttributes;
0046
0047
0048
0049 class G4Box;
0050 class G4Tubs;
0051 class G4Trd;
0052 class G4Trap;
0053 class G4Cons;
0054 class G4Sphere;
0055 class G4Ellipsoid;
0056 class G4Orb;
0057 class G4Torus;
0058 class G4Para;
0059 class G4Polycone;
0060 class G4Polyhedra;
0061 class G4Hype;
0062
0063
0064
0065 class DicomNestedPhantomParameterisation : public G4VNestedParameterisation
0066 {
0067 public:
0068 typedef std::map<G4String, G4VisAttributes*> ColourMap_t;
0069
0070 static G4String fDefaultColorFile;
0071
0072 public:
0073 DicomNestedPhantomParameterisation(const G4ThreeVector& voxelSize,
0074 std::vector<G4Material*>& mat, G4int fnZ_ = 0,
0075 G4int fnY_ = 0, G4int fnX_ = 0,
0076 G4String colorFile = fDefaultColorFile);
0077 ~DicomNestedPhantomParameterisation();
0078
0079 G4Material* ComputeMaterial(G4VPhysicalVolume* currentVol, const G4int repNo,
0080 const G4VTouchable* parentTouch);
0081
0082
0083 G4int GetNumberOfMaterials() const;
0084 G4Material* GetMaterial(G4int idx) const;
0085
0086
0087
0088
0089
0090
0091 unsigned int GetMaterialIndex(unsigned int copyNo) const;
0092 void SetMaterialIndices(size_t* matInd) { fMaterialIndices = matInd; }
0093 void SetNoVoxels(unsigned int nx, unsigned int ny, unsigned int nz);
0094
0095 void ComputeTransformation(const G4int no, G4VPhysicalVolume* currentPV) const;
0096
0097
0098
0099 void ComputeDimensions(G4Box&, const G4int, const G4VPhysicalVolume*) const;
0100
0101 const ColourMap_t& GetColourMap() const { return fColours; }
0102 ColourMap_t& GetColourMap() { return fColours; }
0103
0104 private:
0105 void ComputeDimensions(G4Trd&, const G4int, const G4VPhysicalVolume*) const {}
0106 void ComputeDimensions(G4Trap&, const G4int, const G4VPhysicalVolume*) const {}
0107 void ComputeDimensions(G4Cons&, const G4int, const G4VPhysicalVolume*) const {}
0108 void ComputeDimensions(G4Sphere&, const G4int, const G4VPhysicalVolume*) const {}
0109 void ComputeDimensions(G4Ellipsoid&, const G4int, const G4VPhysicalVolume*) const {}
0110 void ComputeDimensions(G4Orb&, const G4int, const G4VPhysicalVolume*) const {}
0111 void ComputeDimensions(G4Torus&, const G4int, const G4VPhysicalVolume*) const {}
0112 void ComputeDimensions(G4Para&, const G4int, const G4VPhysicalVolume*) const {}
0113 void ComputeDimensions(G4Hype&, const G4int, const G4VPhysicalVolume*) const {}
0114 void ComputeDimensions(G4Tubs&, const G4int, const G4VPhysicalVolume*) const {}
0115 void ComputeDimensions(G4Polycone&, const G4int, const G4VPhysicalVolume*) const {}
0116 void ComputeDimensions(G4Polyhedra&, const G4int, const G4VPhysicalVolume*) const {}
0117
0118 void ReadColourData(G4String);
0119
0120 using G4VNestedParameterisation::ComputeMaterial;
0121
0122 private:
0123 G4double fdX, fdY, fdZ;
0124 G4int fnX, fnY, fnZ;
0125 std::vector<G4Material*> fMaterials;
0126 size_t* fMaterialIndices;
0127 ColourMap_t fColours;
0128 std::map<G4int, G4VisAttributes*> fColours2;
0129 std::vector<G4double> fpZ;
0130 };
0131
0132 #endif