00001
#undef TWO
00002
#ifdef TWO_VOLUMES
00003
#define TWO( x ) x
00004
#else
00005 #define TWO( x )
00006
#endif
00007
00008
00009
00010
00011 (
00012 void *
volume_data1,
00013
int y,
00014
int start_x,
00015
int end_x,
00016
int **
y_offsets1,
00017
int **
row_offsets1,
00018
#ifndef ONE_SLICE
00019
void **
start_slices1,
00020
int n_slices1,
00021 Real
weights1[],
00022
#endif
00023
#ifdef TWO_VOLUMES
00024
void *volume_data2,
00025
int **y_offsets2,
00026
int **row_offsets2,
00027
#ifndef ONE_SLICE
00028
void **start_slices2,
00029
int n_slices2,
00030 Real weights2[],
00031
#endif
00032
#endif
00033
#ifdef COLOUR_MAP
00034
unsigned short **cmode_colour_map,
00035
unsigned short *pixel_ptr
00036
#else
00037
#ifndef NO_COLOUR_TABLE
00038
Colour **
rgb_colour_map,
00039
#endif
00040
Colour *pixel_ptr
00041
#endif
00042
)
00043
00044 {
00045
int x;
00046
#ifdef ONE_SLICE
00047
TYPE1 *ptr1;
00048
int *offset_ptr1;
00049
#ifdef TWO_VOLUMES
00050
TYPE2 *ptr2;
00051
int *offset_ptr2;
00052
#endif
00053
#else
00054
int s;
00055
TYPE1 **start_data1;
00056 Real real_voxel_data1;
00057
#ifdef TWO_VOLUMES
00058
TYPE2 **start_data2;
00059 Real real_voxel_data2;
00060
#endif
00061
#endif
00062
#ifndef TWO_VOLUMES
00063
#ifdef COLOUR_MAP
00064
unsigned short *single_cmode_map = cmode_colour_map[0];
00065
#else
00066
#ifndef NO_COLOUR_TABLE
00067
Colour *single_rgb_map =
rgb_colour_map[0];
00068
#endif
00069
#endif
00070
#endif
00071
00072
#ifndef ONE_SLICE
00073
start_data1 = (
TYPE1 **)
start_slices1;
00074
TWO( start_data2 = (
TYPE2 **) start_slices2; )
00075 #endif
00076
00077
#ifdef ONE_SLICE
00078
ptr1 = &((
TYPE1 *)
volume_data1) [
y_offsets1[0][
y]];
00079 offset_ptr1 = &
row_offsets1[0][
start_x];
00080
TWO( ptr2 = &((
TYPE2 *) volume_data2) [y_offsets2[0][
y]]; )
00081
TWO( offset_ptr2 = &row_offsets2[0][
start_x]; )
00082 #
else
00083 for_less( s, 0,
n_slices1 )
00084 start_data1[s] = &((
TYPE1 *)
volume_data1) [
y_offsets1[s][
y]];
00085
#ifdef TWO_VOLUMES
00086
for_less( s, 0, n_slices2 )
00087 start_data2[s] = &((
TYPE2 *) volume_data2) [y_offsets2[s][
y]];
00088
#endif
00089
#endif
00090
00091 for_inclusive( x,
start_x,
end_x )
00092 {
00093
#ifdef ONE_SLICE
00094
#ifdef TWO_VOLUMES
00095
#ifdef COLOUR_MAP
00096
*pixel_ptr++ = cmode_colour_map[(
long) ptr1[*offset_ptr1++]]
00097 [(
long) ptr2[*offset_ptr2++]];
00098
#else
00099
*pixel_ptr++ =
rgb_colour_map[(
long) ptr1[*offset_ptr1++]]
00100 [(
long) ptr2[*offset_ptr2++]];
00101
#endif
00102
#else
00103
#ifdef COLOUR_MAP
00104
*pixel_ptr++ = single_cmode_map[(
long) ptr1[*offset_ptr1++]];
00105
#else
00106
#ifdef NO_COLOUR_TABLE
00107
*pixel_ptr++ = ptr1[*offset_ptr1++];
00108
#else
00109
*pixel_ptr++ = single_rgb_map[(
long) ptr1[*offset_ptr1++]];
00110
#endif
00111
#endif
00112
#endif
00113
#else
00114
real_voxel_data1 = 0.5;
00115 for_less( s, 0,
n_slices1 )
00116 {
00117 real_voxel_data1 +=
weights1[s] *
00118 (Real) start_data1[s][
row_offsets1[s][x]];
00119 }
00120
00121
#ifdef TWO_VOLUMES
00122
real_voxel_data2 = 0.5;
00123 for_less( s, 0, n_slices2 )
00124 {
00125 real_voxel_data2 += weights2[s] *
00126 (Real) start_data2[s][row_offsets2[s][x]];
00127 }
00128
00129
#ifdef COLOUR_MAP
00130
*pixel_ptr++ = cmode_colour_map[(
long) real_voxel_data1]
00131 [(
long) real_voxel_data2];
00132
#else
00133
*pixel_ptr++ =
rgb_colour_map[(
long) real_voxel_data1]
00134 [(
long) real_voxel_data2];
00135
#endif
00136
#else
00137
00138
#ifdef COLOUR_MAP
00139
*pixel_ptr++ = single_cmode_map[(
long) real_voxel_data1];
00140
#else
00141
*pixel_ptr++ = single_rgb_map[(
long) real_voxel_data1];
00142
#endif
00143
#endif
00144
#endif
00145 }
00146 }