comparison saitools/tip.h @ 0:5242703e91d3 tip

Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author tomwalters
date Fri, 20 May 2011 15:19:45 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5242703e91d3
1 /*
2 Copyright (c) Applied Psychology Unit, Medical Research Council. 1993
3 ===========================================================================
4
5 Permission to use, copy, modify, and distribute this software without fee
6 is hereby granted for research purposes, provided that this copyright
7 notice appears in all copies and in all supporting documentation, and that
8 the software is not redistributed for any fee (except for a nominal
9 shipping charge). Anyone wanting to incorporate all or part of this
10 software in a commercial product must obtain a license from the Medical
11 Research Council.
12
13 The MRC makes no representations about the suitability of this
14 software for any purpose. It is provided "as is" without express or
15 implied warranty.
16
17 THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
18 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
19 THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
20 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
21 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
23 SOFTWARE.
24 */
25
26 /*------------------------------------------------------------------------*/
27
28 /* tr.h
29 * ------
30 *
31 * Main include file.
32 *
33 * MAA Summer 1993.
34 * Revised Winter 1994.
35 */
36
37
38 /*---------------------------------------------------------------------------*/
39 /*---------------------------------------------------------------------------*/
40
41
42 #define ERROR_INTERVAL 0 /* +/- value that the intervals are
43 allowed to be in: in SAMPLES ... */
44 #define ERROR_MAG 10 /* in percent ... +/- */
45
46
47 #define MAX_DATA 6615 /* 0.15 image seconds, 44100 s sec-1*/
48 #define MAX_CHANNELS 300 /* thus size of array is
49 * MAX_DATA * this = 1984500 samples*/
50 #define MAX_PEAKS 1000 /* in a single channel */
51 #define MAX_NEXTEVENTS 1000 /* ditto */
52 #define ALIGN_CHANNELS 2 /* Default number of channels to
53 * align over */
54
55 #define MAX_STRING_LENGTH 255 /* of a filename, etc */
56 #define NULLSTRING ""
57
58 #define MAX_LINES_HEADER 100 /* 69 is what .sai are */
59 #define MAX_LINE_LENGTH 80 /* of a header : width of an xterm */
60
61 #define UNSET 9 /* nextevents definitions */
62 #define RIGHTZERO 10 /* ditto */
63 #define LEFTZERO 11 /* ditto */
64 #define MINIMUM 12 /* ditto */
65 #define END_OF_WIDTH 13 /* ditto */
66
67 #define RIGHTEDGE 21 /* tent definitions */
68 #define LEFTEDGE 22 /* ditto */
69 #define INSIDE 23 /* ditto */
70 #define NOISE 24 /* ditto */
71 #define FIGURE 25 /* ditto */
72 #define TRIGGER 26 /* ditto */
73
74 #define POINT 1 /* output format definitions */
75 #define PEAK 2 /* ditto */
76 #define INTEGRAL 3 /* ditto */
77 #define TENT 4 /* ditto */
78 #define HALF_DOME 5 /* ditto */
79
80
81 #define FIGURE_EXT "figure.sai" /* filename extensions */
82 #define GROUND_EXT "ground.sai" /* ditto */
83 #define OUTPUT_EXT ".sai" /* ditto */
84 #define INPUT_EXT ".sai" /* ditto */
85 #define OUTPUTGROUNDFN "ground.sai" /* default file for ground */
86
87 #define OFF 0
88 #define ON 1
89
90 #define READ 31 /* used in fopen as "rb" */
91 #define WRITE 32 /* used in fopen as "wb" */
92
93 #define SINGLECHANNEL 9999 /* used in copytoouput to indicate
94 that the arrays by channel
95 DON"T exist */
96 #define THREE 3
97 #define FIVE 5
98
99 #define GLACIERVALUE 0.5
100
101 #define NEW_PWIDTH 0
102 #define NEW_NWIDTH 15
103 #define PWIDTH 20 /* used in napgraph: default */
104 #define NWIDTH 5 /* used in napgraph: default.
105 * The minus is added later.*/
106
107 #define NORMAL_WEIGHTING 41
108 #define LOG_WEIGHTING 42
109
110
111
112 /*---------------------------------------------------------------------------*/
113 /*---------------------------------------------------------------------------*/
114
115
116
117 struct Peak {
118 int sample; /* where the triangulation point is */
119 int mag; /* its height */
120 int tent; /* whether its been included in figure or ground,
121 * or not : see 'tent defs' above*/
122 double weight;
123 };
124
125 struct NextEvent {
126 int sample; /* the nextevent of a peak: because findpeaksreverse()
127 * goes right -> left, this is LEFT*/
128 int type; /* the type of that event: MINIMUM, RIGHTZERO,
129 * LEFTZERO, END_OF_WIDTH */
130 int mag; /* its height */
131 };
132
133
134 /* The End ---------------------------------------------------------------*/
135 /*------------------------------------------------------------------------*/