@@ -246,7 +246,8 @@ var logpoint = function(e, template, type){
246
246
//console.log("pushed contours", contours)
247
247
}
248
248
249
-
249
+ var world = new papaya . core . Coordinate ( ) ;
250
+ papayaContainers [ 0 ] . viewer . getWorldCoordinateAtIndex ( originalCoord . x , originalCoord . y , originalCoord . z , world ) ;
250
251
var selectContour = getSelectedDrawing ( template ) //contours[contours.length-1].contours //OR: selected contour
251
252
//console.log("selectContours is", selectContour)
252
253
if ( selectContour . length == 0 ) {
@@ -260,6 +261,7 @@ var logpoint = function(e, template, type){
260
261
selectContour . push ( { complete : false , matrix_coor :[ ] , world_coor :[ ] } )
261
262
currentContour = selectContour [ selectContour . length - 1 ]
262
263
currentContour . matrix_coor . push ( originalCoord )
264
+ currentContour . world_coor . push ( world )
263
265
}
264
266
template . contours . set ( contours )
265
267
Session . set ( "isDrawing" , true )
@@ -272,7 +274,8 @@ var logpoint = function(e, template, type){
272
274
273
275
//papayaContainers[0].viewer.cursorPosition isn't updated on mousedrag
274
276
var originalCoord = papayaContainers [ 0 ] . viewer . convertScreenToImageCoordinate ( screenCoor . x , screenCoor . y , viewer . mainImage ) ;
275
-
277
+ var world = new papaya . core . Coordinate ( ) ;
278
+ papayaContainers [ 0 ] . viewer . getWorldCoordinateAtIndex ( originalCoord . x , originalCoord . y , originalCoord . z , world ) ;
276
279
var contours = template . contours . get ( )
277
280
278
281
if ( contours . length ) {
@@ -284,7 +287,7 @@ var logpoint = function(e, template, type){
284
287
if ( currentContour . complete == false ) {
285
288
286
289
currentContour . matrix_coor . push ( originalCoord )
287
- // currentContour.world_coor.push(world)
290
+ currentContour . world_coor . push ( world )
288
291
template . contours . set ( contours )
289
292
Session . set ( "isDrawing" , true )
290
293
@@ -624,15 +627,16 @@ Template.view_images.helpers({
624
627
var images = Session . get ( "loadableImages" )
625
628
var to_display = [ ]
626
629
var output = [ ]
627
-
628
- images . forEach ( function ( val , idx , arr ) {
629
- var last = val . split ( "/" ) . pop ( )
630
- var tmp = { }
631
- tmp [ "absolute_path" ] = images [ idx ]
632
- tmp [ "name" ] = last
633
- to_display . push ( tmp )
634
- } )
635
- return to_display
630
+ if ( images ) {
631
+ images . forEach ( function ( val , idx , arr ) {
632
+ var last = val . split ( "/" ) . pop ( )
633
+ var tmp = { }
634
+ tmp [ "absolute_path" ] = images [ idx ]
635
+ tmp [ "name" ] = last
636
+ to_display . push ( tmp )
637
+ } )
638
+ return to_display
639
+ }
636
640
}
637
641
638
642
0 commit comments