@@ -164,7 +164,7 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
164164 * function. The function will receive the model description and the model name
165165 * as arguments.
166166 * ```js
167- * viewer.model_data.forEach(function(mode_data , model_name) {
167+ * viewer.model_data.forEach(function(model_data , model_name) {
168168 * console.log(model_name, model_data.vertices.length);
169169 * });
170170 * ```
@@ -363,9 +363,9 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
363363 ////////////////////////////////////
364364
365365 function loadModel ( data , filename , options ) {
366- options = options || { } ;
367- var type = options . format || "mniobj" ;
368- var parse_options = options . parse || { } ;
366+ options = options || { } ;
367+ var type = options . format || "mniobj" ;
368+ var parse_options = options . parse || { } ;
369369
370370 // Parse model info based on the given file type.
371371 parseModel ( data , type , parse_options , function ( model_data ) {
@@ -376,12 +376,12 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
376376 }
377377
378378 function loadIntensityData ( text , filename , options ) {
379- options = options || { } ;
380- var name = options . name || filename ;
381- var type = options . format || "text" ;
382- var blend = options . blend ;
383- var model_name = options . model_name ;
384- var model_data = viewer . model_data . get ( model_name ) ;
379+ options = options || { } ;
380+ var name = options . name || filename ;
381+ var type = options . format || "text" ;
382+ var blend = options . blend ;
383+ var model_name = options . model_name ;
384+ var model_data = viewer . model_data . get ( model_name ) ;
385385 var intensity_data = model_data . intensity_data [ 0 ] ;
386386
387387 var old_range = { } ;
@@ -564,18 +564,18 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
564564 ///////////////////////////////////////////
565565
566566 // Creates three.js objects based on the
567- // description in **model_data** and
567+ // description in **model_data** and
568568 // displays in on the viewer.
569569 function displayModel ( model_data , filename , options ) {
570- options = options || { } ;
570+ options = options || { } ;
571571 var complete = options . complete ;
572572
573573 var new_shapes = createModel ( model_data , filename , options ) ;
574574
575575 viewer . triggerEvent ( "displaymodel" , {
576- model : viewer . model ,
576+ model : viewer . model ,
577577 model_data : model_data ,
578- new_shapes : new_shapes
578+ new_shapes : new_shapes ,
579579 } ) ;
580580
581581 if ( complete ) complete ( ) ;
@@ -586,13 +586,13 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
586586 // object, though they may share attributes and
587587 // buffers.
588588 function createModel ( model_data , filename , options ) {
589- var model = viewer . model ;
590- var shapes = model_data . shapes ;
591- var is_line = model_data . type === "line" ;
592- var render_depth = options . render_depth ;
593- var pick_ignore = options . pick_ignore ;
594- var recenter = options . recenter || model_data . split ;
595- var new_shapes = [ ] ;
589+ var model = viewer . model ;
590+ var shapes = model_data . shapes ;
591+ var is_line = model_data . type === "line" ;
592+ var render_depth = options . render_depth ;
593+ var pick_ignore = options . pick_ignore ;
594+ var recenter = options . recenter || model_data . split ;
595+ var new_shapes = [ ] ;
596596 var shape , shape_data ;
597597 var i , count ;
598598 var object_description = { is_line : is_line } ;
@@ -628,9 +628,9 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
628628
629629 object_description = {
630630 position : position_buffer ,
631- normal : normal_buffer ,
632- color : color_buffer ,
633- index : new THREE . BufferAttribute ( new Uint32Array ( shape_data . indices ) , 1 ) ,
631+ normal : normal_buffer ,
632+ color : color_buffer ,
633+ index : new THREE . BufferAttribute ( new Uint32Array ( shape_data . indices ) , 1 ) ,
634634 } ;
635635
636636 } else {
@@ -649,26 +649,26 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
649649
650650 object_description = {
651651 position : position_buffer ,
652- normal : normal_buffer ,
653- color : color_buffer
652+ normal : normal_buffer ,
653+ color : color_buffer
654654 } ;
655655
656656 }
657657
658- object_description . is_line = is_line ;
658+ object_description . is_line = is_line ;
659659 object_description . centroid = shape_data . centroid ;
660660 object_description . recenter = recenter ;
661661
662- shape = createShape ( object_description ) ;
662+ shape = createShape ( object_description ) ;
663663 shape . name = shape_data . name || filename + "_" + ( i + 1 ) ;
664664
665665 shape . userData . model_name = model_data . name ;
666666
667667 shape . userData . original_data = {
668668 vertices : model_data . vertices ,
669- indices : shape_data . indices ,
670- normals : model_data . normals ,
671- colors : model_data . colors
669+ indices : shape_data . indices ,
670+ normals : model_data . normals ,
671+ colors : model_data . colors ,
672672 } ;
673673
674674 shape . userData . pick_ignore = pick_ignore ;
@@ -694,14 +694,14 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
694694 // a shape from the model data 'shapes'
695695 // array.
696696 function createShape ( object_description ) {
697- var position = object_description . position ;
697+ var position = object_description . position ;
698698 var position_array = position . array ;
699- var normal = object_description . normal ;
700- var color = object_description . color ;
701- var index = object_description . index ;
702- var centroid = object_description . centroid ;
703- var is_line = object_description . is_line ;
704- var recenter = object_description . recenter ;
699+ var normal = object_description . normal ;
700+ var color = object_description . color ;
701+ var index = object_description . index ;
702+ var centroid = object_description . centroid ;
703+ var is_line = object_description . is_line ;
704+ var recenter = object_description . recenter ;
705705
706706 var geometry = new THREE . BufferGeometry ( ) ;
707707 var index_array , tmp_position_array , position_index ;
@@ -748,10 +748,10 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
748748
749749 if ( is_line ) {
750750 material = new THREE . LineBasicMaterial ( { vertexColors : THREE . VertexColors } ) ;
751- shape = new THREE . Line ( geometry , material , THREE . LinePieces ) ;
751+ shape = new THREE . Line ( geometry , material , THREE . LinePieces ) ;
752752 } else {
753753 material = new THREE . MeshPhongMaterial ( { color : 0xFFFFFF , ambient : 0xFFFFFF , specular : 0x101010 , shininess : 150 , vertexColors : THREE . VertexColors } ) ;
754- shape = new THREE . Mesh ( geometry , material ) ;
754+ shape = new THREE . Mesh ( geometry , material ) ;
755755 shape . userData . has_wireframe = true ;
756756 }
757757
0 commit comments