2 ***********************************************************
3 $SNARK_Header: S N A R K 1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4 $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/analysis.c $
5 $LastChangedRevision: 45 $
6 $Date: 2014-06-12 19:31:23 -0400 (Thu, 12 Jun 2014) $
8 ***********************************************************
10 Previously part of SuperSNARK
13 /*-------------------------- analysis.c ----------------------------------
15 written by Jingsheng Zheng
16 Modified by Jolyon Browne
17 ------------------------------------------------------------------------*/
20 #include "experimenter.h"
24 /*-------------------------- analysis.c ----------------------------------
25 This function sets up the appropriate command lines needed for
26 SNARK's EVALUATE command.
29 ana_flname - name of file containing comparisons to be made.
30 structure - array containing structures to be evaluated.
31 nstr - number of structures in array 'structure.'
32 iter_flag - iteration_flag_line needed by EVALUATE command
36 ------------------------------------------------------------------------*/
38 void evaluate(char* ana_flname, char *** structure, int nstr, char* iter_flag)
42 int i, j = 3; // added "j". Lajos, Dec 13, 2004
43 char string[MAXLINESIZE];
46 if ((anafl = fopen(ana_flname, "r")) == NULL) {
47 errorc("in analysis.c: error in opening file ", ana_flname);
50 fprintf(pstream, "EVALUATE RESOLUTION\n");
51 fprintf(pstream, "experimenter evaluation 1\n"); //added by Lajos, Dec 13, 2004
52 fprintf(pstream, "SELECTIVE\n");
53 for (i = 0; i < nstr; i++) {
54 fprintf(pstream, "%s\n", (*structure)[i]);
56 fprintf(pstream, "LAST\n");
57 fprintf(pstream, "%s\n", iter_flag);
59 fgets(string, sizeof (string), anafl); /* don't want first line */
60 while ( isSkip(string) ) //jump over comment lines and blank lines
62 if ( fgets(string, sizeof (string), anafl) == NULL) break;
64 fgets(string, sizeof (string), anafl); /* second line is either a
65 MODE command or a COMPARE command */
66 while ( isSkip(string) ) //jump over comment lines and blank lines
68 if ( fgets(string, sizeof (string), anafl) == NULL) break;
70 if (strncasecmp(string, "mode", 4) == 0) {
71 sscanf(string, "%*s%f%f", &lower, &upper);
72 fprintf(pstream, "MODE LOWER %f UPPER %f\n", lower, upper);
75 fprintf(pstream, "EVALUATE RESOLUTION\n");
76 fprintf(pstream, "experimenter evaluation 2\n"); //added by Lajos, Dec 13, 2004
77 fprintf(pstream, "WHOLEPIC\n");
78 fprintf(pstream, "%s\n", iter_flag);
80 /* read in MODE values for clipping with WHOLEPIC command */
81 while ((fgets(string, sizeof (string), anafl)) != NULL) {
82 if (strncasecmp(string, "mode", 4) == 0) {
83 sscanf(string, "%*s%f%f", &lower, &upper);
84 fprintf(pstream, "MODE LOWER %f UPPER %f\n", lower, upper);
85 fprintf(pstream, "EVALUATE RESOLUTION\n");
86 fprintf(pstream, "experimenter evaluation %d\n", j++); //added by Lajos, Dec 13, 2004
87 fprintf(pstream, "WHOLEPIC\n");
88 fprintf(pstream, "%s\n", iter_flag);