README for observer_tools
software
The package observer_tools
is intended for analysis and reconstruction of probe data. The package is pretty disorganized in its current versions as it was heavily modified to suit particular goals that came about during reconstruction.
The package consists of three modules:
observer
module. This module contains routines for processing of probe data measurements. Since some routines share conventions (like shape of the data), reconstruction uses some of the files directly. Historically,observer_tools
andobserver
were a shared resource, do the division is not really solid.parseCommandLine
module. This is a service for parsing configuration files and settings therein. A dedicated routines were used for parsing command line options only, but it evolved to a general parsing program for settings files. Used heavily to manage reconstruction constants, geometry settings and the like both inobserver
as well asobserver_tools
.observer_tools
module. It has aflood
,parse_si
andcoinc
directory. Theflood
directory allows calibration and characterization of BGO part,parse_si
is for silicon part (including gain calibration and energy resolution studies). Thecoinc
directory is for coincidence data matching, reconstruction, system matrix construction, SNR evaluation and whatnot. A total of hundred files with as much as 1000 rows per some of the busiest implementation files, it is a mixture of core routines and evaluation scripts. Often, transitory pieces of code get ascript_
prefix which, if useful, migrate to non-script_
prepended core files. The tools are intended to be used as root libraries and are loaded on start, but they can be used in standalone programs as well.
INSTALLation
Start in a fresh folder. Whatever you call it, I will call it SFHOME (for software home).
Download neccesary files:
> cd SFHOME
> git clone http://www-f9.ijs.si/~studen/git/parseCommandLine.git
> git clone http://www-f9.ijs.si/~studen/git/observer.git
> git clone http://www-f9.ijs.si/~studen/git/observer_tools.git
> git clone git://git.code.sf.net/p/daqpp/vmedaq
Parse command line
> cd SFHOME/parseCommandLine
> make
#there is no make install
Observer
It is not scrictly necessary to make the binaries, but potentially useful.
> cd SFHOME/observer
> cp env.sh.template env.sh
Edit env.sh
so it points to correct location of required:
- GNU scientific library (GSL),
- parseCommandLine (
PCL=SFHOME/parseCommandLine
) - root installations (ROOTCORE).
- Downloaded observer tools
(
OBSERVERTOOLSBASE=SFHOME/observer_tools
) - VMEDAQ (
VMEDAQBASE=SFHOME/vmedaq
)
A sample env.sh.template looks like this:
PCL=/afs/f9.ijs.si/home/studen/software/build/parseCommandLine
ROOTCORE=/data0/studen/software/install/root
#a good guess is #>basename `which root`
GSL=/usr
#for make_links.sh
OBSERVERTOOLSBASE=/afs/f9.ijs.si/home/studen/software/build/observer_tools
VMEDAQBASE=/afs/f9.ijs.si/home/studen/software/build/vmedaq
To install, set the variables and compile
>bash
>. env.sh
>make
Report any failure.
Observer tools
>cd observer_tools
>cd coinc/root_scripts
>cp env.sh.template env.sh
Correct env.sh
so that:
- PCL points to parseCommandLine installation
(
PCL=SFHOME/parseCommandLine
) - OBSERVERBASE points to observer installation
(
OBSERVER=SFHOME/observer
) - VMEDAQBASE points to VMEDAQ installation
(
VMEDAQBASE=SFHOME/vmedaq
)
A sample env.sh.template points to a sample environment file.
Continue with the setup. A couple of links need to be set up to include files from other projects
>bash
>. env.sh
>./rm_links.sh
>./make_links.sh
Now you can start root. When you do, the routines will get compiled to be ready to use. First start takes a while.
>root
USE of software
Make a configuration/study directory. Call if whatever, I'll call it
IMGREC. Make two additional directories, IMGREC/layout
and
IMGREC/studies
.
Copy layouts (setup0.zip,setup2.zip) to layout directory, and unzip them.
Copy studies (setup_um.zip,setup2_um.zip) to studies
directory, and unzip them.
Copy phantoms (phantoms.zip) to IMGREC directory, and unzip them.
There are paths, which are incorrect in some of the files. You should
edit IMGREC/layout/setup0/setup1000.in
. The variables setupPath
and studyPath
should be adjusted for new location:
setupPath_2=IMGREC/layout/setup0
studyPath_2=IMGREC/studies/setup_um
Similarly in IMGREC/layout/setup2/setup2000.in
. For processing
(running routines in observer), you
should also update the calibration files, more on that in
calibration entry.
Also, in setup_um/setup_um_study.in
, you should probably correct all
paths. A valid file would look like this:
setup=IMGREC/layout/setup0/setup1000.in
phantom=IMGREC/phantoms/phantom_0_rw_0p3_bkg_0p01.out
nCoinc=3
coincFlag_0=0xf
sinogram_0=IMGREC/studies/setup_um/sinogram_0_f.out
sensitivity_0=IMGREC/studies/setup_um/sensitivity_0_f.out
coincFlag_1=0xf0
sinogram_1=IMGREC/studies/setup_um/sinogram_0_f0.out
sensitivity_1=IMGREC/studies/setup_um/sensitivity_0_f0.out
coincFlag_2=0x100
dataImport_2=IMGREC/studies/setup_um/dataImport_0x100.in
sinogram_2=IMGREC/studies/setup_um/sinogram_0_100.out
sensitivity_2=IMGREC/studies/setup_um/sensitivity_0_100.out
sinoMatrix_2=IMGREC/studies/setup_um/sinoMatrix_0x100.in
forwardMatrix_2=IMGREC/studies/setup_um/forwardMatrix_0x100.in
You should probably be able to do the same for the
setup2_um_study.in
from the setup2_um
directory.
Now you should already have some files to play with. For example, you could reconstruct the BGO-BGO data. To do that, do:
>cd SFHOME/observer_tools/coinc/root_scripts
>root
root[] DataSinoStorage ds
root[] ds.ImportStudy("IMGREC/studies/setup_um/setup_um_study.in");
root[] sinogramData s;
root[] ds.makeSinogram(&s,0x100);#0x100 is for BGO-BGO
root[] s.getSinogram()->Draw("COLZ") #should give you a funny sinogram
with very few lines filled
root[] ds.SetSensMatrix(&s);
root[] Reconstructor rec;
root[] rec.addSinogram(&s);
root[] rec.FBP();
root[] TH2D h2;
root[] rec.getSData()->getImage()->Copy(h2);
root[] h2.Draw("COLZ");#should give you filter-back-projection
reconstruction