Ulterius Injection

Overview
Image injection is a useful feature where Ulterius programs can make use of the already available imaging display provided by the main research software. Graphical programming, though useful, does not necessarily have to take place when developing with Ulterius. The injection feature allows a program to hijack the B mode display in any given imaging mode and display some custom contents. Using setInjectMode will enable or disable this feature. When enabled, the B mode image will stop displaying anything; when this occurs, the imaging pipeline is still running, and the system is still acquiring data, however nothing will be displayed. This may be useful when in RF mode, the Ulterius program can capture the RF in real-time, process the data into a viewable format, and then inject back into the research software.

Injecting images can take place with 3 different formats:
 * 1) The first is where the entire B mode display area is available to write over with the injection of 8 bit greyscale data. The research software will automatically convert it to 32 bit format and apply the chroma map if enabled.
 * 2) The other format is similar, however the user injects 32 bit data, and essentially sets each RGB pixel as required. This is useful if meta-information is required to be overlaid on the image, for example, data from an external source or some numeric value to be displayed that was computed in a special algorithm.
 * 3) The final format is a 8 bit greyscale as well, however the data provided to the injection function is in a ultrasound scanline/sample format, where pre-scan data is automatically scan-converted for display.

The first two formats may require use of the Pando SDK, if one wishes to scan-convert the processed data prior to display, otherwise the third format will negate the need to do so, but also limits the availability of the display buffer for custom graphics.

To implement injection, the following pseudo-code steps should be taken:

void main { ulterius->setInjectMode(true)

// ensure imaging is running if (!ulterius->getFreezeState) {   ulterius->toggleFreeze }

while(1) {   // do something } }

bool callback(void * data, int type) { memcpy(buffer, data) datatype = type;

// notify main thread, get out of here quickly! postMessage(processingFn) }

void processingFn { // do something with the acquired buffer // ...

// inject a 32 bit image that covers the full display area ulterius->injectImage(processed_buffer, x, y, 32, false) }