File tree 1 file changed +10
-8
lines changed
src/brainbrowser/volume-viewer/volume-loaders
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 141
141
var i = 0 ;
142
142
143
143
z = z_positive ? slice_num : axis_space . space_length - slice_num - 1 ;
144
- tz_offset = time_offset + z * axis_space_offset ;
144
+ if ( z >= 0 && z < axis_space . space_length ) {
145
+ tz_offset = time_offset + z * axis_space_offset ;
145
146
146
- for ( row = height - 1 ; row >= 0 ; row -- ) {
147
- y = y_positive ? row : height - row - 1 ;
148
- tzy_offset = tz_offset + y * height_space_offset ;
147
+ for ( row = height - 1 ; row >= 0 ; row -- ) {
148
+ y = y_positive ? row : height - row - 1 ;
149
+ tzy_offset = tz_offset + y * height_space_offset ;
149
150
150
- for ( col = 0 ; col < width ; col ++ ) {
151
- x = x_positive ? col : width - col - 1 ;
152
- tzyx_offset = tzy_offset + x * width_space_offset ;
151
+ for ( col = 0 ; col < width ; col ++ ) {
152
+ x = x_positive ? col : width - col - 1 ;
153
+ tzyx_offset = tzy_offset + x * width_space_offset ;
153
154
154
- slice_data [ i ++ ] = volume . data [ tzyx_offset ] ;
155
+ slice_data [ i ++ ] = volume . data [ tzyx_offset ] ;
156
+ }
155
157
}
156
158
}
157
159
You can’t perform that action at this time.
0 commit comments