Click here to Skip to main content
15,879,326 members
Articles / Web Development / HTML5
Article

Cross-Platform HTML5 Compliant Medical Imaging with LEADTOOLS

Rate me:
Please Sign up or sign in to vote.
4.80/5 (3 votes)
20 Oct 2017CPOL 7.9K   1  
The LEADTOOLS® HTML5 Zero-footprint Medical Viewer helps shorten the learning curve for developers to build applications that support DICOM. It is the perfect way to quickly get started building medical applications that are accessible from any device.

This Review is from our sponsors at CodeProject. These reviews are intended to provide you with information on products and services that we consider useful and of value to developers.

DICOM is the standard for storing and transmitting medical images. In the past, viewing DICOM was only possible with fat desktop clients that required local installation on specific hardware and platforms. LEADTOOLS®, the leading provider of imaging SDKs, developed a zero-footprint DICOM viewer that can be used from any browser on any platform without installing plug-ins or local software. It is the perfect way to rapidly develop a medical imaging application that can be deployed to a centralized server and accessed from anywhere.

DICOM was developed in the mid-1980s to address the issues with disparate imaging technologies. The American College of Radiology (ACR) and National Electrical Manufacturers Association (NEMA) created the ACR/NEMA 300 standard in 1985 (see this paper for background: https://uncch.pure.elsevier.com/en/publications/dicom-a-standard-for-medical-imaging). It was subsequently revised and has been on version 3.0 since 1993 with later extensions and revisions. The official web page for the standard is: http://dicom.nema.org/. This article reviews the tools released that make it possible to quickly build a fully functional, cross-platform and cross-browser application that supports advanced interactions with DICOM images.

Product Installation

You can quickly and easily review the tool for yourself. Navigate to the main site at: https://www.leadtools.com/ and click on the “Download” option. Expand the “Raster, Document, and Medical Evaluation Downloads” and choose the download for your platform. This article focuses on the Windows installation.

Quick Start Demo

After you’ve downloaded and installed the tool, it possible to get up and running in minutes to see and interact with the viewer control. Just follow the steps outlined in the following tutorial.

https://www.leadtools.com/help/leadtools/v19/dh/medical/to/displayinganimageintheleadtoolshtml5medicalwebviewer.html

The tutorial leads you through a few steps that include creating an HTML page, writing some JavaScript and copying some files that ultimately result in a single-page medical viewer application. The JavaScript creates the viewer control, authenticates with the server, then sets the URI for the image to a service call that returns the necessary data. The controls take care of the rest!

Image 1

Figure 1: Quick Start App

You can take some time to view this simple example. The download contains a far more comprehensive project that provides a full application.

Deep Dive Demo

There are a few prerequisites for the tools that are included with the product readme. Specifically, you should have an instance of IIS Server available to run the web applications and a SQL Server instance to load the database to on Windows servers. The download unzips dozens of sample projects, files, and source code. After installing the download, you can select “LEADTOOLS Main Eval xx” (where xx is the version; this article was written using version 19) from the Start Menu. Navigate to the “DICOM” folder then to the “JavaScript” folder. Finally, open the “Medical Web Viewer” folder.

Launching the demo for the first time requires two steps. These are shortcuts in the folder to set up your environment.

Image 2

Figure 2: Folder with Demos

The first step will verify whether or not your database is configured. If not, it will prompt you to connect to SQL Server and populate the required databases. After this step is completed, you will see a dialog for the various services that drive the medical viewer demos.

Image 3

Figure 3: Demo Configuration (First Step)

Choose “Configure” to set up the services and verify they are operating. At any time, tap “Retest” to re-validate the services are running. Be sure to note down any usernames and passwords you set up as you will need them to access the tool later on.

Tip: If you receive a validation error, ensure that your SQL Server instance is running and that the LEADTOOLS® services are also running.

Image 4

Figure 4: Services

After you verify your services are configured and running, launch the second step. You can launch this as many times as you like because it will verify the configuration and perform any set up needed each time you run it. Run the viewer from the dialog by clicking the “Launch Viewer” button.

Image 5

Figure 5: Second Demo Step

This will open a web browser and prompt you to login with the username and password you configured earlier.

Viewer Walkthrough

After logging in, you can search records and pull up the related images. As you can see, the application demonstrates more advanced interactions with the controls than the single-page quick start.

Image 6

Figure 6: Main Viewing Window

The sample application uses the Angular JavaScript frontend framework and HTML5 Canvas elements to render images. The full source code is distributed as part of the evaluation download. There are several components involved in rendering this image. The process all starts with an instance of the JavaScript MedicalViewer component.

In Angular, directives are reusable components that apply behavior to the JavaScript Document Object Model (DOM) and optionally render web-based UI. The “LeadTools.MedicalViewer.Directive.ts” source code (in the Scripts/directives folder) defines a reusable component that leverages the MedicalViewer control.

Image 7

This viewer instance can be passed into the constructor of the API class. The directive makes it easier for the application to interact with the viewer control and modify configuration. For example, the directive detects if the browser is on a mobile device and automatically adjusts the rows and columns for a better fit:

Image 8

The directive is attached to an HTML element. You can see this in the “Viewer.html” source (“Views” folder).

Image 9

Although the directive serves to provide a target for actions, a controller is needed to orchestrate the actions. The controller determines what patient is being viewed and passes the right images to the directive. To examine this code, look at “TabService.ts” in “Services” under “Scripts” that instantiates an instance of “ViewController.ts” in “Controllers.”

Magnify your Results

From the tool, click the magnifying glass with a plus sign and then click and scroll over the canvas. You will see a Magnifying effect.

Image 10

Figure 7: The Magnify Effect

The directive for the medical viewer uses the MagnifyAction control.

Image 11

When the toolbar item is pressed, the control activates.

cell.runCommand(MedicalViewerAction.Magnify);

As you can see, all of the code is pure, cross-browser compliant JavaScript.

Additional Effects

The sample application provides code for additional effects as well. All of the effects are driven by commands generated when you click on the appropriate toolbar icon. For example, one effect enables you to zoom in or out.

Image 12

Figure 8: Zoomed View

Another allows you to adjust the window level for the image. The following graphic shows the result of scrolling through three different levels.

Image 13

Figure 9: Various Window Levels

You can see how these effects are loaded to the toolbar by inspecting the “ToolbarService.ts” source in the “Services” folder under “Scripts.” Here are a few options being added:

Image 14

Pressing an item simply executes a command that generates an event that the controllers can listen to interact with the controls in an appropriate manner.

Image 15

At Your Service

The JavaScript controls provide a complete solution for rendering and manipulating image data in the browser, but an important component of the application is the services that provide the data. To understand how the information is streamed to the client, open the “Leadtools.Medical.WebViewer.WCF_2” project located in the “Examples/DotNet/PACSFramework/MedicalWebViewer/Leadtools.Medical.WebViewer.WCF” path. This contains the .NET code for the services that provide studies, layouts, and image information.

A typical request for a DICOM image looks like this:

Get Study Layout

This call retrieves information about the study, including the child series, rows and columns and related image data for the study.

Get Series Thumbnail

This returns a thumbnail that can be rendered by the browser to preview the study.

Get Series Stacks

The stacks represent sequences of images that are part of a study. These have unique reference numbers and are sorted in the data source. The following example is the response for a study that has two instances in the series.

Image 16

Get Series Layout

The layout for a specific series has a name, template, icon, and images that are part of the series.

Get Image Tile

This call retrieves the actual data used to render the images. This data is passed to the JavaScript control to render. It comes across as an image file, but requires custom processing and rendering due to the additional data that is stored in the format. Using this file, the JavaScript control has the information it needs to render the images, pan, zoom, magnify, and adjust levels as needed.

Get DICOM JSON

The final call retrieves all of the related information for the DICOM image in a JSON format to display on the client.

Image 17

Figure 10: DICOM Information

Conclusion

The DICOM standard supports incredibly information-rich images and related metadata. The LEADTOOLS® SDK offers unprecedented access to deliver interactive experiences across all devices. This is possible due to the included support for HTML5 and JavaScript standards. The example application illustrates a full patient records database implemented leveraging a standard N-tier .NET-based application with a data access layer to SQL Server, a web service layer, and a front-end Single Page Application (SPA) that leverages Angular. The example provides everything you need to understand how to instantiate and interface with the various controls.

Image 18

Figure 11: Architecture Overview

For further information you can visit the comprehensive online documentation. The following link references the WebView overview for HTML5 and JavaScript:

https://www.leadtools.com/help/leadtools/v19/dh/medical/to/leadtoolshtml5medicalwebviewerframeworkoverview.html

The LEADTOOLS® HTML5 Zero-footprint Medical Viewer helps shorten the learning curve for developers to build applications that support DICOM. In addition to the fast, cross-platform support, the SDK is compatible with touch-enabled devices and gestures, handles image processing, works with annotations and supports both pre-defined and custom layouts. It is the perfect way to quickly get started building medical applications that are accessible from any device.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Program Manager Microsoft
United States United States
Note: articles posted here are independently written and do not represent endorsements nor reflect the views of my employer.

I am a Program Manager for .NET Data at Microsoft. I have been building enterprise software with a focus on line of business web applications for more than two decades. I'm the author of several (now historical) technical books including Designing Silverlight Business Applications and Programming the Windows Runtime by Example. I use the Silverlight book everyday! It props up my monitor to the correct ergonomic height. I have delivered hundreds of technical presentations in dozens of countries around the world and love mentoring other developers. I am co-host of the Microsoft Channel 9 "On .NET" show. In my free time, I maintain a 95% plant-based diet, exercise regularly, hike in the Cascades and thrash Beat Saber levels.

I was diagnosed with young onset Parkinson's Disease in February of 2020. I maintain a blog about my personal journey with the disease at https://strengthwithparkinsons.com/.


Comments and Discussions

 
-- There are no messages in this forum --