-
Notifications
You must be signed in to change notification settings - Fork 3
/
deform.h
145 lines (122 loc) · 4.07 KB
/
deform.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#ifndef DEF_DEFORM
#define DEF_DEFORM
#include <bicpl.h>
typedef enum { TOWARDS_LOWER, TOWARDS_HIGHER, ANY_DIRECTION }
Normal_directions;
typedef struct
{
Real min_isovalue;
Real max_isovalue;
Real gradient_threshold;
Real min_dot_product;
Real max_dot_product;
Normal_directions normal_direction;
Real tolerance;
} boundary_definition_struct;
typedef enum { VOLUME_DATA } Deform_data_types;
typedef struct
{
Deform_data_types type;
Volume volume;
Volume label_volume;
} deform_data_struct;
typedef enum { FLAT_MODEL, AVERAGE_MODEL,
PARAMETRIC_MODEL, GENERAL_MODEL }
Deformation_model_types;
typedef struct
{
int up_to_n_points;
Deformation_model_types model_type;
Real model_weight;
object_struct *model_object;
int n_model_points;
Point *model_centroids;
Vector *model_normals;
Point *model_points;
Real min_curvature_offset;
Real max_curvature_offset;
} deform_model_struct;
typedef struct
{
int n_models;
deform_model_struct *models;
BOOLEAN position_constrained;
Real max_position_offset;
Point *original_positions;
} deformation_model_struct;
typedef struct
{
deform_data_struct deform_data;
deformation_model_struct deformation_model;
Real fractional_step;
Real max_step;
Real max_search_distance;
int degrees_continuity;
boundary_definition_struct boundary_definition;
int max_iterations;
Real stop_threshold;
int n_movements_alloced;
float *prev_movements;
Real movement_threshold;
} deform_struct;
#define MAX_IN_VOXEL_COEF_LOOKUP 10000
typedef struct voxel_lin_coef_struct
{
int hash_key;
Real coefs[8];
struct voxel_lin_coef_struct *prev;
struct voxel_lin_coef_struct *next;
}
voxel_lin_coef_struct;
typedef struct
{
hash_table_struct hash;
int n_in_hash;
voxel_lin_coef_struct *head;
voxel_lin_coef_struct *tail;
} voxel_coef_struct;
#define N_DEFORM_HISTOGRAM 7
typedef struct
{
Real average;
Real maximum;
int n_below[N_DEFORM_HISTOGRAM];
} deform_stats;
typedef struct
{
int axis;
Point *save_points;
Real *curvature_factors;
Point *equilibrium_points;
Point *new_equilibrium_points;
Point *boundary_points;
Point *new_boundary_points;
Real temperature;
Real temperature_factor;
int temperature_step;
int min_n_to_move;
int max_n_to_move;
Real max_translation;
Real max_angle_rotation;
Real max_scale_offset;
int stop_criteria;
int try;
int max_tries;
int max_successes;
int n_successes;
int n_pos_successes;
int n_no_moves;
Real min_delta_energy;
Real max_delta_energy;
Real energy;
} anneal_struct;
#ifndef public
#define public extern
#define public_was_defined_here
#endif
#include <deform_prototypes.h>
#ifdef public_was_defined_here
#undef public
#undef public_was_defined_here
#endif
#endif