[Gate-users] Calculating standard error of the mean from multiple files
Simon Rit
simon.rit at creatis.insa-lyon.fr
Tue Feb 3 13:12:09 CET 2015
Hi,
It seems correct to me... If I did not miss something, it is the same as
what's done in Gate (file GateImageWithStatistic.cc, line 346).
Are you sure the images are correctly read in Matlab? Maybe it's a
precision issue? I put our conversation back to the mailing list in case
someone spots something...
Simon
On Tue, Feb 3, 2015 at 11:55 AM, Florian Bretin <fbretin84 at googlemail.com>
wrote:
> Hi Simon,
>
>
>
> Thanks for your answer! The paper did clear up a few things indeed.
>
>
>
> In theory, according to the equation (2), I should be able to reproduce
> the uncertainty per voxel from one simulation provided by GATE, if I have
> the dose and the dose squared from the simulation. However, if I try to
> calculate the uncertainty, I run into complex numbers, because the term
> under the square root is turning negative (squared dose coming from GATE is
> smaller than the mean dose squared).
>
> I am using Matlab to do so:
>
>
>
> uncertainty=sqrt((1/(N-1)).*((dose_squared./N)-((dose./N).*(dose/N))));
>
>
>
> with N being the number of primary events, dose_squared the squared dose
> map from GATE and dose being the dose map from GATE.
>
>
>
>
>
> Or should I just use equation (4) with the uncertainties from the single
> acquisitions and set the weighting to 1?
>
> If that is the case, why don’t they say it like that in the GATE manual.
>
>
>
> If you have any idea where I am making a mistake or whether I should just
> use equation (4), it would be great if you could let me know.
>
>
>
> Thanks & kind regards,
>
> Florian
>
>
>
>
>
> *From:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *On Behalf Of *Simon
> Rit
> *Sent:* 03 February 2015 08:26
> *To:* florian.bretin at ulg.ac.be
> *Subject:* Re: [Gate-users] Calculating standard error of the mean from
> multiple files
>
>
>
> Hi,
> No, N is the number of primary particles. The way you compute the standard
> deviation is given in Chetty's paper
> <http://www.sciencedirect.com/science/article/pii/S0360301606005311>, I
> think it's clearer than in the Gate doc. From equation 2 in the paper, you
> see that you need the sum of the average squared dose per event and the
> average dose per event. I'm not sure but I think that the number of hit is
> not used for this computation, I actually don't know why it's part of the
> DoseActor. The LastHitEventImage is used to know when to square values but
> it's a different image and you don't need it anymore after performing
> several simulations.
> In case you're profficient in bash and you want to have a look, we do have
> a public merge script that does it correctly for the dose:
>
> https://git.creatis.insa-lyon.fr/git/?p=clitk.git;a=blob;f=cluster_tools/gate_power_merge.sh
> The interesting function for you is merge_dispatcher_uncertainty which
> uses command line tools from vv <http://vv.creatis.insa-lyon.fr>.
>
> Simon
>
>
>
> On Fri, Jan 30, 2015 at 11:38 AM, <florian.bretin at ulg.ac.be> wrote:
>
> Dear GATE experts,
>
> I am simulating dose maps from multiple CT acquisitions and I am trying to
> calculate the final standard error of the mean of the summed dose maps.
>
> The GATE manual states regarding this the following:
>
> "The dose/edep squared is used to calculate the uncertainty when the output
> from several files are added. The uncertainty is the relative statistical
> uncertainty. "SquaredDose" flag allows to store the sum of
> squared dose (or energy). It is very useful when using GATE on several
> workstations with numerous jobs. To compute the final
> uncertainty, you only have to sum the dose map and the squared dose map to
> estimate the final uncertainty according to the
> uncertainty equations."
>
> The equations for the calculation of the uncertainty are given on page 98
> of the GATE manual (GATE_v6.2_Complete_Users_Guide.pdf).
>
> Am I correct to assume that N equals the number of hits (I did set the
> flag to collect number of hits!)? My sample variance is already negative,
> since the squared dose values are far lower than values stored in the
> dosemap (all values very small, since only a fraction of real photons are
> simulated!). This leads to complex numbers when I try to calculate the
> standard mean of the error!
>
> It would be much appreciated if somebody could point me in the right
> direction or share his experience!
>
> Cheers,
> Florian
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>
>
>
>
> ------------------------------
> <http://www.avast.com/>
>
> This email is free from viruses and malware because avast! Antivirus
> <http://www.avast.com/> protection is active.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20150203/866fda1e/attachment.html>
More information about the Gate-users
mailing list