TELEMED Real Time Imaging for the Research User Manual

June 10, 2024
TELEMED

TELEMED Real Time Imaging for the Research

Introduction

TELEMED releases a dynamic link library (DLL) that allows to call of TELEMED SDK functions and to perform real-time ultrasound image data acquisition and imaging from other programming platforms such as MATLAB, Python etc. This opens new possibilities for researchers developing image processing algorithms for biomedical ultrasound or combining ultrasonic imaging with other modalities.

  • Receive real-time ultrasound images in platform which is convenient to you (MATLAB, Python, LabVIEW or other which is capable to call C++ DLL library which links to TELEMED SDK)
  • Sample programs for MATLAB, Python and LabVIEW are provided
  • Source codes of C++ wrapper DLL are provided
  • Possibilities to implement majority scanning controls and to control ultrasound imaging parameters from the convenient platform
  • Possibilities to combine or superimpose ultrasound images with images from another modality in real-time
  • Possibilities for development and evaluation of image processing techniques and algorithms working in real-time for:
    • Speckle reduction
    • Image enhancement
    • Image Restoration
    • Segmentation of regions of interest
    • Parametric analysis of images (texture quantitative measurements)

DLL usgfw2wrapper.dll purpose and description

DLL usgfw2wrapper.dll is a C++ program that operates as a wrapper between TELEMED SDK written in C++ and other programming platforms which are capable to call DLLs, such as MATLAB, Python or LabView. The library allows to initialization of the ultrasound scanner and to the acquisition of ultrasound image data in real-time. Currently, the library contains the following functions, which could be called from external software:

Function

|

Description

|

Input/Output

---|---|---
on_init()| Function initializes variables,

objects and handles used in further calls.

| None/None (Void)
init_ultrasound_usgfw2()| Function creates main Usgfw2 library object.| None/returns int32, value 3 in case of success for error

handling

find_connected_probe()| Function detects connected ultrasound probe.| None/return int32, value 101 in case of success (if probe detected)
data_view_function()| Function creates main

ultrasound scanning object for detected probe.

| None/return int32, value 100 in

case of success (if probe detected)

mixer_control_function(int32, int32, int32, int32, int32, int32, int32)| Function creates B mixer control.

Image width and height are passed into a function by first 4 parameters.

| Input parameters are: int32 – left coordinate of imaging rectangle (i.e. 0) int32 – top coordinate of imaging rectangle (i.e. 0) int32 – right coordinate of

imaging rectangle (i.e. 512) int32 – bottom coordinate of imaging rectangle (i.e. 512) int32 – R

int32 – G

int32 – B – RGB values for image background, (0,0,0) – black

Output

Return int32, value 89 in case of success

get_resolution(singlePtr, singlePtr)| Function returns pixel size (resolution) in x and y dimensions in mm for imaging axis.| Input:

Pointer to float value (resolution X) Pointer to float value (resolution Y)

return_pixel_values(uint32Ptr)| Function returns buffer with pixel values of current frame in BGRA order, for further imaging purposes array must

be reshaped.

| Input:

Pointer to initialized uint32 array of size (wh4), where w

– image width, h – image height

Run_ultrasound_scanning()| Function to run scanning| None/None (Void)
Freeze_ultrasound_scanning()| Function to freeze ultrasound scanning| None/None (Void)
Stop_ultrasound_scanning()| Function to stop ultrasound scanning| None/None (Void)
Close_and_release()| Function releases all initialized variables, objects, controls and variables.| None/None (Void)

Please note:
The function return_pixel_values calls SDK function GetCurrentBitmap and that means that there is a possibility of missing or duplicate frames which were originally obtained during scanning if the imaging speed in the external calling program do not match the scanning speed of the ultrasound scanner. We recommend to set pauses in imaging loop to match frame-grabbing speed with scanning speed (it should not exceed frame rate shown in Echo Wave 2 software to avoid duplicate frames).

It is possible to control the majority of imaging parameters (such as imaging depth, scanning frequency, gain and others) running the main TELEMED Echo Wave 2 software in parallel to external program which receives real-time ultrasound images. The functions for controlling scanning parameters (controls) in your custom application could be implemented as well by modifying wrapper DLL code because we provide source codes of it (Source codes of the wrapper project could be found in the directory ..\usgfw2wrapper_C++_sources\usgfw2wrapper). So, you can supplement existing functions listed in table above by your functions which could be called from external application. To familiarize with TELEMED SDK possibilities we invite you to read Ultrasonography for Windows II Software Development Kit (Usgfw2 SDK) Programmer’s Guide.

MATLAB, Python and LabView samples

We provide sample programs for MATLAB, Python and LabVIEW. All the samples written for different languages works about the same. The workflow is to initialize ultrasound scanner, to acquire real-time ultrasound images and display them. MATLAB and LabVIEW samples contains minimalistic graphical user interfaces (GUI), which has buttons “Run” and “Freeze” and FPS scanning speed indicator. For Python we provide only the script which acts about the same. You must start the software for these samples by using Administrator rights to run them successfully. You can find the following files for sample programs in a package:

Filename Description
usgfw2MATLAB.m MATLAB script for calling DLL and displaying ultrasound images

in-real time.
GUI_MATLAB_usgfw2.m GUI_MATLAB_usgfw2.fig| MATLAB GUI with “Run” and “Freeze” buttons for ultrasound imaging control.
usgfw2python.py| Python script for calling DLL and displaying ultrasound images in real-

time.

usgfw2labview.vi| LabVIEW sample GUI for calling DLL and displaying ultrasound images in- real time with “Run” and “Freeze” buttons for ultrasound imaging control.

We will analyse the first MATLAB script in the User Manual, meanwhile others are the repetition of it just with specific functions for imaging of each programming language.

Threshold = 1000; %% number of iterations to break imaging loop (currently there are two ways how to stop ultrasound scanning in this script, by setting number of iterations in other words frames to be displayed and manually by Ctrl+C, in case of manual termination you have to call:

Please note:
Currently, wrapper DLL was compiled for the x64 bit version, so TELEMED SDK x64 must be installed as well. For successfully running MATLAB samples Microsoft Windows SDK 7 must be installed (x64 version), Download Microsoft Windows SDK for Windows 7 and .NET Framework 4 from Official Microsoft Download Center, because some header files are needed for running MATLAB samples. You must have an installation in the following path “C:\Program Files\Microsoft SDKs\Windows\v7.1\Include”, or if the installation path slightly differs you have to recompile the usgfw2wrapper project including the DIR to your Microsoft Windows SDK (x64). MATLAB scripts were prepared by using the 2020a version (for older versions it might be necessary to install the MinGW-w64 C/C++ compiler).

Figures for all samples

MATLAB sample GUI:

Python sample script:

LabVIEW sample GUI:

Revision History

Version Date Description of Revision Revision author
1.0.0 18/05/2022 Initial Release A. Sakalauskas

Ultrasound Medical Systems

References

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals