load Method

Summary

Loads an STL file using the specified

fileName.
Syntax
TypeScript
JavaScript
STLCell.prototype.load = function( 
   fileName 
) 
load( 
   fileName: string 
): void; 

Parameters

fileName

The file name of the STL file to load.

Remarks

To load the STL file from a URL, refer to LoadFromURL.

Example
STLCell.js
MedicalViewer_Example.js
STLCell.ts
MedicalViewer_Example.ts
STLCell.html
import { MedicalViewer_Example } from "../MedicalViewer_Example"; 
 
 
export class STLCell_Example { 
    constructor() { 
        this.run = (medicalViewer) => { 
            this.medicalViewer = medicalViewer; 
            var stlCell = new lt.Controls.Medical.STLCell(medicalViewer, "file.stl", ""); 
            stlCell.load("file.stl"); 
            medicalViewer.layout.cells.add(stlCell); 
            medicalViewer.onSizeChanged(); 
        }; 
        this.viewerExample = new MedicalViewer_Example(this.run); 
    } 
} 
export  class MedicalViewer_Example { 
    constructor(callback) { 
        // LEADTOOLS ImageViewer to be used with this example 
        this.medicalViewer = null; 
        // Generic state value used by the examples 
        this.timesClicked = 0; 
        this.authenticationCode = ""; 
        // Set the LEADTOOLS license. Replace this with your actual license file 
        lt.RasterSupport.setLicenseUri("https://demo.leadtools.com/licenses/js/LEADTOOLSEVAL.txt", "EVAL", null); 
        // Create the medical viewer inside the imageViewerDiv element 
        const imageViewerDiv = document.getElementById("imageViewerDiv"); 
        // create an instance of the medical viewer. 
        this.medicalViewer = new lt.Controls.Medical.MedicalViewer(imageViewerDiv, 2, 2); 
        this.medicalViewer.onSizeChanged(); 
        const exampleButton = document.getElementById("exampleButton"); 
        exampleButton.addEventListener("click", () => { 
            this.timesClicked++; 
            // Run the example 
            if (callback) 
                callback(this.medicalViewer); 
        }); 
    } 
} 
import { MedicalViewer_Example } from "../MedicalViewer_Example"; 
 
 
export class STLCell_Example { 
   private viewerExample; 
   private medicalViewer; 
   constructor() { 
      this.viewerExample = new MedicalViewer_Example(this.run); 
   } 
 
   private run = (medicalViewer: lt.Controls.Medical.MedicalViewer) => { 
      this.medicalViewer = medicalViewer; 
 
      var stlCell: lt.Controls.Medical.STLCell = new lt.Controls.Medical.STLCell(medicalViewer, "file.stl", ""); 
 
      stlCell.load("file.stl");// loadFromURL(objectRetrieveService.GetSTLData(series.seriesInstanceUID)); 
 
      medicalViewer.layout.cells.add(stlCell); 
 
      medicalViewer.onSizeChanged(); 
 
 
   } 
} 
export class MedicalViewer_Example { 
 
   // LEADTOOLS ImageViewer to be used with this example 
   protected medicalViewer: lt.Controls.Medical.MedicalViewer = null; 
   // Generic state value used by the examples 
   public timesClicked: number = 0; 
   public authenticationCode : string = ""; 
 
   constructor(callback?: (medicalViewer: lt.Controls.Medical.MedicalViewer) => void) { 
      // Set the LEADTOOLS license. Replace this with your actual license file 
      lt.RasterSupport.setLicenseUri("https://demo.leadtools.com/licenses/js/LEADTOOLSEVAL.txt", "EVAL", null); 
 
      // Create the medical viewer inside the imageViewerDiv element 
      const imageViewerDiv : HTMLDivElement = <HTMLDivElement>document.getElementById("imageViewerDiv"); 
 
      // create an instance of the medical viewer. 
      this.medicalViewer = new lt.Controls.Medical.MedicalViewer(imageViewerDiv, 2, 2); 
      this.medicalViewer.onSizeChanged(); 
 
      const exampleButton = document.getElementById("exampleButton"); 
      exampleButton.addEventListener("click", () => { 
         this.timesClicked++; 
         // Run the example 
         if (callback) 
            callback(this.medicalViewer); 
      }); 
   } 
} 
<!doctype html> 
<html lang="en"> 
   <title>STL Cell Example</title> 
 
 
<head> 
   <script src="https://code.jquery.com/jquery-2.2.4.min.js" 
      integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> 
 
   <script src="../../LT/Leadtools.js"></script> 
   <script src="../../LT/Leadtools.Controls.js"></script> 
   <script src="../../LT/Leadtools.Annotations.Engine.js"></script> 
   <script src="../../LT/Leadtools.Annotations.Designers.js"></script> 
   <script src="../../LT/Leadtools.Annotations.Rendering.Javascript.js"></script> 
   <script src="../../LT/Leadtools.Annotations.Automation.js"></script> 
   <script src="../../LT/Leadtools.ImageProcessing.Main.js"></script> 
   <script src="../../LT/Leadtools.ImageProcessing.Color.js"></script> 
   <script src="../../LT/Leadtools.ImageProcessing.Core.js"></script> 
   <script src="../../LT/Leadtools.ImageProcessing.Effects.js"></script> 
   <script src="../../LT/Leadtools.Document.js"></script> 
   <script src="../../LT/Leadtools.Document.Viewer.js"></script> 
   <script src="../../LT/Leadtools.Controls.Medical.js"></script> 
   <script src="../../LT/babylon.js"></script> 
   <script src="https://preview.babylonjs.com/babylon.max.js"></script> 
   <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js"></script> 
   
   <style> 
      body { 
         font-family: 'Segoe UI', sans-serif; 
      } 
 
      #imageViewerDiv { 
         border: 1px solid #888; 
         width: 500px; 
         height: 500px; 
         background-color: #eee; 
      } 
   </style> 
 
   <!-- All demo files are bundled and appended to the window --> 
   <script src="../../bundle.js" type="text/javascript"></script> 
</head> 
 
<body  oncontextmenu="return false;"> 
   <p>run the demo and watch the STL cell being generated, rotate the mesh using the left mouse button, move it using the right mouse button, and zoom in/out using the middle mouse button.</p> 
   <div> 
      <button type="button" id="exampleButton">Run Example</button> 
   </div> 
   <div id="imageViewerDiv"></div> 
   <div id="output"></div> 
</body> 
 
<script> 
   window.onload = () => { 
       const example = new window.examples.MedicalViewer.STLCell(); 
 
   }; 
</script> 
</html> 
Requirements

Target Platforms

Help Version 23.0.2024.5.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls.Medical Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.