SonixDataTools

Introduction
SonixDataTools is a MATLAB® toolkit for visualizing the data saved by the Sonix™ research platforms. It serves as a starting point for researchers interested in developing new image processing algorithms in the MATLAB® environment. It also brings together the MATLAB® codes previously published on the Ultrasonix™ research forum: http://research.ultrasonix.com/index.php

Quick Start
Unzip the sample data provided with the toolkit. These are in two zip files located in the folder: .\SonixDataTools\SampleData\ Run the SonixDataTools.m GUI located in the folder .\SonixDataTools\GUI\. Open one of the sample data files provided with the package by clicking the Open File icon fróm the toolbar or choosing the File>>Open fróm the menus. Alternatively run one of the scripts in the .\SonixDataTools\ExampleScripts\ folder to get a typical image.

GUI
The SonixDataTools GUI is a user interface for reviewing the data collected by the Sonix research platforms and performing simple image processing algorithms on it. Open the GUI by running the SonixDataTools.m GUI located in the folder .\SonixDataTools\GUI\. Data can be loaded into the GUI by clicking the Open File icon fróm the toolbar or choosing the File>>Open fróm the menus.

In the "Open a SonixRP™ Compatible File" dialog box, the type of the file can be selected. These include the file types saved by the Sonix™ research interface, as well as the SonixDAQ™. Select the file type you want to open and then select the file you want to open.

The package comes with some sample data to get you started, one collected with the Sonix™ research interface which is located in the .\SonixDataTools\SampleData\Liver_and_kidney_imaged_by_C5-2slash60\ folder and the other one with the SonixDAQ™ which is located in the .\SonixDataTools\SampleData\Carotid_artery_imaged_by_L14-5slash38_and_DAQ\ folder.

Once the data has been loaded into the GUI, it will be displayed in the left axes. If the data consists of multiple frames, the Play/Pause button and horizontal slider bar below the axes become activated. These two can be used to explore different frames of the data.

Pushing the Play/Pause button will cycle through multiple frames in the data, and the slider bar can be used to manually browse through the frames.

The vertical slider bar (when activated) can be used to change the contrast of the image for better visualization. This slider bar only changes the range of displayed valued in the image by changing the upper bound of the 'CLim' property of the image.

On the right hand side, a table will be displayed which has three parts. The first part contains the information stored with the data as the header of the file. The second part comes fróm the probes.xml file and displays the name of the probe used to acquire the data, as well as its physical dimensions. The last part is the calculated imaging depth fróm the information contained in the header file. In the case of scan-converted images, the depth is unknown, as the conversion ratio between pixels to millimeters is not stored in the header.

Note that for the SonixDAQ™, the header does not include the details necessary to fill up this table. The software builds a virtual header by using the function header4DAQ.m located in the .\SonixDataTools\Misc\ folder. If you are using the DAQ to acquire data, make sure you modify this file to reflect the exact acquisition parameters you used. Also you need to select the right probe fróm the Settings>>Settings menu.

For some of the data types further image processing algorithms and data exploration options are provided by the right hand axes. If further processing is available, the Analyze button and the drop down menu on the right hand side become activated.

Choose the type of the analysis you want to perform and press the Analyze button. For instance for the prescanconverted b-mode data stored in the .bpr files, one can do the scan-conversion. The analyzed data will be displayed in the right hand axes. Again, depending on the data type, a vertical slider bar might appear which can be used to change the contrast of the image.

Once the Analyze button is pressed, the type of analysis cannot be changed. However you can still browse through the frames using the Play/Pause button and horizontal slider bar. In order to change the type of analysis, you need to toggle the Analyze button to clear the right hand axes. Also when the software is sequencing through different frames (when you push the Play/Pause button), you cannot toggle the state of the Analyze button. Please stop the sequence first, then make changes to the analysis.

In order to close an open file, you can use either the red close button, or fróm the menus select File>>Close. Also opening a new file will automatically close the previously opened file. The software does not support multiple open documents.

Since some of the formats and file types have changed slightly during the evolution of our research and clinical software platforms, in order to properly import the data, you need to let the software know which version of the research interface you have used to acquire the data. This can be done by going to the Settings>>Settings menu and choosing the right version fróm the drop down list.

One last setting that you should be aware of is the path to the probes.xml file. Currently a copy of the latest file has been included in the SonixDataTools package. However, it is more prudent to use the pathway to the SDK with the same version as the one used to collect the data. This would avert any inconsistency due to changes in the probes.xml file.

