Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 08:29:06

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