Initializes a new STLCell object with explicit parameters.
constructor(
viewer: MedicalViewer,
path: string,
divID: string
);
viewer
The parent medical viewer
path
the path to a URL file that contains the mesh. Can be empty if you want to load from a URL instead.
divID
The id of the cell
To load the STLCell from a local file, refer to Load or pass the path parameter to the constructor. For adding or loading an STLCell to the MedicalViewer, refer to the following:
Member | Description |
---|---|
Layout | Property to add STLCell to the MedicalViewer. |
Load | Method to load the STLCell from a local file. |
LoadFromURL | Method to load the STLCell from a Url. |
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>
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document