00001
#ifndef DEF_vol_prototypes
00002
#define DEF_vol_prototypes
00003
00004
public Volume
create_box_filtered_volume(
00005 Volume volume,
00006 nc_type nc_data_type,
00007 BOOLEAN sign_flag,
00008 Real real_min_value,
00009 Real real_max_value,
00010 Real x_width,
00011 Real y_width,
00012 Real z_width );
00013
00014
public void modify_labels_in_range(
00015 Volume volume,
00016 Volume label_volume,
00017
int src_min,
00018
int src_max,
00019
int dest_label,
00020 Real min_threshold,
00021 Real max_threshold,
00022
int range_changed[2][N_DIMENSIONS] );
00023
00024
public void initialize_colour_coding(
00025
colour_coding_struct *colour_coding,
00026 Colour_coding_types type,
00027 Colour under_colour,
00028 Colour over_colour,
00029 Real min_value,
00030 Real max_value );
00031
00032
public void delete_colour_coding(
00033
colour_coding_struct *colour_coding );
00034
00035
public void set_colour_coding_type(
00036
colour_coding_struct *colour_coding,
00037 Colour_coding_types type );
00038
00039
public Colour_coding_types get_colour_coding_type(
00040
colour_coding_struct *colour_coding );
00041
00042
public void set_colour_coding_min_max(
00043
colour_coding_struct *colour_coding,
00044 Real min_value,
00045 Real max_value );
00046
00047
public void get_colour_coding_min_max(
00048
colour_coding_struct *colour_coding,
00049 Real *min_value,
00050 Real *max_value );
00051
00052
public Colour
get_colour_coding_under_colour(
00053
colour_coding_struct *colour_coding );
00054
00055
public void set_colour_coding_under_colour(
00056
colour_coding_struct *colour_coding,
00057 Colour under_colour );
00058
00059
public Colour
get_colour_coding_over_colour(
00060
colour_coding_struct *colour_coding );
00061
00062
public void set_colour_coding_over_colour(
00063
colour_coding_struct *colour_coding,
00064 Colour over_colour );
00065
00066
public BOOLEAN
define_colour_coding_user_defined(
00067
colour_coding_struct *colour_code,
00068
int n_colours,
00069 Colour colours[],
00070 Real positions[],
00071 Colour_spaces interpolation_space );
00072
00073
public Colour
get_colour_code(
00074
colour_coding_struct *colour_coding,
00075 Real value );
00076
00077
public void colour_code_object(
00078 Volume volume,
00079
int continuity,
00080
colour_coding_struct *colour_coding,
00081
object_struct *object );
00082
00083
public STRING
get_default_user_def_colour_code_suffix(
void );
00084
00085
public Status
input_user_defined_colour_coding(
00086
colour_coding_struct *colour_coding,
00087 STRING filename );
00088
00089
public void create_volume_slice(
00090 Volume volume1,
00091 Filter_types filter_type1,
00092 Real filter_width1,
00093 Real slice_position1[],
00094 Real x_axis1[],
00095 Real y_axis1[],
00096 Real x_translation1,
00097 Real y_translation1,
00098 Real x_scale1,
00099 Real y_scale1,
00100 Volume volume2,
00101 Filter_types filter_type2,
00102 Real filter_width2,
00103 Real slice_position2[],
00104 Real x_axis2[],
00105 Real y_axis2[],
00106 Real x_translation2,
00107 Real y_translation2,
00108 Real x_scale2,
00109 Real y_scale2,
00110
int x_viewport_size,
00111
int y_viewport_size,
00112
int x_pixel_start,
00113
int x_pixel_end,
00114
int y_pixel_start,
00115
int y_pixel_end,
00116 Pixel_types pixel_type,
00117
int degrees_continuity,
00118
unsigned short **cmode_colour_map,
00119 Colour **rgb_colour_map,
00120 Colour empty_colour,
00121
void *render_storage,
00122 BOOLEAN clip_pixels_flag,
00123
int *n_pixels_alloced,
00124
pixels_struct *pixels );
00125
00126
public void set_volume_slice_pixel_range(
00127 Volume volume1,
00128 Filter_types filter_type1,
00129 Real filter_width1,
00130 Real slice_position1[],
00131 Real x_axis1[],
00132 Real y_axis1[],
00133 Real x_translation1,
00134 Real y_translation1,
00135 Real x_scale1,
00136 Real y_scale1,
00137 Volume volume2,
00138 Filter_types filter_type2,
00139 Real filter_width2,
00140 Real slice_position2[],
00141 Real x_axis2[],
00142 Real y_axis2[],
00143 Real x_translation2,
00144 Real y_translation2,
00145 Real x_scale2,
00146 Real y_scale2,
00147
int x_viewport_size,
00148
int y_viewport_size,
00149 Pixel_types pixel_type,
00150
int *n_pixels_alloced,
00151
pixels_struct *pixels );
00152
00153
public BOOLEAN
find_volume_crop_bounds(
00154 Volume volume,
00155 Real min_crop_threshold,
00156 Real max_crop_threshold,
00157
int limits[2][MAX_DIMENSIONS] );
00158
00159
public Volume
create_cropped_volume(
00160 Volume volume,
00161
int limits[2][MAX_DIMENSIONS] );
00162
00163
public Volume
autocrop_volume(
00164 Volume volume );
00165
00166
public int dilate_voxels_3d(
00167 Volume volume,
00168 Volume label_volume,
00169 Real min_inside_label,
00170 Real max_inside_label,
00171 Real min_inside_value,
00172 Real max_inside_value,
00173 Real min_outside_label,
00174 Real max_outside_label,
00175 Real min_outside_value,
00176 Real max_outside_value,
00177 Real new_label,
00178 Neighbour_types connectivity,
00179
int range_changed[2][N_DIMENSIONS] );
00180
00181
public int get_slice_weights_for_filter(
00182 Volume volume,
00183 Real voxel_position[],
00184 Real voxel_direction[],
00185 Filter_types filter_type,
00186 Real full_width_half_max,
00187 Real ***positions,
00188 Real *weights[] );
00189
00190
public BOOLEAN
fill_connected_voxels(
00191 Volume volume,
00192 Volume label_volume,
00193 Neighbour_types connectivity,
00194
int voxel[],
00195
int min_label_threshold,
00196
int max_label_threshold,
00197
int desired_label,
00198 Real min_threshold,
00199 Real max_threshold,
00200
int range_changed[2][N_DIMENSIONS] );
00201
00202
public int get_neighbour_directions(
00203 Neighbour_types connectivity,
00204
int *dx[],
00205
int *dy[] );
00206
00207
public int get_3D_neighbour_directions(
00208 Neighbour_types connectivity,
00209
int *dx[],
00210
int *dy[],
00211
int *dz[] );
00212
00213
public BOOLEAN
should_change_this_one(
00214 Volume volume,
00215 Volume label_volume,
00216
int voxel[],
00217 Real min_threshold,
00218 Real max_threshold,
00219
int label_min_threshold,
00220
int label_max_threshold,
00221
int desired_label );
00222
00223
public void interpolate_volume_to_slice(
00224 Volume volume1,
00225
int n_dims1,
00226 Real origin1[],
00227 Real x_axis1[],
00228 Real y_axis1[],
00229 Volume volume2,
00230
int n_dims2,
00231 Real origin2[],
00232 Real x_axis2[],
00233 Real y_axis2[],
00234
int x_pixel_start,
00235
int x_pixel_end,
00236
int y_pixel_start,
00237
int y_pixel_end,
00238
int degrees_continuity,
00239
unsigned short **cmode_colour_map,
00240 Colour **rgb_colour_map,
00241 Colour empty_colour,
00242
pixels_struct *pixels );
00243
00244
public Status
input_volume_header_only(
00245 STRING filename,
00246
int n_dimensions,
00247 STRING dim_names[],
00248 Volume *volume,
00249 minc_input_options *options );
00250
00251
public void set_label_volume_real_range(
00252 Volume volume );
00253
00254
public Volume
create_label_volume(
00255 Volume volume,
00256 nc_type type );
00257
00258
public BOOLEAN
is_label_volume_initialized(
00259 Volume volume );
00260
00261
public void set_all_volume_label_data(
00262 Volume volume,
00263
int value );
00264
00265
public void set_volume_label_data_5d(
00266 Volume volume,
00267
int v0,
00268
int v1,
00269
int v2,
00270
int v3,
00271
int v4,
00272
int value );
00273
00274
public void set_volume_label_data(
00275 Volume volume,
00276
int voxel[],
00277
int value );
00278
00279
public int get_volume_label_data(
00280 Volume volume,
00281
int voxel[] );
00282
00283
public int get_volume_label_data_5d(
00284 Volume volume,
00285
int v0,
00286
int v1,
00287
int v2,
00288
int v3,
00289
int v4 );
00290
00291
public int get_3D_volume_label_data(
00292 Volume volume,
00293
int x,
00294
int y,
00295
int z );
00296
00297
public BOOLEAN
get_voxel_label_bit(
00298 Volume volume,
00299
int voxel[],
00300
int bit );
00301
00302
public void set_voxel_label_bit(
00303 Volume volume,
00304
int voxel[],
00305
int bit,
00306 BOOLEAN value );
00307
00308
public void set_all_volume_label_data_bit(
00309 Volume volume,
00310
int bit,
00311 BOOLEAN value );
00312
00313
public BOOLEAN
get_volume_voxel_activity(
00314 Volume volume,
00315 Real voxel[],
00316 BOOLEAN activity_if_mixed );
00317
00318
public Status
load_label_volume(
00319 STRING filename,
00320 Volume label_volume );
00321
00322
public Status
save_label_volume(
00323 STRING filename,
00324 STRING original_filename,
00325 Volume label_volume,
00326 Real crop_threshold );
00327
00328
public Status
input_tags_as_labels(
00329 FILE *file,
00330 Volume volume,
00331 Volume label_volume );
00332
00333
public Status
create_label_volume_from_file(
00334 STRING filename,
00335 Volume volume,
00336 Volume *label_volume );
00337
00338
public Status
output_labels_as_tags(
00339 FILE *file,
00340 Volume volume,
00341 Volume label_volume,
00342
int desired_label,
00343 Real size,
00344
int patient_id );
00345
00346
public Status
input_landmarks_as_labels(
00347 FILE *file,
00348 Volume volume,
00349 Volume label_volume );
00350
00351
public int get_volume_cross_section(
00352 Volume volume,
00353 Real origin[],
00354 Real x_axis[],
00355 Real y_axis[],
00356 Real clipped_voxels[][MAX_DIMENSIONS] );
00357
00358
public void get_volume_mapping_range(
00359 Volume volume,
00360 Real origin[],
00361 Real x_axis[],
00362 Real y_axis[],
00363 Real x_trans,
00364 Real y_trans,
00365 Real x_scale,
00366 Real y_scale,
00367 Real *x_pixel_start,
00368 Real *x_pixel_end,
00369 Real *y_pixel_start,
00370 Real *y_pixel_end );
00371
00372
public void clip_viewport_to_volume(
00373 Volume volume,
00374 Real origin[],
00375 Real x_axis[],
00376 Real y_axis[],
00377
int *x_pixel_start,
00378
int *x_pixel_end,
00379
int *y_pixel_start,
00380
int *y_pixel_end );
00381
00382
public void get_mapping(
00383 Volume volume,
00384 Real origin[],
00385 Real x_axis[],
00386 Real y_axis[],
00387 Real x_translation,
00388 Real y_translation,
00389 Real x_scale,
00390 Real y_scale,
00391 Real pix_origin[],
00392 Real pix_x_axis[],
00393 Real pix_y_axis[] );
00394
00395
public void map_voxel_to_pixel(
00396
int n,
00397 Real voxel[],
00398 Real origin[],
00399 Real x_axis[],
00400 Real y_axis[],
00401 Real *x_pixel,
00402 Real *y_pixel );
00403
00404
public BOOLEAN
convert_slice_pixel_to_voxel(
00405 Volume volume,
00406 Real x_pixel,
00407 Real y_pixel,
00408 Real origin[],
00409 Real x_axis[],
00410 Real y_axis[],
00411 Real x_translation,
00412 Real y_translation,
00413 Real x_scale,
00414 Real y_scale,
00415 Real voxel[] );
00416
00417
public void convert_voxel_to_slice_pixel(
00418 Volume volume,
00419 Real voxel[],
00420 Real origin[],
00421 Real x_axis[],
00422 Real y_axis[],
00423 Real x_translation,
00424 Real y_translation,
00425 Real x_scale,
00426 Real y_scale,
00427 Real *x_pixel,
00428 Real *y_pixel );
00429
00430
public void resize_volume_slice(
00431
int old_x_viewport_size,
00432
int old_y_viewport_size,
00433
int old_used_x_viewport_size,
00434
int old_used_y_viewport_size,
00435
int new_x_viewport_size,
00436
int new_y_viewport_size,
00437 Real *x_translation,
00438 Real *y_translation,
00439 Real *x_scale,
00440 Real *y_scale,
00441
int *used_x_viewport_size,
00442
int *used_y_viewport_size );
00443
00444
public void fit_volume_slice_to_viewport(
00445 Volume volume,
00446 Real origin[],
00447 Real x_axis[],
00448 Real y_axis[],
00449
int x_viewport_size,
00450
int y_viewport_size,
00451 Real fraction_oversize,
00452 Real *x_translation,
00453 Real *y_translation,
00454 Real *x_scale,
00455 Real *y_scale,
00456
int *used_x_viewport_size,
00457
int *used_y_viewport_size );
00458
00459
public void scale_slice_about_viewport_centre(
00460 Real scale_factor,
00461
int x_viewport_size,
00462
int y_viewport_size,
00463 Real *x_translation,
00464 Real *y_translation,
00465 Real *x_scale,
00466 Real *y_scale );
00467
00468
public BOOLEAN
voxel_is_within_volume(
00469 Volume volume,
00470 Real voxel_position[] );
00471
00472
public BOOLEAN
int_voxel_is_within_volume(
00473 Volume volume,
00474
int indices[] );
00475
00476
public void convert_real_to_int_voxel(
00477
int n_dimensions,
00478 Real voxel[],
00479
int int_voxel[] );
00480
00481
public void convert_int_to_real_voxel(
00482
int n_dimensions,
00483
int int_voxel[],
00484 Real voxel[] );
00485
00486
public BOOLEAN
voxel_contains_range(
00487 Volume volume,
00488
int int_voxel[],
00489 Real min_value,
00490 Real max_value );
00491
00492
public BOOLEAN
volumes_are_same_grid(
00493 Volume volume1,
00494 Volume volume2 );
00495
00496
public Status
output_volume_free_format(
00497 STRING prefix,
00498 Volume volume,
00499
int axis_ordering[] );
00500
00501
public void *
initialize_render_storage(
void );
00502
00503
public void delete_render_storage(
00504
void *ptr );
00505
00506
public void render_volume_to_slice(
00507
int n_dims1,
00508
int sizes1[],
00509
void *volume_data1,
00510 Data_types volume1_type,
00511
int n_slices1,
00512 Real weights1[],
00513
int strides1[],
00514 Real **origins1,
00515 Real x_axis1[],
00516 Real y_axis1[],
00517
int n_dims2,
00518
int sizes2[],
00519
void *volume_data2,
00520 Data_types volume2_type,
00521
int n_slices2,
00522 Real weights2[],
00523
int strides2[],
00524 Real **origins2,
00525 Real x_axis2[],
00526 Real y_axis2[],
00527
int x_pixel_start,
00528
int x_pixel_end,
00529
int y_pixel_start,
00530
int y_pixel_end,
00531
unsigned short **cmode_colour_map,
00532 Colour **rgb_colour_map,
00533 Colour empty_colour,
00534
void *render_storage,
00535
pixels_struct *pixels );
00536
00537
public void render_one_row (
00538
void *volume_data1,
00539 Data_types volume1_type,
00540
int y,
00541
int start_x,
00542
int end_x,
00543
int **y_offsets1,
00544
int **row_offsets1,
00545
void **start_slices1,
00546
int n_slices1,
00547 Real weights1[],
00548
void *volume_data2,
00549 Data_types volume2_type,
00550
int **y_offsets2,
00551
int **row_offsets2,
00552
void **start_slices2,
00553
int n_slices2,
00554 Real weights2[],
00555
unsigned short **cmode_colour_map,
00556 Colour **rgb_colour_map,
00557
pixels_struct *pixels );
00558
00559
public void initialize_resample_volume(
00560
resample_struct *resample,
00561 Volume src_volume,
00562 General_transform *dest_to_src_transform,
00563 Volume dest_volume );
00564
00565
public BOOLEAN
do_more_resampling(
00566
resample_struct *resample,
00567 Real max_seconds,
00568 Real *fraction_done );
00569
00570
public void resample_volume(
00571 Volume src_volume,
00572 General_transform *dest_to_src_transform,
00573 Volume dest_volume );
00574
00575
public void scan_lines_to_voxels(
00576
lines_struct *lines,
00577 Volume volume,
00578 Volume label_volume,
00579
int label );
00580
00581
public void scan_marker_to_voxels(
00582
marker_struct *marker,
00583 Volume volume,
00584 Volume label_volume,
00585
int label );
00586
00587
public void scan_object_to_volume(
00588
object_struct *object,
00589 Volume volume,
00590 Volume label_volume,
00591
int label,
00592 Real max_distance );
00593
00594
public void scan_polygons_to_voxels(
00595
polygons_struct *polygons,
00596 Volume volume,
00597 Volume label_volume,
00598
int label,
00599 Real max_distance );
00600
00601
public void scan_quadmesh_to_voxels(
00602
quadmesh_struct *quadmesh,
00603 Volume volume,
00604 Volume label_volume,
00605
int label,
00606 Real max_distance );
00607
00608
public Volume
smooth_resample_volume(
00609 Volume volume,
00610
int new_nx,
00611
int new_ny,
00612
int new_nz );
00613
00614
public void convert_voxel_to_talairach(
00615 Real x_voxel,
00616 Real y_voxel,
00617 Real z_voxel,
00618
int nx_voxels,
00619
int ny_voxels,
00620
int nz_voxels,
00621 Real *x_tal,
00622 Real *y_tal,
00623 Real *z_tal );
00624
00625
public void convert_talairach_to_voxel(
00626 Real x_tal,
00627 Real y_tal,
00628 Real z_tal,
00629
int nx_voxels,
00630
int ny_voxels,
00631
int nz_voxels,
00632 Real *x_voxel,
00633 Real *y_voxel,
00634 Real *z_voxel );
00635
00636
public void convert_talairach_to_mm(
00637 Real x_tal,
00638 Real y_tal,
00639 Real z_tal,
00640 Real *x_mm,
00641 Real *y_mm,
00642 Real *z_mm );
00643
00644
public void convert_mm_to_talairach(
00645 Real x_mm,
00646 Real y_mm,
00647 Real z_mm,
00648 Real *x_tal,
00649 Real *y_tal,
00650 Real *z_tal );
00651
#endif