Technical FAQs
Having the right technology in place is essential for healthcare organizations seeking to deliver better patient outcomes. That’s why medical technology developers are working hard to build the next generation of software tools that will help medical professionals to deliver care more effectively.
Annotation features provide a number of benefits in these ongoing efforts. Although typically associated with editing and workplace collaboration, medical annotations also have a very different and very specific role when it comes to diagnostic imaging and patient health records.
Enhancing Healthcare Collaboration with Annotations
One of the most straightforward use cases for medical annotation is communicating important information regarding diagnostic images. As images like MRIs and X-rays are passed back and forth between providers, radiologists, technicians, and clinicians, the ability to add comments and point out important details greatly reduces the chance of confusion or of some critical detail being overlooked.
The challenge in these cases, however, is to annotate images and documents without altering the integrity of the original files. This requires healthcare technology developers to build solutions that can retain an unaltered version of the file even as multiple collaborators view and make comments.
Medical Annotation and Machine Learning
Healthcare solutions are rapidly incorporating sophisticated machine learning tools to analyze large quantities of data and make a quick, accurate diagnosis of conditions. Before these powerful tools can perform that diagnostic work, they need to be properly trained to know what they’re looking for, especially when it comes to very nuanced differences between scanned images and seemingly unrelated details in patient records.
By using annotation tools, medical technology specialists can provide excellent guidance for machine learning development. An MRI scan, for instance, contains so much information that an AI-driven program isn’t going to know what to look for unless the key elements are called out with annotations that indicate certain parts of the image or provide comments about noteworthy aspects.
The DICOM Dilemma
While many software integrations allow developers to incorporate annotation tools for common file formats like PDF and JPEG, the healthcare sector presents a unique challenge in the form of DICOM files. This industry-specific format contains both images and important metadata identifiers that provide information about the image itself and the patient in question. While there are ways to extract images from DICOM files and convert them into a more manageable format, doing so could endanger compliance status or permanently degrade the image quality.
Developers working on healthcare technology solutions need to make sure they can not only deliver annotation tools, but also the ability to add annotations to DICOM files without altering the source file itself.
Mastering Medical Annotation with ImageGear Medical
ImageGear Medical provides a broad range of XML-based annotation features that allows healthcare software developers to implement UI elements for marking up both images and documents. Since this powerful imaging SDK also gives users the ability to create and view DICOM files, it can quickly enhance the functionality of medical applications to enhance collaboration and ensure diagnostic accuracy.
Once integrated into an application with a viewing UI, ImageGear Medical supports several commonly-utilized annotation marks that makes it easy for users to highlight certain aspects of an image, comment on them, and even cover up some elements using filled-in graphical objects. Annotations can also be grouped in layers to make them easier to manage and distinguish from one another.
ImageGear Medical annotation objects for DICOM include:
- Text: Adds descriptive text using a variety of fonts, colors, and sizes. Opacity can be adjusted and the text object can appear with or without a border.
- Point: Places a coordinate point on the image or document, which can be used to support other annotation marks.
- Polyline: A series of connected straight lines formed by dragging and clicking a mouse or pointer.
- Curve: Used for creating spline curve marks. Users can select multiple vertices and tensions when creating curves.
- Ellipse: A circular outline mark that can be used to indicate important elements of an image or document. When filled, it can also cover up areas of the image.
- Polygon: Like the ellipse, it can be filled or unfilled and is typically deployed to cover or highlight some aspect of an image or document. Polygons are especially useful for medical annotation because they can capture more lines and angles than simple rectangles or circles.
In order to maintain the integrity of the original image, ImageGear Medical stores annotations as a separate file that is overlaid upon the image during display. While annotations can be merged, or “burned in” the file, keeping them separate ensures that the original image itself is not altered directly. This is incredibly important when it comes to DICOM files, which often need to be kept on file for baseline comparisons on a future diagnosis.
Enhance Healthcare Flexibility with ImageGear Medical
Annotations and DICOM viewing support are just the beginning of ImageGear Medical’s expansive feature set. It also provides advanced filtering tools for sharpening and smoothing as well as image cleanup functions like despeckling, noise removal, and deskewing. With support for several dozen medical image and document formats, ImageGear Medical can easily convert files into easy-to-manage formats and compress files for efficient storage.
Available for .NET and C/C++ environments, ImageGear Medical can turn your healthcare application into a powerful annotation platform with full support for DICOM files. Start your free trial of this powerful SDK to discover first-hand how it can empower your medical annotation solution.
Goal:
Create a command line sample program to read a barcode from an image containing different types of barcodes that can handle damaged and low quality barcodes.
Requirements:
- Microsoft Windows 7 or greater
- Microsoft Visual Studio 2015 or greater
- Accusoft Barcode Xpress .NET (download a free trial here)
Programming Skill:
C# Intermediate Level
When it comes to organizing items, barcodes are probably one of the most convenient – they’re simple, can be picked up by lasers and cameras, and are used across a wide range of businesses and organizations.
In this case, let’s assume that you’re going to be using the C# programming language to create your custom application and that you need to read barcodes from an image (eg from a camera or scanner). Perhaps you’re tracking inventory in a warehouse and have your own custom set of barcodes to track items. Or you’re in the medical field and need to scan when medications are checked in and out of storage. Maybe you flag documents with barcodes so everything that goes with a client can be quickly scanned and put into the right database without having some one upload them.
For this project, we’ll use Barcode Xpress SDK, which equips you to deal with a variety of barcode situations:
- 1-dimensional barcodes
- 2 dimensional barcodes (including QR codes)
- Upside down or rotated barcodes
- Damaged barcodes / low quality images
- Images with multiple barcodes
Whatever the exact problem you need to tackle, Barcode Xpress is equipped to handle your barcode reading and generating needs. But let’s focus on reading for today. Keep things simple.
Getting Started
Start by downloading and installing the Barcode Xpress trial version. You can use the software under a free trial license (see license instructions here). You can change the evaluation mode to suit your project needs.
For this project, we can use Visual Studio 2017 (though it works just fine on previous versions if you’re not running on the bleeding edge of technology).
The most simple program will be to keep it on the command line. We can feed it file names to scan, tell it what kind of barcodes to look for, then collect the barcodes it detects, and display the information.
Here is how the program will work:
- Run the command line program. The first argument will be the type – for simplicity’s sake, we’re narrowing the scope to just two: 1-dimensional barcodes, and QR codes. But there’s a plethora of other types of barcodes you can scan from.
- If the file exists, read the barcode image file.
- Scan for barcodes in the file based on the type of barcodes we’re looking for.
- Display what the current barcode is that’s been scanned, what type is it, and its value(s).
Setting Up
- Download and install the trial version of Barcode Xpress .NET.
- Add the Accusoft Extension to your project – right click on “References”, click “Add Reference”, click “Extensions” and add “Accusoft Barcode Xpress 12 .NET” to your project. Otherwise – you’re not going to be able to use all of the tasty Barcode Xpress tools we’re trying to use.
- Add the code for our simple command line barcode reader (below) and compile it as SimpleBarcodeReaderCSharp.exe.
Code for command line barcode reader:
Reading in 1-D
Let’s see how this works out now. We’ll give it one file for now with one barcode image:
And what are the results?
Well. That was easy. Let’s walk through the code and explore what’s going on.
We’ll skip over the introductory code and go right into our function “ReadBarCode”:
All we’re doing here is generating an object that will be able to take in an image file and scan it. If you were using Windows Forms perhaps you’d leverage Accusoft ImagXpress to load the barcode images and process them from there – but we can do this with the Bitmap object in C# for this example.
Since we’re just using two types of barcodes for our example, we’ve only created two switches for how to handle them. It’s either going to be a 1-dimensional, or a QR barcode. But if you wanted to go with Aztec or something else – that’s fine as well. You’ll find the entire list of supported types in our documentation on the on the Accusoft documentation page..
Note: For color images, you can greatly improve the recognition accuracy by using the ImagXpress autobinarize method.
Whatever you do now – don’t blink because it’s going to go by fast – here’s where we load our file into a Bitmap object, then sic the barcodeXpress object into analyzing it:
Did you blink? Yeah. It’s that fast. Barcode Xpress can process up to 1,000 pages per minute. The rest of the code is just walking through the various types of data we can extract from the barcode detected.
That fast, and that easy.
Gotta Catch ‘Em All!
Reading multiple barcodes from one file:
What if you have multiple barcodes within your document? If we look back at the code, the results variable was an array to store the results of every barcode that we were searching for in the document that matched the type of barcode we were interested in. Let’s give it a different file with multiple barcodes in it:
And when we run our program against it, we get five different barcodes, and all of them scanned, identified, encoded, and their value displayed.
Reading damaged barcodes
What about barcodes that have been damaged or overwritten in some way? They’ve been stamped over, written over – the poor things have been abused.
Let’s run our program against it. You see – Barcode Xpress includes the capacity to deal with damaged barcodes and still get a result.
Every single one.
Moving Into the Next Dimension: Reading 2D/QR Codes
Perhaps we have a need for something more complex than 1-dimensional barcodes. 2-dimensional barcodes can give us a greater range of data to transmit and display. There are many different standards, but for the sake of this example let’s stick with QR codes. (For additional supported types the documentation on Supported Barcode Types can provide more information).
Since we already set up our program to be able to handle switching from 1-dimensional barcode to QR codes, no change to the code needed – it’s already taken care of. All we have to do is change our barcode type from 1 to 2 on the command line switch, and the system will handle all of these QR codes:
We have multiple codes, in multiple orientations, different sizes. Not only will we get the values, but we can also pick up on the rows and columns that make up the QR code.
Let’s try one more just for kicks. What if you have a document with multiple barcodes – but you only want to scan for one type of barcode?
Here we have a file with both QR codes and a 1-dimensional barcode in it, but we’re going to set out switch to only look for the 1-dimensional barcodes. Survey says?
We just have results for the barcode embedded in the file. Let’s go the other way – same file, but now let’s look just for QR codes:
Imagine the situation – you’re dealing with thousands of documents, scanned in and needing to be organized. Or a system with multiple barcodes to track the information in. Scan every file, find every barcode and use the data quickly and easily.
Integrating Into Your Application
Most likely, you’re looking to integrate barcode reading functionality into a larger application you’re developing, rather than build a stand-alone command line barcode reader. With just a few simple changes, we can use the same code above to easily add barcode reading capability into your C# application.
This function takes our ReadBarCode, and shortens it down to return an array of Accusoft BarcodeXpress Results to be parsed as required.
Here’s the updated code:
And just use this line of code in your application to read the barcode(s) from any image:
The function will return an array of Results. From here, you can easily save the returned results into a database, or pass them along to another part of your application.
The question now becomes – what will you do with this power?
For more information, check out the the Barcode Xpress overview page or the Barcode Xpress How To page.
Overview
Goal:
Create a command line sample program for reading different types of barcodes using Java, including damaged barcodes and low quality images.
Requirements:
- Barcode Xpress Java SDK (download free trial here)
- Oracle Java SE 5.0 and up
- Oracle Java JDK 1.8 or above
- Development IDE (in this example, Eclipse Java Oxygen is used)
Programming Skill:
Java Intermediate Level
Need to recognize barcodes from an image file in your Java application? In this project, we’ll walk through how to do this with a powerful barcode library for Java, Barcode Xpress.
Setting Up
If you’re already an experienced Java developer and know how to setup your development environment, feel free to skip this section.
Start by downloading a trial version of the Accusoft Barcode Xpress Java SDK. Within your Accusoft Barcode Xpress Java SDK will be the file barsdk5.jar. Expand that either with your favorite unzip program or if your java environment is already set up, just run:
Along with some code samples, there will also be the file tasbar5.jar. This contains the libraries that are needed to run this sample.
Depending on your development environment, you’ll want to add this jar file to your Java Build Path. Since Eclipse is being used for this sample, right click on your Java project and select Properties, then “Java Build Path”, and the “Libraries” tab.
It’s useful to add in the jar files into a common library, so in this case we’ll add a folder called “lib” into the development directory and place the tasbar5.jar file there so it can be included with whatever code repository system is being used. Then to reference this file, click “Add External JARs”, navigate to the lib directory, and select tasbar5.jar. Now the various Java objects we’ll need for our code can be accessed.
Here is the source code for the application we’re demoing in this article:
Scanning the First Barcode
For our code to work, let’s go over how to import an image file into Java, how to set the options for what kind of barcodes to scan for, and then how to scan the file itself.
Here’s a sample bar code to be read.
As we can see – it’s not perfect. Looks like the paper was a little off on one side, there’s some pixelation in the scanning. Maybe the scanner was nudged during the process. sam
Our SimpleBarCodeScanner program works via the command line. The first argument will be the type of barcode we’re scanning – we’ll pick Code39 as our default barcode to scan for. So a typical execution of this program will look like this (assuming that your tasbar5.jar is in the /lib directory, and you execute the program from your compiled /bin directory):
Let’s run it, see what the results are, and then step through our program code to explain what’s going on.
Looking At the Process
We’ll skip over the items in the Main function – all we’re really doing there is accepting the arguments, and as long as they’re valid, we pass it onto the ScanBarCodeFile function via the following command:
This function takes an integer as the barcodeType. Barcode Xpress can handle several different types of barcodes (for a list of supported barcodes, please review the documentation at http://help.accusoft.com/BarcodeXpress/v12.0/dotnet/webframe.html#Supported_Barcode_Types.html ), but for this example we’re just going to focus on one dimensional barcodes of the Code39, Code128, and CodeEAN13 standard.
A complete copy of the source code is available above – we’ll just highlight some items to go through what it’s going.
When we start, our function is going to read in the image file we’ve specified. The Java object BufferedImage can input JPEG, PNG, GIF, and BMP formats, so we’ll stick with png files in our example.
Once the BufferedImage object has been loaded, let’s load it into the Barcode Xpress object BarReader:
There are plenty of options to set in our BarReader object, and to do that, we’ll load them up into a Readoptions object, then set it to read the barcodes from left to right:
Since we just want to scan in specific types of barcodes as we run the function, we can specify that by setting that in our options object:
In this case, we select 1 as our barcode type, so it defaulted to the Code39 standard. To actually scan the image based on the options we’ve set up, just set our Barcode Xpress object to read them from the BufferedImage object, and store the results in an array of Barcode objects. This way if there’s more than one barcode in a document, we’ll find them all:
And here’s our value displayed:
More Options
Only Scanning A Specific Type Of Barcode
That works just fine for a simple demonstration – one barcode inside of one file. Let’s increase the complexity a bit. What if we have an image with different kinds of barcodes within it, but we only care about one of them?
Not a problem – Barcode Xpress detects the barcode we’re interested, and ignores the other.
Scanning Multiple & Misaligned Barcodes
Because of the way our code is situated, we can scan multiple barcodes in one shot, like in this image:
Barcode Xpress is capable of scanning 1,000 documents a minute – so one image file with a few barcodes in it isn’t a problem.
Also notice that the orientation of the image isn’t an issue – some of them are at an angle, so we don’t have to worry about whether the image is perfectly vertical or that everything is lined up. Just scan, get the data, and move on.
Switching Types Of Barcodes
We can also shift between different kinds of barcodes on the fly. In an image that has both EAN-13 and Code39 standards, we can flip between scanning for one and the other by changing the command line switch:
We’ll start with Code39 by setting the first command line argument to “1”, then flip right back into EAN-13 by setting the command line argument to “3”
Rather than worrying that you’ll get more information than you need – you can pick and choose for your needs.
Integrating Into Your Program
If you’re looking to implement this code in your project, the following function will provide the data you require. GetScanBarCodeFile works the same as our ScanBarCodeFile above – only instead of displaying the barcode values on the console, it returns an array of BarCode objects so you can extract the data yourself. The function can be called by:
Here’s a copy of the GetScanBarCodeFile function:
Ready to try it out? Check out Accusoft Barcode Xpress for more details or to download an evaluation copy.