Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:03

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // and papers
0031 // M. Batmunkh et al. J Radiat Res Appl Sci 8 (2015) 498-507
0032 // O. Belov et al. Physica Medica 32 (2016) 1510-1520
0033 // The Geant4-DNA web site is available at http://geant4-dna.org
0034 //
0035 // -------------------------------------------------------------------
0036 // November 2016
0037 // -------------------------------------------------------------------
0038 //
0039 //
0040 /// \file NeuronLoadDataFile.hh
0041 /// \brief Implementation of the NeuronLoadDataFile class
0042 
0043 #ifndef NeuronLoadDataFile_H
0044 #define NeuronLoadDataFile_H 1
0045 
0046 #include "G4Colour.hh"
0047 #include "G4Material.hh"
0048 #include "G4RotationMatrix.hh"
0049 #include "G4SystemOfUnits.hh"
0050 #include "G4ThreeVector.hh"
0051 #include "G4VSolid.hh"
0052 #include "G4VisAttributes.hh"
0053 
0054 #include <vector>
0055 
0056 // Geant4 Constructive Solid Geometry (CSG)
0057 #include "G4Box.hh"  // bounding volume
0058 #include "G4Cons.hh"  // stubby spine, filopodia
0059 #include "G4Ellipsoid.hh"  // soma compartments
0060 #include "G4EllipticalCone.hh"
0061 #include "G4EllipticalTube.hh"
0062 #include "G4Hype.hh"  // thin spine neck
0063 #include "G4Orb.hh"  // mushroom spine
0064 #include "G4Para.hh"
0065 #include "G4Polycone.hh"
0066 #include "G4Polyhedra.hh"
0067 #include "G4Sphere.hh"  // soma compartments
0068 #include "G4Tet.hh"
0069 #include "G4Torus.hh"
0070 #include "G4Trap.hh"
0071 #include "G4Trd.hh"
0072 #include "G4Tubs.hh"  // axon, dendrite compartments
0073 #include "G4TwistedBox.hh"
0074 #include "G4TwistedTrap.hh"
0075 #include "G4TwistedTrd.hh"
0076 #include "G4TwistedTubs.hh"
0077 #include "G4VPVParameterisation.hh"
0078 
0079 // class NeuronLoadMessenger;
0080 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0081 
0082 class NeuronLoadDataFile
0083 
0084 // default - G4PVPlacement volume
0085 // if use G4PVParameterised volume,
0086 // please enable following G4VPVParameterisation class!
0087 //: public G4VPVParameterisation
0088 
0089 {
0090   public:
0091     NeuronLoadDataFile();
0092     ~NeuronLoadDataFile() = default;
0093 
0094     void SingleNeuronSWCfile(const G4String& filename);
0095     void NeuralNetworkDATAfile(const G4String& filename);
0096 
0097     // position, rotation of solids
0098     void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume* physVol) const;
0099 
0100     void ComputeDimensions(G4Tubs& cylinderComp, const G4int copyNo,
0101                            const G4VPhysicalVolume*) const;
0102     G4double GetwidthB() const { return fwidthB; }
0103     G4double GetheightB() const { return fheightB; }
0104     G4double GetdepthB() const { return fdepthB; }
0105     G4double GetdiagnlLength() const { return fdiagnlLength; }
0106     G4double GetshiftX() const { return fshiftX; }
0107     G4double GetshiftY() const { return fshiftY; }
0108     G4double GetshiftZ() const { return fshiftZ; }
0109     G4double GetTypeN(G4int i) { return fTypeN[i]; }
0110 
0111     G4int GetnbSomacomp() const { return fnbSomacomp; }
0112     G4double GetMassSomacomp(G4int i) const { return fMassSomacomp[i]; }
0113     G4double GetMassSomaTot() { return fMassSomaTot; }
0114     G4ThreeVector GetPosSomacomp(G4int i) const { return fPosSomacomp[i]; }
0115     G4double GetRadSomacomp(G4int i) const { return fRadSomacomp[i]; }
0116 
0117     G4int GetnbDendritecomp() const { return fnbDendritecomp; }
0118     G4double GetMassDendcomp(G4int i) const { return fMassDendcomp[i]; }
0119     G4double GetMassDendTot() { return fMassDendTot; }
0120     G4ThreeVector GetPosDendcomp(G4int i) const { return fPosDendcomp[i]; }
0121     G4double GetRadDendcomp(G4int i) const { return fRadDendcomp[i]; }
0122     G4double GetHeightDendcomp(G4int i) const { return fHeightDendcomp[i]; }
0123     G4double GetDistADendSoma(G4int i) const { return fDistADendSoma[i]; }
0124     G4double GetDistBDendSoma(G4int i) const { return fDistBDendSoma[i]; }
0125     G4RotationMatrix GetRotDendcomp(G4int i) const { return fRotDendcomp[i]; }
0126 
0127     G4int GetnbAxoncomp() const { return fnbAxoncomp; }
0128     G4double GetMassAxoncomp(G4int i) const { return fMassAxoncomp[i]; }
0129     G4double GetMassAxonTot() const { return fMassAxonTot; }
0130     G4ThreeVector GetPosAxoncomp(G4int i) const { return fPosAxoncomp[i]; }
0131     G4double GetRadAxoncomp(G4int i) const { return fRadAxoncomp[i]; }
0132     G4double GetHeightAxoncomp(G4int i) const { return fHeightAxoncomp[i]; }
0133     G4double GetDistAxonsoma(G4int i) const { return fDistAxonsoma[i]; }
0134     G4RotationMatrix GetRotAxoncomp(G4int i) const { return fRotAxoncomp[i]; }
0135 
0136     G4int GetnbSpinecomp() const { return fnbSpinecomp; }
0137     G4double GetMassSpinecomp(G4int i) const { return fMassSpinecomp[i]; }
0138     G4double GetMassSpineTot() const { return fMassSpineTot; }
0139     G4ThreeVector GetPosSpinecomp(G4int i) const { return fPosSpinecomp[i]; }
0140     G4double GetRadSpinecomp(G4int i) const { return fRadSpinecomp[i]; }
0141     G4double GetHeightSpinecomp(G4int i) const { return fHeightSpinecomp[i]; }
0142     G4double GetDistSpinesoma(G4int i) { return fDistSpinesoma[i]; }
0143     G4RotationMatrix GetRotSpinecomp(G4int i) const { return fRotSpinecomp[i]; }
0144 
0145     G4int GetnbNeuroncomp() const { return fnbNeuroncomp; }
0146 
0147     G4double GetTotVolNeuron() const { return fTotVolNeuron; }
0148     G4double GetTotSurfNeuron() const { return fTotSurfNeuron; }
0149     G4double GetTotMassNeuron() const { return fTotMassNeuron; }
0150     G4double GetTotVolSlice() const { return fTotVolSlice; }
0151     G4double GetTotSurfSlice() const { return fTotSurfSlice; }
0152     G4double GetTotMassSlice() const { return fTotMassSlice; }
0153     G4double GetTotVolMedium() const { return fTotVolMedium; }
0154     G4double GetTotSurfMedium() const { return fTotSurfMedium; }
0155     G4double GetTotMassMedium() const { return fTotMassMedium; }
0156 
0157   private:
0158     //! NEURON filename
0159     G4String fNeuronFileNameSWC;
0160     G4String fNeuronFileNameDATA;
0161 
0162     G4int fnbSomacomp{0};
0163     G4int fnbDendritecomp{0};
0164     G4int fnbAxoncomp{0};
0165     G4int fnbSpinecomp{0};
0166     G4int fnbNeuroncomp{0};
0167 
0168     std::vector<G4int> fTypeN;
0169 
0170     // shift in oder to center VOLUME!
0171     G4double fshiftX{0.0};
0172     G4double fshiftY{0.0};
0173     G4double fshiftZ{0.0};
0174     G4double fwidthB{0.0};
0175     G4double fheightB{0.0};
0176     G4double fdepthB{0.0};
0177     G4double fdiagnlLength{0.0};  // diagonal and diameter
0178 
0179     G4double fMassSomaTot{0.0};
0180     G4double fMassDendTot{0.0};
0181     G4double fMassAxonTot{0.0};
0182     G4double fMassSpineTot{0.0};
0183 
0184     G4double fTotVolNeuron{0.0};
0185     G4double fTotSurfNeuron{0.0};
0186     G4double fTotMassNeuron{0.0};
0187     G4double fTotVolSlice{0.0};
0188     G4double fTotSurfSlice{0.0};
0189     G4double fTotMassSlice{0.0};
0190     G4double fTotVolMedium{0.0};
0191     G4double fTotSurfMedium{0.0};
0192     G4double fTotMassMedium{0.0};
0193 
0194     std::vector<G4ThreeVector> fPosSomacomp;
0195     std::vector<G4double> fRadSomacomp;
0196     std::vector<G4double> fMassSomacomp;
0197 
0198     std::vector<G4double> fRadDendcomp;
0199     std::vector<G4double> fDistADendSoma;
0200     std::vector<G4double> fDistBDendSoma;
0201     std::vector<G4double> fHeightDendcomp;
0202     std::vector<G4double> fMassDendcomp;
0203     std::vector<G4ThreeVector> fPosDendcomp;  // VOXEL COORDINATES OF DENDRITES
0204     std::vector<G4RotationMatrix> fRotDendcomp;  // RotationMatrix with Inverse
0205 
0206     std::vector<G4double> fRadAxoncomp;
0207     std::vector<G4double> fHeightAxoncomp;
0208     std::vector<G4double> fDistAxonsoma;
0209     std::vector<G4double> fMassAxoncomp;
0210     std::vector<G4ThreeVector> fPosAxoncomp;  // VOXEL COORDINATES OF AXON
0211     std::vector<G4RotationMatrix> fRotAxoncomp;
0212 
0213     std::vector<G4double> fRadSpinecomp;
0214     std::vector<G4double> fHeightSpinecomp;
0215     std::vector<G4double> fDistSpinesoma;
0216     std::vector<G4double> fMassSpinecomp;
0217     std::vector<G4ThreeVector> fPosSpinecomp;  // VOXEL COORDINATES OF SPINE
0218     std::vector<G4RotationMatrix> fRotSpinecomp;
0219 
0220     std::vector<G4double> fRadNeuroncomp;
0221     std::vector<G4double> fHeightNeuroncomp;
0222     std::vector<G4double> fDistNeuronsoma;
0223     std::vector<G4double> fMassNeuroncomp;
0224     std::vector<G4ThreeVector> fPosNeuroncomp;  // VOXEL COORDINATES OF Neuron
0225     std::vector<G4RotationMatrix> fRotNeuroncomp;
0226 };
0227 
0228 #endif