[Gate-users] Re: Gate-users Digest, Vol 13, Issue 2
ben.mcdonald at vanderbilt.edu
Sun Jun 3 21:58:51 CEST 2007
Dear GATE Community,
I've noticed that interfile output for SPECT simulations are not
affected by spatial blurring, unlike Root and ASCII output. It looks
like event positions are written to the interfile output before being
blurred. Could anyone suggest a place to start looking if I wanted to
modify the GATE code so it outputs to the interfile after spatial blurring?
I know that the spatial blurring was originally setup for detectors in
the XY plane, and that is not the problem here.
Thanks for any advice,
gate-users-request at lists.healthgrid.org wrote:
> Send Gate-users mailing list submissions to
> gate-users at lists.healthgrid.org
> To subscribe or unsubscribe via the World Wide Web, visit
> or, via email, send a message with subject or body 'help' to
> gate-users-request at lists.healthgrid.org
> You can reach the person managing the list at
> gate-users-owner at lists.healthgrid.org
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gate-users digest..."
> Today's Topics:
> 1. Re: Output (D.J. van der Laan)
> 2. Re: benchmark (Maria Holstensson)
> Message: 1
> Date: Fri, 01 Jun 2007 15:06:03 +0200
> From: "D.J. van der Laan" <d.j.vanderlaan at tnw.tudelft.nl>
> Subject: Re: [Gate-users] Output
> To: Daniel Woodsworth <danieljw at phas.ubc.ca>,
> gate-users at lists.healthgrid.org
> Message-ID: <466019BB.4030206 at tnw.tudelft.nl>
> Content-Type: text/plain; charset=ISO-8859-1
> Hi Daniel,
> Daniel Woodsworth wrote:
>> I am wondering what the best way is to output data from GATE simulations.
>> I am doing SPECT simulations, so for creating projections, I have been
>> using the Interfile output, which works really well.
>> However, for data analysis and processing and numerical calculations,
>> obviously it is good to have all the information about order of scatter,
>> last object in which scatter occurred etc. etc. This (as far as I can
>> tell) is not included in an interfile. So it seems that for this data I
>> should use root and/or ascii output (are there any other general purpose
>> outputs? is it possible to write directly to binary files?).
> It is not possible to write binary files from Gate (except ROOT files
> then). It is however not difficult to ad this to Gate, but this would
> involve recompiling Gate.
>> In the Output
>> section of the GATE manual it says that the root files are smaller and
>> contain all of the same information that is in the ascii format. I have 2
>> questions about this. First, upon running the SPECT benchmark, the
>> benchSPECT.root file is 61 MB, while the ascii gateSingles.dat is 6.3 MB.
>> How does this relate to the root files being smaller? Does this become
>> true for larger data output files?
> First of all, I am not an expert on root, so if anybody else knows
> better please feel free to correct me.
> I dont't know what causes the differences in file size. Perhaps more
> information is stored in the root file (hits?)?
>> Second, when I load up the root file:
>> home> root benchSPECT.root
>> root 
>> Attaching file benchSPECT.root as _file0...
>> root  TBrowser t
>> I only find already processed data, presented as histograms and whatnot.
>> Can anyone tell me where to find the raw data, as in the ascii output?
>> Since it is compressed, I assume it isn't some form of directly readable
>> file. Is it binary? What I am asking for is which file do I use for raw
>> input data if I were to write ROOT analysis scripts, and in what format is
>> the data written to this file?
> All data is present in file, the browser only shows 'summaries' of this
> data. The data is stores in trees. I this it is easiest if you have a
> look at the root files that come with the benchmarks, to see how you can
> acces the data. There is also a lot of documentation on the ROOT website
> Here is a simple example how you can access the energies of all the
> singles. (In this case all of the energies are summed.):
> // open the file
> TFile f("gate.root");
> // open the singles directory
> TTree *singles = (TTree*)gDirectory->Get("Singles");
> // 'connect' the energy veriable to the energy branch of the singles
> // Now when the GetEntry(int) method of the singles is called the
> // energy belonging to the single can be found in the variable energy
> Float_t energy;
> singles->SetBranchAddress("energy", &energy);
> // loop throough all singles and sum the energies
> Int_t nsingles = singles->GetEntries();
> Float_t totalenergy = 0;
> for (Int_t i = 0; i < nsingles; i++)
> totalenergy += energy;
> cout << "Total energy: " << totalenergy << endl;
>> Finally is it recommended to do analysis using 'homemade' (ie. C or C++)
>> programs analyzing the ascii output? Or rather using ROOT scripts for the
>> root file?
> In our group we use Matlab for all data processing. So we use the ASCII
> output and process that with Matlab, or sometimes we preprocess it with
> routines written in C/C++. That works fine.
> The only problem with ASCII can be the file sizes. I don't know if it is
> still a problem if the size exceeds 2 GB. However in these cases it is
> also possible to process the data while Gate is running using a fifo.
>> Thanks for the help.
>> Gate-users mailing list
>> Gate-users at lists.healthgrid.org
More information about the Gate-users