<div dir="ltr">Hello, <div><br></div><div>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 ? </div><div><br></div><div>thanks, <br>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 28, 2015 at 6:26 PM, Alex Vergara Gil <span dir="ltr"><<a href="mailto:alexvergaragil@gmail.com" target="_blank">alexvergaragil@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Devs<br>
<br>
I am writting here because I have no access to gate-devel list.<br>
<br>
In the file GateVImageActor in the void GateVImageActor::Construct()<br>
you expect for the user to declare the size of the output matrix<br>
(let's call it S), and the the user has to choose between resolution<br>
(R) OR voxelSize (VS), being S = R * VS. This is an annoying behavior<br>
for the user because you may know VS and R, and then you must multiply<br>
to put in the actor the Size. So why not using any possible<br>
combination? Solution is easy to implement.<br>
<br>
Details<br>
<br>
void GateVImageActor::Construct()<br>
...<br>
if (!mHalfSizeIsSet){<br>
mHalfSize = ComputeBoundingBox(mVolume->GetLogicalVolume()->GetSolid());<br>
}<br>
if (mResolutionIsSet && mVoxelSizeIsSet) {<br>
GateError("GateVImageActor -- Construct: Please give the<br>
resolution OR the voxelsize (not both) for the sensor");<br>
}<br>
if (!mResolutionIsSet && !mVoxelSizeIsSet) {<br>
mResolution = G4ThreeVector(1.0, 1.0, 1.0);<br>
mResolutionIsSet = true;<br>
}<br>
<br>
Can be replaced by<br>
<br>
if (!mHalfSizeIsSet){<br>
if (mResolutionIsSet && mVoxelSizeIsSet){<br>
mHalfSize = KroneckerProduct(mResolution, mVoxelSize);<br>
}<br>
else {<br>
mHalfSize = ComputeBoundingBox(mVolume->GetLogicalVolume()->GetSolid());<br>
}<br>
}<br>
else {<br>
if (mResolutionIsSet && mVoxelSizeIsSet) {<br>
GateError("GateVImageActor -- Construct: Please give a combination<br>
of two between" <<<br>
" the size, the resolution and the voxelsize (not all) for the sensor");<br>
}<br>
}<br>
if (!mResolutionIsSet && !mVoxelSizeIsSet) {<br>
mResolution = G4ThreeVector(1.0, 1.0, 1.0);<br>
mResolutionIsSet = true;<br>
}<br>
<br>
So now any combination of two of this variables lead to a valid Image Actor<br>
<br>
Regards<br>
Alex<br>
_______________________________________________<br>
Gate-users mailing list<br>
<a href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a><br>
<a href="http://lists.opengatecollaboration.org/mailman/listinfo/gate-users" target="_blank">http://lists.opengatecollaboration.org/mailman/listinfo/gate-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">David Sarrut, Phd<br>Directeur de recherche CNRS<br>CREATIS, UMR CNRS 5220, Inserm U 1044<div>Centre de lutte contre le cancer Léon Bérard<br>28 rue Laënnec, 69373 Lyon cedex 08<br>Tel : 04 78 78 51 51 / 06 74 72 05 42<br><a href="http://www.creatis.insa-lyon.fr/~dsarrut" target="_blank">http://www.creatis.insa-lyon.fr/~dsarrut</a><br>_________________________________</div><div> "2 + 2 = 5, for extremely large values of 2"<br>_________________________________</div></div></div>
</div>