Working with Data

Overview
The Sonix systems have many different types of data that can be stored. The imaging mode determines the type of data that is available to store at any given time.

Cine Buffer
The cine is programmable, but defaults to 128MB. The number of frames of data that can be stored in the cine depends on:
 * Data type
 * Imaging depth
 * Imaging sector & line density

If the cine size is changed, caution should be taken as to not over-allocate the system with memory beyond it's capacity, otherwise sluggishness of the interface will result. An on-screen cine control acts as an interface to the current displayed frame, as well as determining what frames shall be stored to disk. The control can be selected using the Select button on the console, and then the trackball shall perform scrolling through the frames. The display is organized as follows:

Current / Total [ Start … End ]

The start and end frames for storing data or playing back the cine can be set by clicking on the Start and End numbers of the cine, and then scrolling the values using the trackball. Once the range has been selected, the record button on screen (a round circle with a smaller circle inside), can be clicked on to bring up the Data Storage screen.

Storage Screen
The Data Storage screen is used to select the types of data that are desired to be stored to disk. A filename can be entered, however the default name is the current time at which the record button was clicked. The requested frame range will be initialized with the values adjusted from the cine control, however they can be modified in this screen as necessary. The default extensions for the data types are given within the screen.



All data types will be displayed, however only the ones that are available in the current imaging mode will have a value of ‘Yes’ in the Available column, as well as a non-zero frame count in the Frames column.

To speed up storage, data types can be selected by default when the Data Storage screen is displayed. To do this, check off the data types that should be defaulted, and click on Set Selection As Default. All data is stored under the D:\PatientInfo. If a patient and study have been created, then the data is under a folder with the naming convention of: D:\PatientInfo\Patient ID\Study Date\. If there is no patient selected then the data will be stored under D:\PatientInfo\.~default\Study Date\.

MATLAB Integration
Whenever data is stored, a MATLAB icon corresponding to the data type saved will appear on the bottom of the screen assuming thumbnail selection is turned on. Clicking on this icon will open the first image in the series from a pre-defined script.



Data Types
There are many data types that can be stored from the Sonix systems. Some important notations when reading the table:
 * Frame sizes in bytes
 * GS = Grayscale Data
 * FC = 4 Byte Header
 * V = Vectors
 * S = Samples
 * W = Image Width
 * H = Image Height

All data types are configured to store a range of frames except for Screen Capture, PW Spectrum, and M: Scan Converted. The frame range can be entered on screen when the Frames option is selected. Alternatively, if the Time option is selected, data is stored retrospectively based on the duration specified in milliseconds.

Data File Information
The default header used when storing any data from the storage screen is as follows: struct uFileHeader {   int type;    // data type (can be determined by file extensions) int frames; // number of frames in file int w;      // width (number of vectors for raw, image width for processed data) int h;      // height (number of samples for raw, image height for processed data) int ss;     // data sample size in bits int ulx;    // roi - upper left (x) int uly;    // roi - upper left (y) int urx;    // roi - upper right (x) int ury;    // roi - upper right (y) int brx;    // roi - bottom right (x) int bry;    // roi - bottom right (y) int blx;    // roi - bottom left (x) int bly;    // roi - bottom left (y) int probe;  // probe identifier - additional probe information can be found using this id       int txf;     // transmit frequency in Hz    int sf;      // sampling frequency in Hz    int dr;      // data rate (fps or prp in Doppler modes) int ld;     // line density (can be used to calculate element spacing if pitch and native # elements is known    int extra;   // extra information (ensemble for color RF) };

Although data types can be determined by the file extension, there is also a type entry in the file header; this can be parsed to determine the data type as well. The enumeration for data types is as follows: enum uData {   udtScreen                = 0x00000001, udtBPre                 = 0x00000002, udtBPost                = 0x00000004, udtBPost32              = 0x00000008, udtRF                   = 0x00000010, udtMPre                 = 0x00000020, udtMPost                = 0x00000040, udtPWRF                 = 0x00000080, udtPWSpectrum           = 0x00000100, udtColorRF              = 0x00000200, udtColorCombined        = 0x00000400, udtColorVelocityVariance = 0x00000800, udtElastoCombined       = 0x00002000, udtElastoOverlay        = 0x00004000, udtElastoPre            = 0x00008000, udtECG                  = 0x00010000 };

Compound Mode
In Spatial Compounding mode, B data can be stored as normal, however the raw pre-scan converted frames stored will alternate between the angles preset in the mode. The upper 4 bytes of the frame header will determine the angle count, whereas the lower 4 bytes always is correlated to the frame counter.

Header example with 3 angles in compound imaging:

RF Mode
RF mode will by default, store post-beamformed RF data when in RF or B/RF update modes. The data will match the B mode geometry based on the line density, depth and sector. In ChRF and B/ChRF modes, the RF is stored as pre-beamformed and always contains 32 separate RF lines (on Sonix RP only) that are centered around the RF visualization line on screen.

A compounding RF mode is also available, where frames of RF data are stored in a similar fashion as described in regular Compound Mode above.

Elastography Mode
RF data used to generate the strain image can be captured by selecting the regular RF data option. All other elastography data captures relate to the relative strain. Displacement data is not yet exportable.