[Gate-users] benchmark_projection.c

Seyjoon seyjoon at yahoo.co.kr
Sat Nov 24 10:21:45 CET 2007

Hi gate-users

I doubt I found some errors of C code of benchmark_projection.
I tried to do Scatter Analysis with benchmark_projection.c
But it always shows abnormal count. For example, like below.

Number of detected events in the image of primary and scattered photons = 20945
Number of primary events in the image of primary photons =13976
Number of scattered events in the image of scattered photons = 969

As you can see, Primary counts and Scatter counts are not equal to Total counts.
I guessed there was some problems in line number 586 and 591.

----------------Line number 586 and 591 in benchmark_projection.c---------------
     if(caractere1=='N' && caractere2=='U' &&  caractere3=='L' && caractere4=='L' && CrystalOrder==0)
     if((caractere1!='N' && caractere2!='U' &&  caractere3!='L' && caractere4!='L') || (caractere1=='N' && caractere2=='U' && caractere3=='L' && caractere4=='L' && CrystalOrder>0))

I found 'CrystalOrder' which is column 19 in gateSingles.dat was unmatched
for scatter analysis. So I changed them to 'Order' which is column 18 in 
gateSingles.dat and modified a little like below.

---------Line number 557 and 562 in benchmark_projection_seyjoon.c-----------------------
     if(caractere1=='N' && caractere2=='U' &&  caractere3=='L' && caractere4=='L' && Order==0)
     if((caractere1!='N' && caractere2!='U' &&  caractere3!='L' && caractere4!='L') || Order>0)

After modifying like this, I could get a good result.

But I am not sure that I am absolutely right.
I want to hear user's opinion about this modification.

In addition, 
I add 'parameter declaration' for easy use in line number from 30 to 41
in my C code. 

/* parameter declaration */
float pro1=30;
float pro2=2*pro1;
float pro3=3*pro1;
float pro4=4*pro1;
float degree=90/pro1;
int nbima=120;        /* number of images */
int nx = 200;
int ny = 140;
float pixsize = 1;

You can change these values according to your simulation condition.
pro1, pro2, pro3 and pro4 means number of projection in 1st, 2nd, 3rd and 4th quadrant.
degree means sampling angle. (pro1 * degree must be 90)
nbima means total number of projection which will be acquired after simulation.
nx, ny and pixsize means
/gate/output/projection/pixelSizeX 1 mm     // --> pixsize
/gate/output/projection/pixelSizeX 1 mm     // --> pixsize
/gate/output/projection/pixelNumberX 200    // -->nx
/gate/output/projection/pixelNumberY 140    // -->ny

I hope this helps your works.

Sungkyunkwan University, School of Medicine 
Samsung Medical Center, Department of Nuclear Medicine 
50, Irwon-Dong, Gangnam-Gu, Seoul, Korea 135-710 

Tel : 82-2-3410-2652 
Cell : 82-10-7593-7577 

Seyjoon Park

올 한해 고마웠던 사람들에게 메시지 보내고 선물받으세요! - 모두가 행복한 세상이 됩니다. UCC 참여하기
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: benchmark_projection_seyjoon.c
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20071124/dabcdeb0/attachment.txt>

More information about the Gate-users mailing list