@@ -20,7 +20,6 @@ var str2RgbaArray = require('../../lib/str2rgbarray');
20
20
21
21
var MIN_RESOLUTION = 128 ;
22
22
23
-
24
23
function SurfaceTrace ( scene , surface , uid ) {
25
24
this . scene = scene ;
26
25
this . uid = uid ;
@@ -136,7 +135,7 @@ function refine(coords) {
136
135
Math . floor ( ( coords [ 0 ] . shape [ 1 ] ) * scaleF + 1 ) | 0 ] ;
137
136
var nsize = nshape [ 0 ] * nshape [ 1 ] ;
138
137
139
- for ( var i = 0 ; i < 3 ; ++ i ) {
138
+ for ( var i = 0 ; i < coords . length ; ++ i ) {
140
139
var padImg = padField ( coords [ i ] ) ;
141
140
var scaledImg = ndarray ( new Float32Array ( nsize ) , nshape ) ;
142
141
homography ( scaledImg , padImg , [ scaleF , 0 , 0 ,
@@ -230,9 +229,6 @@ proto.update = function(data) {
230
229
} ) ;
231
230
}
232
231
233
- //Refine if necessary
234
- this . dataScale = refine ( coords ) ;
235
-
236
232
var params = {
237
233
colormap : colormap ,
238
234
levels : [ [ ] , [ ] , [ ] ] ,
@@ -249,10 +245,30 @@ proto.update = function(data) {
249
245
dynamicColor : [ [ 1 , 1 , 1 , 1 ] , [ 1 , 1 , 1 , 1 ] , [ 1 , 1 , 1 , 1 ] ] ,
250
246
dynamicWidth : [ 1 , 1 , 1 ] ,
251
247
dynamicTint : [ 1 , 1 , 1 ] ,
252
- opacity : 1 ,
253
- colorBounds : [ data . zmin * scaleFactor [ 2 ] , data . zmax * scaleFactor [ 2 ] ]
248
+ opacity : 1
249
+ // TODO: Need to think about how to calculate this
250
+ /*
251
+ intensityBounds: [
252
+ data.zmin * scaleFactor[2],
253
+ data.zmax * scaleFactor[2]]
254
+ */
254
255
} ;
255
256
257
+ //Refine if necessary
258
+ if ( 'intensity' in data ) {
259
+ var intensity = ndarray (
260
+ new Float32Array ( xlen * ylen ) , [ xlen , ylen ] ) ;
261
+ fill ( intensity , function ( row , col ) {
262
+ return data . intensity [ col ] [ row ] ;
263
+ } ) ;
264
+ coords . push ( intensity ) ;
265
+ }
266
+
267
+ this . dataScale = refine ( coords ) ;
268
+
269
+ if ( 'intensity' in data ) {
270
+ params . intensity = coords . pop ( ) ;
271
+ }
256
272
257
273
if ( 'opacity' in data ) {
258
274
if ( data . opacity < 1 ) {
@@ -300,6 +316,8 @@ proto.update = function(data) {
300
316
}
301
317
302
318
params . coords = coords ;
319
+
320
+
303
321
surface . update ( params ) ;
304
322
305
323
surface . highlightEnable = highlightEnable ;
0 commit comments