Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dsarrut authored Aug 22, 2017
2 parents c308142 + 34b51e2 commit 5142cbf
Show file tree
Hide file tree
Showing 17 changed files with 671 additions and 809 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ ENDIF()
#=========================================================
# Add the executable, and link it to the Geant4/ROOT/CLHEP/ITK libraries
IF(GATE_USE_GPU AND CUDA_FOUND)
SET(CUDA_NVCC_FLAGS "-gencode arch=compute_20,code=sm_20;-gencode arch=compute_21,code=sm_21;-gencode arch=compute_30,code=sm_30;-gencode arch=compute_32,code=sm_32;-gencode arch=compute_35,code=sm_35;-gencode arch=compute_37,code=sm_37;-gencode arch=compute_50,code=sm_50;-gencode arch=compute_52,code=sm_52;-gencode arch=compute_53,code=sm_53;-gencode arch=compute_60,code=sm_60;-gencode arch=compute_61,code=sm_61;-use_fast_math;-w;--ptxas-options=-v")
SET(CUDA_NVCC_FLAGS "-gencode arch=compute_20,code=sm_20;-gencode arch=compute_20,code=sm_21;-gencode arch=compute_30,code=sm_30;-gencode arch=compute_32,code=sm_32;-gencode arch=compute_35,code=sm_35;-gencode arch=compute_37,code=sm_37;-gencode arch=compute_50,code=sm_50;-gencode arch=compute_52,code=sm_52;-gencode arch=compute_53,code=sm_53;-gencode arch=compute_60,code=sm_60;-gencode arch=compute_61,code=sm_61;-use_fast_math;-w;--ptxas-options=-v")
CUDA_ADD_EXECUTABLE(Gate Gate.cc ${sources} ${sourcesGPU} ${headers})
ELSE(GATE_USE_GPU AND CUDA_FOUND)
ADD_EXECUTABLE(Gate Gate.cc ${sources} ${headers})
Expand Down
2 changes: 1 addition & 1 deletion cluster_tools/jobsplitter/src/GateMacfileParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void GateMacfileParser::InsertAliases()
nAliases = (G4int)(listOfAliases.size());
for (G4int i=1;i<nAliases;i+=2)
{
if (macline.contains("{"+listOfAliases[i]+"}"))
while (macline.contains("{"+aliases[i]+"}"))
{
insert=listOfAliases[i-1];
G4int position=macline.find("{"+listOfAliases[i]+"}",0);
Expand Down
34 changes: 23 additions & 11 deletions source/digits_hits/include/GateDoseActor.hh
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/*----------------------
Copyright (C): OpenGATE Collaboration
Copyright (C): OpenGATE Collaboration
This software is distributed under the terms
of the GNU Lesser General Public Licence (LGPL)
See GATE/LICENSE.txt for further details
----------------------*/
This software is distributed under the terms
of the GNU Lesser General Public Licence (LGPL)
See GATE/LICENSE.txt for further details
----------------------*/


/*!
\class GateDoseActor
\author thibault.frisson@creatis.insa-lyon.fr
laurent.guigues@creatis.insa-lyon.fr
david.sarrut@creatis.insa-lyon.fr
laurent.guigues@creatis.insa-lyon.fr
david.sarrut@creatis.insa-lyon.fr
\date March 2011
- DoseToWater option added by Loïc Grevillot
- Dose calculation in inhomogeneous volume added by Thomas Deschler (thomas.deschler@iphc.cnrs.fr)
*/
- DoseToWater option added by Loïc Grevillot
- Dose calculation in inhomogeneous volume added by Thomas Deschler (thomas.deschler@iphc.cnrs.fr)
*/


#ifndef GATEDOSEACTOR_HH
Expand All @@ -30,12 +30,13 @@ See GATE/LICENSE.txt for further details
#include "GateDoseActorMessenger.hh"
#include "GateImageWithStatistic.hh"
#include "GateVoxelizedMass.hh"
#include "GateRegionDoseStat.hh"

class G4EmCalculator;

class GateDoseActor : public GateVImageActor
{
public:
public:

//-----------------------------------------------------------------------------
// Actor name
Expand Down Expand Up @@ -67,6 +68,11 @@ class GateDoseActor : public GateVImageActor
void VolumeFilter(G4String b) { mVolumeFilter = b; }
void MaterialFilter(G4String b) { mMaterialFilter = b; }

void SetDoseByRegionsInputFilename(std::string f);
void SetDoseByRegionsOutputFilename(std::string f);

void SetOutputScalingFactor(double s);

virtual void BeginOfRunAction(const G4Run*r);
virtual void BeginOfEventAction(const G4Event * event);

Expand Down Expand Up @@ -104,13 +110,17 @@ protected:
bool mIsDoseNormalisationEnabled;
bool mIsDoseToWaterNormalisationEnabled;
bool mDose2WaterWarningFlag;
bool mDoseByRegionsFlag;

GateImageWithStatistic mEdepImage;
GateImageWithStatistic mDoseImage;
GateImageWithStatistic mDoseToWaterImage;
GateImageInt mNumberOfHitsImage;
GateImageInt mLastHitEventImage;
GateImageDouble mMassImage;
GateImageFloat mDoseByRegionsLabelImage;
std::map<int, GateRegionDoseStat> mMapOfRegionStat;
double mScalingFactor;

G4String mEdepFilename;
G4String mDoseFilename;
Expand All @@ -119,6 +129,8 @@ protected:
G4String mDoseAlgorithmType;
G4String mImportMassImage;
G4String mExportMassImage;
G4String mDoseByRegionsInputFilename;
G4String mDoseByRegionsOutputFilename;

G4String mVolumeFilter;
G4String mMaterialFilter;
Expand Down
23 changes: 16 additions & 7 deletions source/digits_hits/include/GateDoseActorMessenger.hh
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
/*----------------------
Copyright (C): OpenGATE Collaboration
Copyright (C): OpenGATE Collaboration
This software is distributed under the terms
of the GNU Lesser General Public Licence (LGPL)
See GATE/LICENSE.txt for further details
----------------------*/
This software is distributed under the terms
of the GNU Lesser General Public Licence (LGPL)
See GATE/LICENSE.txt for further details
----------------------*/

/*
\class GateDoseActorMessenger
\author thibault.frisson@creatis.insa-lyon.fr
laurent.guigues@creatis.insa-lyon.fr
david.sarrut@creatis.insa-lyon.fr
laurent.guigues@creatis.insa-lyon.fr
david.sarrut@creatis.insa-lyon.fr
*/

#ifndef GATEDOSEACTORMESSENGER_HH
#define GATEDOSEACTORMESSENGER_HH

// g4
#include "G4UIcmdWithABool.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADouble.hh"

// gate
#include "GateImageActorMessenger.hh"

class GateDoseActor;
Expand Down Expand Up @@ -52,6 +56,11 @@ protected:

G4UIcmdWithAString * pVolumeFilterCmd;
G4UIcmdWithAString * pMaterialFilterCmd;

G4UIcmdWithAString * pDoseRegionInputCmd;
G4UIcmdWithAString * pDoseRegionOutputCmd;

G4UIcmdWithADouble * pScaleOutputCmd;
};

#endif /* end #define GATEDOSEACTORMESSENGER_HH*/
40 changes: 40 additions & 0 deletions source/digits_hits/include/GateRegionDoseStat.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*----------------------
Copyright (C): OpenGATE Collaboration
This software is distributed under the terms
of the GNU Lesser General Public Licence (LGPL)
See GATE/LICENSE.txt for further details
----------------------*/

#ifndef GATEREGIONDOSESTAT_HH
#define GATEREGIONDOSESTAT_HH

#include "GateMiscFunctions.hh"
#include "GateImage.hh"

//-----------------------------------------------------------------------------
class GateRegionDoseStat {

public:

GateRegionDoseStat();
std::string ToString();
void Update(long event_id, double edep, double density);

static void ComputeRegionVolumes(GateImageFloat & image,
std::map<int, GateRegionDoseStat> & mMapOfRegionStat);

double sum_edep;
double sum_squared_edep;
double sum_temp_edep;
double sum_dose;
double sum_squared_dose;
double sum_temp_dose;
double volume;
long last_event_id;
long nb_hits;
long nb_event_hits;
};
//-----------------------------------------------------------------------------

#endif /* end #define GATEREGIONDOSESTAT_HH */
Loading

0 comments on commit 5142cbf

Please sign in to comment.