Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // This example is provided by the Geant4-DNA collaboration 27 // Any report or published results obtained using the Geant4-DNA software 28 // shall cite the following Geant4-DNA collaboration publication: 29 // Med. Phys. 37 (2010) 4692-4708 30 // and papers 31 // M. Batmunkh et al. J Radiat Res Appl Sci 8 (2015) 498-507 32 // O. Belov et al. Physica Medica 32 (2016) 1510-1520 33 // The Geant4-DNA web site is available at http://geant4-dna.org 34 // 35 // ------------------------------------------------------------------- 36 // November 2016 37 // ------------------------------------------------------------------- 38 // 39 // 40 /// \file NeuronLoadDataFile.hh 41 /// \brief Implementation of the NeuronLoadDataFile class 42 43 #ifndef NeuronLoadDataFile_H 44 #define NeuronLoadDataFile_H 1 45 46 #include "G4Colour.hh" 47 #include "G4Material.hh" 48 #include "G4RotationMatrix.hh" 49 #include "G4SystemOfUnits.hh" 50 #include "G4ThreeVector.hh" 51 #include "G4VSolid.hh" 52 #include "G4VisAttributes.hh" 53 54 #include <vector> 55 56 // Geant4 Constructive Solid Geometry (CSG) 57 #include "G4Box.hh" // bounding volume 58 #include "G4Cons.hh" // stubby spine, filopodia 59 #include "G4Ellipsoid.hh" // soma compartments 60 #include "G4EllipticalCone.hh" 61 #include "G4EllipticalTube.hh" 62 #include "G4Hype.hh" // thin spine neck 63 #include "G4Orb.hh" // mushroom spine 64 #include "G4Para.hh" 65 #include "G4Polycone.hh" 66 #include "G4Polyhedra.hh" 67 #include "G4Sphere.hh" // soma compartments 68 #include "G4Tet.hh" 69 #include "G4Torus.hh" 70 #include "G4Trap.hh" 71 #include "G4Trd.hh" 72 #include "G4Tubs.hh" // axon, dendrite compartments 73 #include "G4TwistedBox.hh" 74 #include "G4TwistedTrap.hh" 75 #include "G4TwistedTrd.hh" 76 #include "G4TwistedTubs.hh" 77 #include "G4VPVParameterisation.hh" 78 79 // class NeuronLoadMessenger; 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 81 82 class NeuronLoadDataFile 83 84 // default - G4PVPlacement volume 85 // if use G4PVParameterised volume, 86 // please enable following G4VPVParameterisation class! 87 //: public G4VPVParameterisation 88 89 { 90 public: 91 NeuronLoadDataFile(); 92 ~NeuronLoadDataFile() = default; 93 94 void SingleNeuronSWCfile(const G4String& filename); 95 void NeuralNetworkDATAfile(const G4String& filename); 96 97 // position, rotation of solids 98 void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume* physVol) const; 99 100 void ComputeDimensions(G4Tubs& cylinderComp, const G4int copyNo, 101 const G4VPhysicalVolume*) const; 102 G4double GetwidthB() const { return fwidthB; } 103 G4double GetheightB() const { return fheightB; } 104 G4double GetdepthB() const { return fdepthB; } 105 G4double GetdiagnlLength() const { return fdiagnlLength; } 106 G4double GetshiftX() const { return fshiftX; } 107 G4double GetshiftY() const { return fshiftY; } 108 G4double GetshiftZ() const { return fshiftZ; } 109 G4double GetTypeN(G4int i) { return fTypeN[i]; } 110 111 G4int GetnbSomacomp() const { return fnbSomacomp; } 112 G4double GetMassSomacomp(G4int i) const { return fMassSomacomp[i]; } 113 G4double GetMassSomaTot() { return fMassSomaTot; } 114 G4ThreeVector GetPosSomacomp(G4int i) const { return fPosSomacomp[i]; } 115 G4double GetRadSomacomp(G4int i) const { return fRadSomacomp[i]; } 116 117 G4int GetnbDendritecomp() const { return fnbDendritecomp; } 118 G4double GetMassDendcomp(G4int i) const { return fMassDendcomp[i]; } 119 G4double GetMassDendTot() { return fMassDendTot; } 120 G4ThreeVector GetPosDendcomp(G4int i) const { return fPosDendcomp[i]; } 121 G4double GetRadDendcomp(G4int i) const { return fRadDendcomp[i]; } 122 G4double GetHeightDendcomp(G4int i) const { return fHeightDendcomp[i]; } 123 G4double GetDistADendSoma(G4int i) const { return fDistADendSoma[i]; } 124 G4double GetDistBDendSoma(G4int i) const { return fDistBDendSoma[i]; } 125 G4RotationMatrix GetRotDendcomp(G4int i) const { return fRotDendcomp[i]; } 126 127 G4int GetnbAxoncomp() const { return fnbAxoncomp; } 128 G4double GetMassAxoncomp(G4int i) const { return fMassAxoncomp[i]; } 129 G4double GetMassAxonTot() const { return fMassAxonTot; } 130 G4ThreeVector GetPosAxoncomp(G4int i) const { return fPosAxoncomp[i]; } 131 G4double GetRadAxoncomp(G4int i) const { return fRadAxoncomp[i]; } 132 G4double GetHeightAxoncomp(G4int i) const { return fHeightAxoncomp[i]; } 133 G4double GetDistAxonsoma(G4int i) const { return fDistAxonsoma[i]; } 134 G4RotationMatrix GetRotAxoncomp(G4int i) const { return fRotAxoncomp[i]; } 135 136 G4int GetnbSpinecomp() const { return fnbSpinecomp; } 137 G4double GetMassSpinecomp(G4int i) const { return fMassSpinecomp[i]; } 138 G4double GetMassSpineTot() const { return fMassSpineTot; } 139 G4ThreeVector GetPosSpinecomp(G4int i) const { return fPosSpinecomp[i]; } 140 G4double GetRadSpinecomp(G4int i) const { return fRadSpinecomp[i]; } 141 G4double GetHeightSpinecomp(G4int i) const { return fHeightSpinecomp[i]; } 142 G4double GetDistSpinesoma(G4int i) { return fDistSpinesoma[i]; } 143 G4RotationMatrix GetRotSpinecomp(G4int i) const { return fRotSpinecomp[i]; } 144 145 G4int GetnbNeuroncomp() const { return fnbNeuroncomp; } 146 147 G4double GetTotVolNeuron() const { return fTotVolNeuron; } 148 G4double GetTotSurfNeuron() const { return fTotSurfNeuron; } 149 G4double GetTotMassNeuron() const { return fTotMassNeuron; } 150 G4double GetTotVolSlice() const { return fTotVolSlice; } 151 G4double GetTotSurfSlice() const { return fTotSurfSlice; } 152 G4double GetTotMassSlice() const { return fTotMassSlice; } 153 G4double GetTotVolMedium() const { return fTotVolMedium; } 154 G4double GetTotSurfMedium() const { return fTotSurfMedium; } 155 G4double GetTotMassMedium() const { return fTotMassMedium; } 156 157 private: 158 //! NEURON filename 159 G4String fNeuronFileNameSWC; 160 G4String fNeuronFileNameDATA; 161 162 G4int fnbSomacomp{0}; 163 G4int fnbDendritecomp{0}; 164 G4int fnbAxoncomp{0}; 165 G4int fnbSpinecomp{0}; 166 G4int fnbNeuroncomp{0}; 167 168 std::vector<G4int> fTypeN; 169 170 // shift in oder to center VOLUME! 171 G4double fshiftX{0.0}; 172 G4double fshiftY{0.0}; 173 G4double fshiftZ{0.0}; 174 G4double fwidthB{0.0}; 175 G4double fheightB{0.0}; 176 G4double fdepthB{0.0}; 177 G4double fdiagnlLength{0.0}; // diagonal and diameter 178 179 G4double fMassSomaTot{0.0}; 180 G4double fMassDendTot{0.0}; 181 G4double fMassAxonTot{0.0}; 182 G4double fMassSpineTot{0.0}; 183 184 G4double fTotVolNeuron{0.0}; 185 G4double fTotSurfNeuron{0.0}; 186 G4double fTotMassNeuron{0.0}; 187 G4double fTotVolSlice{0.0}; 188 G4double fTotSurfSlice{0.0}; 189 G4double fTotMassSlice{0.0}; 190 G4double fTotVolMedium{0.0}; 191 G4double fTotSurfMedium{0.0}; 192 G4double fTotMassMedium{0.0}; 193 194 std::vector<G4ThreeVector> fPosSomacomp; 195 std::vector<G4double> fRadSomacomp; 196 std::vector<G4double> fMassSomacomp; 197 198 std::vector<G4double> fRadDendcomp; 199 std::vector<G4double> fDistADendSoma; 200 std::vector<G4double> fDistBDendSoma; 201 std::vector<G4double> fHeightDendcomp; 202 std::vector<G4double> fMassDendcomp; 203 std::vector<G4ThreeVector> fPosDendcomp; // VOXEL COORDINATES OF DENDRITES 204 std::vector<G4RotationMatrix> fRotDendcomp; // RotationMatrix with Inverse 205 206 std::vector<G4double> fRadAxoncomp; 207 std::vector<G4double> fHeightAxoncomp; 208 std::vector<G4double> fDistAxonsoma; 209 std::vector<G4double> fMassAxoncomp; 210 std::vector<G4ThreeVector> fPosAxoncomp; // VOXEL COORDINATES OF AXON 211 std::vector<G4RotationMatrix> fRotAxoncomp; 212 213 std::vector<G4double> fRadSpinecomp; 214 std::vector<G4double> fHeightSpinecomp; 215 std::vector<G4double> fDistSpinesoma; 216 std::vector<G4double> fMassSpinecomp; 217 std::vector<G4ThreeVector> fPosSpinecomp; // VOXEL COORDINATES OF SPINE 218 std::vector<G4RotationMatrix> fRotSpinecomp; 219 220 std::vector<G4double> fRadNeuroncomp; 221 std::vector<G4double> fHeightNeuroncomp; 222 std::vector<G4double> fDistNeuronsoma; 223 std::vector<G4double> fMassNeuroncomp; 224 std::vector<G4ThreeVector> fPosNeuroncomp; // VOXEL COORDINATES OF Neuron 225 std::vector<G4RotationMatrix> fRotNeuroncomp; 226 }; 227 228 #endif 229