VIP: Volume Image Processing


util.h
Go to the documentation of this file.
1/*****************************************************************************
2 * PROJECT : V.I.P. Library
3 * MODULE NAME : vip/util.h * TYPE : Header
4 * AUTHOR : MANGIN J.F. * CREATION : 19/01/1996
5 * VERSION : 0.1 * REVISION :
6 * LANGUAGE : C * EXAMPLE :
7 * DEVICE : Sun SPARC Station 5
8 *****************************************************************************
9 *
10 * DESCRIPTION : Diverses constantes et procedures relativement generales
11 * jfmangin@cea.fr
12 *
13 *****************************************************************************
14 *
15 * USED MODULES :
16 *
17 *****************************************************************************
18 * REVISIONS : DATE | AUTHOR | DESCRIPTION
19 *--------------------|--------------|----------------------------------------
20 * / / | |
21 *****************************************************************************/
22
23
24
25#ifndef VIP_UTIL_H
26#define VIP_UTIL_H
27
28#ifndef __has_feature
29 #define __has_feature(x) 0 /* Compatibility with non-clang compilers. */
30#endif
31#ifndef CLANG_ANALYZER_NORETURN
32 #if __has_feature(attribute_analyzer_noreturn)
33 #define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
34 #else
35 #define CLANG_ANALYZER_NORETURN
36 #endif
37#endif
38
39#ifdef __cplusplus
40 extern "C" {
41#endif
42
43#include <math.h>
44#include <vip/volume.h>
45#include <vip/util/util_gen.h>
46#include <vip/util/util2_gen.h>
47#include <vip/util/slice.h>
48
49/*A few constant for thresholding functions*/
50
51#define GREATER_THAN 66
52#define GREATER_OR_EQUAL_TO 67
53#define EQUAL_TO 68
54#define LOWER_THAN 69
55#define LOWER_OR_EQUAL_TO 70
56#define NOT_EQUAL_TO 71
57
58#define VIP_BETWEEN 76
59#define VIP_BETWEEN_OR_EQUAL_TO 77
60#define VIP_OUTSIDE 78
61#define VIP_OUTSIDE_OR_EQUAL_TO 79
62
63#define BINARY_RESULT 88
64#define GREYLEVEL_RESULT 89
65
66#define RAW_TYPE_CONVERSION 11
67
68#define LOG_NEP 12
69#define LOG_TEN 13
70
71#define VIP_MERGE_SAME_VALUES 94
72#define VIP_MERGE_ONE_TO_ONE 95
73#define VIP_MERGE_ALL_TO_ONE 96
74#define VIP_MERGE_ALL_TO_MAXP1 97
75#define VIP_MERGE_ONE_TO_MAXP1 98
76
77#define FLIP_XX 111
78#define FLIP_YY 112
79#define FLIP_ZZ 113
80#define FLIP_XY 114
81#define FLIP_XZ 115
82#define FLIP_YZ 116
83#define FLIP_XXZZ 117
84#define FLIP_YYZZ 118
85#define FLIP_XXYYZZ 119
86
87#define VIP_CL_ERROR 111
88
89/*Definitions pour les gestions de fichier*/
90
91/*----------------------------------------------------------------------------*/
93char *filename,
94char *mode,
95char *caller);
96/*----------------------------------------------------------------------------*/
97
98#define VIP_READ_TEXT "r"
99#define VIP_WRITE_TEXT "w"
100#define VIP_APPEND_TEXT "a"
101#define VIP_READ_TEXT_UPDATE "r+"
102#define VIP_WRITE_TEXT_UPDATE "w+"
103#define VIP_APPEND_TEXT_UPDATE "a+"
104#define VIP_READ_BIN "rb"
105#define VIP_WRITE_BIN "wb"
106#define VIP_APPEND_BIN "ab"
107#define VIP_READ_BIN_UPDATE "rb+"
108#define VIP_WRITE_BIN_UPDATE "wb+"
109#define VIP_APPEND_BIN_UPDATE "ab+"
110
111
112
113/*Macros classiques*/
114
115/*----------------------------------------------------------------------------*/
116
117#define mVipMin(a,b) ((a)<(b)?(a):(b))
118#define mVipMax(a,b) ((a)>(b)?(a):(b))
119#define mVipRint(a) ((int)((a)+0.5))
120#define mVipSign(a) (((a) < 0.0) ? -1.0 : 1.0)
121#define mVipSq(a) ((a)*(a))
122#define mVipSq3(a) (mVipSq(a)*(a))
123#define mVipRootN(a,n) (mVipSign(a)*pow(fabs(a), 1.0/(double)n))
124#define mVipHypotenuse(a,b) sqrt(mVipSq(a)+mVipSq(b))
125
126/*----------------------------------------------------------------------------*/
127
128/*==============================*
129 | |
130 | error processing functions |
131 | |
132 *==============================*/
133
134/*----------------------------------------------------------------------------*/
135 extern
137/*
138 abort program execution after printing the name of the function
139 where problems occure
140*/
141/*----------------------------------------------------------------------------*/
142(
143 const char *fname
145
146/*----------------------------------------------------------------------------*/
147 extern
149/*
150 Vip formatted error printing
151*/
152/*----------------------------------------------------------------------------*/
153(
154 const char *s
155);
156
157/*----------------------------------------------------------------------------*/
158 extern
160/*
161 Vip formatted warning
162*/
163/*----------------------------------------------------------------------------*/
164(
165 const char *fname
166);
167
168/*----------------------------------------------------------------------------*/
169 extern
171/*
172 Vip formatted information
173*/
174/*----------------------------------------------------------------------------*/
175(
176 const char *fname
177);
178
179/*---------------------------------------------------------------*/
181/*---------------------------------------------------------------*/
182
183/*---------------------------------------------------------------*/
184extern int VipComputeLogVolume(Volume *vol, int logmode);
185/*---------------------------------------------------------------*/
186
187#ifdef __cplusplus
188 }
189#endif
190
191#endif /* VIP_UTIL_H */
#define CLANG_ANALYZER_NORETURN
Definition util.h:35
int VipComputeLogVolume(Volume *vol, int logmode)
void VipPrintfExit(const char *fname) CLANG_ANALYZER_NORETURN
FILE * VipOpenFile(char *filename, char *mode, char *caller)
void VipPrintfWarning(const char *fname)
void VipPrintfError(const char *s)
void VipPrintfInfo(const char *fname)
int VipComputeReversedSignVolume(Volume *vol)