2 #include "experimenter.h"
3 #include "read_eval_phantom1.h"
4 #include "read_eval_recon3.h"
7 /* ----------------------------- user_fom1.c --------------
9 This function illustrates the use of a user-defined figure
13 itr1 - array of length niters containing the iteration numbers for the
15 itr2 - array of length niters containing the iteration numbers for the
17 niters - number of iterations to be compared
18 keywrd1 - string containing the keyword which defines the first algorithm.
19 keywrd2 - string containing the keyword which defines the second algorithm.
22 user1 - array of length niters containing the user defined figure of
23 merit for the first algorithm.
24 user2 - array of length niters containing the user defined figure of
25 merit for the second algorithm.
29 void user_fom1(int* itr1, int* itr2, int niters, char* keywrd1, char* keywrd2, double* user1, double* user2)
30 //int *itr1,*itr2,niters;
31 //char *keywrd1,*keywrd2;
32 //double *user1,*user2;
34 double *phantom,*recon1,*recon2;
35 int *regions,numstr,i,j,*strarea;
36 float totarea=0.0,avgarea;
38 /* Read in abnormality index and area for phantom structures.
39 The program which does this is read_eval_phantom1.c.
40 NOTE: the only information to be used is the value
41 'numstr' (which is the number of structures in the phantom) */
42 read_eval_phantom1(®ions,&numstr,&phantom,&strarea);
44 /* allocate memory to store abnormality indexes and area
45 (i.e number of pixels) for structures in the
47 recon1 = (double *) malloc(numstr*sizeof(double));
48 recon2 = (double *) malloc(numstr*sizeof(double));
50 for(i=0;i < niters;i++) {
51 /* read in variance for structures in
52 the reconstructions. Initialize the arrays
53 which will store the user FOM */
55 //printf("*** about to read variance\n"); /* TEST (JD) */
56 read_eval_recon3(itr1[i],keywrd1,numstr,recon1);
57 read_eval_recon3(itr2[i],keywrd2,numstr,recon2);
58 /* the varaince of the 'SINGLE' structure to be
59 used is the first in the array. The FOM value
65 free(phantom); /* free memory for next function call */