[Gate-users] about GateVImageActor:Construct

David Sarrut David.Sarrut at creatis.insa-lyon.fr
Mon Jun 1 11:20:24 CEST 2015


Hello,

exact. However, when the actor is attached to an image (having its hown
size/resolution), there is also a mechanism that automatically set the
actor with the exact same size/resolution than the image (the user can
still specify what he want). Could you test if your proposal also work in
this case ?

thanks,
David

On Thu, May 28, 2015 at 6:26 PM, Alex Vergara Gil <alexvergaragil at gmail.com>
wrote:

> 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
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>



-- 
David Sarrut, Phd
Directeur de recherche CNRS
CREATIS, UMR CNRS 5220, Inserm U 1044
Centre de lutte contre le cancer Léon Bérard
28 rue Laënnec, 69373 Lyon cedex 08
Tel : 04 78 78 51 51 / 06 74 72 05 42
http://www.creatis.insa-lyon.fr/~dsarrut
_________________________________
 "2 + 2 = 5,  for extremely large values of 2"
_________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20150601/f430354b/attachment-0001.html>


More information about the Gate-users mailing list