VIP: Volume Image Processing


histo.h
Go to the documentation of this file.
1/*****************************************************************************
2 * PROJECT : V.I.P. Library
3 * MODULE NAME : vip/histo.h * TYPE : Header
4 * AUTHOR : MANGIN J.F. * CREATION : 20/04/1997
5 * VERSION : 1.1 * REVISION :
6 * LANGUAGE : C * EXAMPLE :
7 * DEVICE : Linux
8 *****************************************************************************
9 *
10 * DESCRIPTION : gestion des histogrammes (scalespace, Kmeans...)
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_HISTO_H
26#define VIP_HISTO_H
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#include <stdio.h>
33#include <stdlib.h>
34#include <string.h>
35#include <stdarg.h>
36#include <limits.h>
37#include <errno.h>
38#include <time.h>
39#include <math.h>
40
41#include <vip/util.h>
42#include <vip/alloc.h>
43#include <vip/volume.h>
44
45
46 /*access to histogram: histo->val[greylevel] */
47 /*Once again, we do not provide real encapsulation*/
48 /*for optimization purpose*/
49 /*Nevertheless, try to use provided methods as far as possible*/
50
51 typedef struct Vip_histo {
52 int *histo_ad; /*buffer address*/
53 int *val; /*val = histo_ad + buf_zero_position, can be outside buffer*/
54 int min; /*first non zero value*/
55 int max; /*mast non zero value*/
56 int buf_zero_position; /*val[0] = histo_ad[buf_zero_position] if 0 is inside buffer*/
57 int buf_size; /* buffer length */
58 int range_max; /*buf_max = buf_size - buf_zero_position -1*/
59 int range_min; /*buf_min = -buf_zero_position*/
61
62#include <vip/histo/histo_ss.h>
63
64#define mVipHistoVal(h,g) ((h)->val[(g)])
65#define mVipHistoRangeMin(h) ((h)->range_min)
66#define mVipHistoRangeMax(h) ((h)->range_max)
67 /*NB, if you want to be sure that min and max are uptodate,
68 use the functions VipGetHistoMin and VipGetHistoMax*/
69#define mVipHistoMin(h) ((h)->min)
70#define mVipHistoMax(h) ((h)->max)
71
72#define WRITE_HISTO_BINARY 0
73#define WRITE_HISTO_ASCII 1
74
75
76
77
78/*---------------------------------------------------------------*/
80SSCascade *clist,
81Vip1DScaleSpaceStruct *volstruct,
82float mean);
83/*---------------------------------------------------------------*/
84
85/*---------------------------------------------------------------*/
87/*---------------------------------------------------------------*/
88
89/*---------------------------------------------------------------*/
91/*---------------------------------------------------------------*/
92
93/*---------------------------------------------------------------*/
95VipHisto *hin,
96float entropy,
97int *ratio);
98/*---------------------------------------------------------------*/
99
100/*---------------------------------------------------------------*/
102VipHisto *histo,
103float *entropo);
104/*---------------------------------------------------------------*/
105
106/*---------------------------------------------------------------*/
107extern int VipPourcentageLowerThanThreshold(Volume *vol, int lowthreshold, int pourcentage);
108/*---------------------------------------------------------------*/
109
110/*---------------------------------------------------------------*/
111extern int VipCutRightFlatPartOfHisto(VipHisto *h, int cutvalue);
112/*---------------------------------------------------------------*/
113
114/*---------------------------------------------------------------*/
115extern int VipTestHistoExists(char *name);
116/*---------------------------------------------------------------*/
117
118/*---------------------------------------------------------------*/
119extern VipHisto *VipGetUndersampledHisto(VipHisto *hin, int *ratio);
120/*---------------------------------------------------------------*/
121
122/*---------------------------------------------------------------*/
124VipHisto *hin,
125int prop,
126int *ratio,
127int *power2,
128int threshold,
129int final_length);
130/*---------------------------------------------------------------*/
131
132/*---------------------------------------------------------------*/
134/*---------------------------------------------------------------*/
135
136/*---------------------------------------------------------------*/
137extern VipHisto *VipReadHisto(char *name);
138/*---------------------------------------------------------------*/
139
140/*---------------------------------------------------------------*/
141extern int VipWriteHisto(VipHisto *histo, char *name, int mode);
142/*---------------------------------------------------------------*/
143
144/*---------------------------------------------------------------*/
145extern VipHisto *VipGetLeftExtendedHisto(VipHisto *hin, int length);
146/*---------------------------------------------------------------*/
147
148/*---------------------------------------------------------------*/
150/*---------------------------------------------------------------*/
151
152/*---------------------------------------------------------------*/
154int minvalue,
155int maxvalue);
156/*---------------------------------------------------------------*/
157
158/*---------------------------------------------------------------*/
159extern int VipFreeHisto(VipHisto *histo);
160/*---------------------------------------------------------------*/
161
162/*---------------------------------------------------------------*/
163extern int VipSetHistoVal(
164VipHisto *histo,
165int greylevel,
166int value);
167/*---------------------------------------------------------------*/
168
169/*---------------------------------------------------------------*/
170extern int VipGetHistoVal(
171VipHisto *histo,
172int greylevel,
173int *value);
174/*---------------------------------------------------------------*/
175
176/*---------------------------------------------------------------*/
177extern int VipGetHistoMin(
178VipHisto *histo,
179int *min);
180/*---------------------------------------------------------------*/
181
182/*---------------------------------------------------------------*/
183extern int VipGetHistoMax(
184VipHisto *histo,
185int *max);
186/*---------------------------------------------------------------*/
187
188/*---------------------------------------------------------------*/
190/*---------------------------------------------------------------*/
191
192/*---------------------------------------------------------------*/
194/*---------------------------------------------------------------*/
195
196/*---------------------------------------------------------------*/
198/*---------------------------------------------------------------*/
199
200/*---------------------------------------------------------------*/
202/*---------------------------------------------------------------*/
203
204/*---------------------------------------------------------------*/
206float m1,
207float s1,
208float h1,
209float m2,
210float s2,
211float h2,
212float m3,
213float s3,
214float h3);
215/*---------------------------------------------------------------*/
216
217/*---------------------------------------------------------------*/
219float m1,
220float s1,
221float h1,
222float m2,
223float s2,
224float h2,
225float m3,
226float s3,
227float h3,
228float m4,
229float s4,
230float h4);
231/*---------------------------------------------------------------*/
232
233/*---------------------------------------------------------------*/
235Volume *vol,
236Volume *thresholdedvol,
237float *mean,
238float *sigma,
239int robust);
240/*---------------------------------------------------------------*/
241
242/*---------------------------------------------------------------*/
244Volume *vol,
245Volume *thresholdedvol,
246float *mean,
247float *sigma,
248int robust);
249/*---------------------------------------------------------------*/
250
251/*---------------------------------------------------------------*/
253VipHisto *histo,
254int *ratio,
255int ratios[5][5],
256int j);
257/*---------------------------------------------------------------*/
258
259/*---------------------------------------------------------------*/
261/*---------------------------------------------------------------*/
262
263#ifdef __cplusplus
264}
265#endif
266
267#endif /* VIP_HISTO_H */
268
269
270
271
272
273
VipHisto * VipCreateForGaussianSumHisto(float m1, float s1, float h1, float m2, float s2, float h2, float m3, float s3, float h3, float m4, float s4, float h4)
int VipIterateToGetPropUndersampledRatio(VipHisto *histo, int *ratio, int ratios[5][5], int j)
VipHisto * VipComputeCleanedUpVolumeHisto(Volume *vol, Volume *discard)
int VipComputeStatInRidgeVolume(Volume *vol, Volume *thresholdedvol, float *mean, float *sigma, int robust)
VipHisto * VipCreateHisto(int minvalue, int maxvalue)
int VipTestHistoExists(char *name)
VipHisto * VipGetRightExtendedHisto(VipHisto *hin, int length)
int VipComputeRobustStatInMaskVolume(Volume *vol, Volume *thresholdedvol, float *mean, float *sigma, int robust)
VipHisto * VipGetPropUndersampledHisto(VipHisto *hin, int prop, int *ratio, int *power2, int threshold, int final_length)
VipHisto * VipCreateThreeGaussianSumHisto(float m1, float s1, float h1, float m2, float s2, float h2, float m3, float s3, float h3)
VipT1HistoAnalysis * VipAnalyseCascadesRidge(SSCascade *clist, Vip1DScaleSpaceStruct *volstruct, float mean)
int VipPourcentageLowerThanThreshold(Volume *vol, int lowthreshold, int pourcentage)
int VipWriteHisto(VipHisto *histo, char *name, int mode)
int VipFreeHisto(VipHisto *histo)
int VipSetHistoVal(VipHisto *histo, int greylevel, int value)
VipHisto * VipComputeVolumeHisto(Volume *vol)
VipHisto * VipGetForcedUndersampledHisto(VipHisto *hin, int *ratio)
VipHisto * VipGetCumulHisto(VipHisto *hin)
VipHisto * VipGetEntropyForcedUndersampledHisto(VipHisto *hin, float entropy, int *ratio)
Volume * VipComputeVarianceVolume(Volume *vol)
int VipGetHistoMax(VipHisto *histo, int *max)
struct Vip_histo VipHisto
VipHisto * VipGetUndersampledHisto(VipHisto *hin, int *ratio)
int VipGetOtsuThreshold(Volume *vol)
VipHisto * VipGetHistoSurface(VipHisto *hin, Volume *vol)
Volume * VipComputeMeanVolume(Volume *vol)
int VipGetHistoVal(VipHisto *histo, int greylevel, int *value)
int VipGetHistoMin(VipHisto *histo, int *min)
int VipCutRightFlatPartOfHisto(VipHisto *h, int cutvalue)
VipHisto * VipReadHisto(char *name)
VipHisto * VipGetLeftExtendedHisto(VipHisto *hin, int length)
int VipGetHistoEntropy(VipHisto *histo, float *entropo)
struct SScascade SSCascade
struct vip_T1histogram_analysis VipT1HistoAnalysis
struct vip_ss_struct Vip1DScaleSpaceStruct
int range_max
Definition histo.h:58
int * val
Definition histo.h:53
int buf_size
Definition histo.h:57
int range_min
Definition histo.h:59
int max
Definition histo.h:55
int * histo_ad
Definition histo.h:52
int buf_zero_position
Definition histo.h:56
int min
Definition histo.h:54
double mean(double vect[], int fst, int lst)