[Gate-users] about GateVImageActor:Construct

Alex Vergara Gil alexvergaragil at gmail.com
Thu May 28 18:26:12 CEST 2015


Dear Devs

I am writting here because I have no access to gate-devel list.

In the file GateVImageActor in the void GateVImageActor::Construct()
you expect for the user to declare the size of the output matrix
(let's call it S), and the the user has to choose between resolution
(R) OR voxelSize (VS), being S = R * VS. This is an annoying behavior
for the user because you may know VS and R, and then you must multiply
to put in the actor the Size. So why not using any possible
combination? Solution is easy to implement.

Details

void GateVImageActor::Construct()
...
if (!mHalfSizeIsSet){
    mHalfSize = ComputeBoundingBox(mVolume->GetLogicalVolume()->GetSolid());
  }
  if (mResolutionIsSet && mVoxelSizeIsSet) {
    GateError("GateVImageActor -- Construct: Please give the
resolution OR the voxelsize (not both) for the sensor");
  }
  if (!mResolutionIsSet && !mVoxelSizeIsSet) {
    mResolution = G4ThreeVector(1.0, 1.0, 1.0);
    mResolutionIsSet = true;
  }

Can be replaced by

  if (!mHalfSizeIsSet){
	  if (mResolutionIsSet && mVoxelSizeIsSet){
		  mHalfSize = KroneckerProduct(mResolution, mVoxelSize);
	  }
	  else {
		  mHalfSize = ComputeBoundingBox(mVolume->GetLogicalVolume()->GetSolid());
	  }
  }
  else {
	  if (mResolutionIsSet && mVoxelSizeIsSet) {
		  GateError("GateVImageActor -- Construct: Please give a combination
of two between" <<
				    " the size, the resolution and the voxelsize (not all) for the sensor");
	  }
  }
  if (!mResolutionIsSet && !mVoxelSizeIsSet) {
    mResolution = G4ThreeVector(1.0, 1.0, 1.0);
    mResolutionIsSet = true;
  }

So now any combination of two of this variables lead to a valid Image Actor

Regards
Alex


More information about the Gate-users mailing list