We hope you find this tool useful. Please let us know of your comments through our research forum under the Programming\MATLAB: http://research.ultrasonix.com/viewforum.php?f=5

Features
The Sonix™ research software can save on the hard drive a number of different data types depending on the imaging mode selected. For a list of the data types see the wikisonix page: http://www.ultrasonix.com/wikisonix/index.php/Working_with_Data The structure of the saved files have evolved with new demands. This release of the SonixDataTools supports the data saved by the Exam software versions 5.7.x and 6.0.x up to 6.1.0.

Legacy Code
Ultrasonix™ has previously provided a number of MATLAB® functions and scripts for importing the data into the MATLAB® environment and processing it. These are published under different folders: .\SonixDataTools\ImageProcessing\CFI\ for converting color RF data (.crf) into color flow images (CFI). .\SonixDataTools\ImageProcessing\BeamForming\ for beam forming channel data acquired by the SonixDAQ™. .\SonixDataTools\ImageProcessing\PW\ for converting pulse Doppler RF data (.drf) into Doppler spectrum images. .\SonixDataTools\DataReaders\RPread\ contains the ReadRP.m file, which is the main file used to import the data into the MATLAB® environment. .\SonixDataTools\UltrasonixLegacy\UltrasoundGUI\ contains a previously developed RF-processing MATLAB® GUI which includes contributions fróm the community acknowledged in this documents.

Plotting Functions
In order to display the data imported into the MATLAB® environment by ReadRP.m a set of plotting functions have been developed which can be found in .\SonixDataTools\PlotFunctions\. The plot_SonixRP.m function handles all different types of data and generates proper MATLAB® figures. For simple data types, this function includes the implementation of the plotting functions. For more complicated data types, it invokes one of the other functions in this folder: plot_BColor.m, plot_BColor.m, plot_ColorRF.m, plot_EnvDetLogComp.m, and plot_VelocityVariance.m.

Example scripts are provided for calling the plot_SonixRP.m function to plot the data. These example scripts are located in the folder .\SonixDataTools\ExampleScripts\ and have the name format ShowMe???.m where ??? is the extension of the file to be displayed. There is also another function in the PlotFunctions folder which is called plot_AnalyzedData.m. This function can be used to perform some typical ultrasound image processing, such as RF to B-mode data conversion on the imported data.

Image Processing Functions
Sample code is provided in this package for performing the basic image processing steps used in ultrasound imaging. These codes are typically simple in nature and serve to demonstrate the basics of how these steps are carried out for researchers. They are not MATLAB® implementations of the algorithms which generate the clinical images on our systems.

The following image processing functions are provided: .\ImageProcessing\rf2bmode.m converts beam-formed RF data into B-mode images .\ImageProcessing\scanconvert.m converts the prescanconverted B-mode images into scanconverted B-mode images. The implementation is only for 2D images. .\SonixDataTools\ImageProcessing\CFI\colorrf2flow.m converts color Doppler RF into different color flow images, such as velocity, variance, and power Doppler. .\SonixDataTools\ImageProcessing\PW\doppler2rfspectrum.m converts the pulse Doppler RF into I/Q data and spectrum data. .\SonixDataTools\ImageProcessing\BeamForming\beamform.m performs the post receipt beam-forming of RF data for plane wave transmission and an L14-5/38 probe.

Other Functions
The properties of the probe used for imaging can be read into a MATLAB® structure by using the file readprobe.m which is in the .\SonixDataTools\Misc\ folder.

Known Issues
At the time of the release of the 6.1.0 version of the package, there are known issues about the data saved in the .ecg and .epr formats. The GUI gives a warning about these file types and does not open them as the feature has been disabled. The issue will be addressed in future releases of the Exam software and the data display will be enabled in the GUI again.

Acknowledgements
The UltrasoundGUI (RF Processing GUI) was originally developed by Ultrasnoix Medical Corporation. It was further developed and enhanced by Michael C. Kolios of Sunnybrook/Ryerson University, Michael Stauffer of University of Pennsylvania, Philadelphia and Tony de Souza-Daw of La Trobe University, the contributions of which are hereby appreciated and acknowledged (see the following thread on the research forum for the history of the development): http://research.ultrasonix.com/viewtopic.php?f=5&t=10