Mixing Apple microcomputer graphics for ultrasound scan measurement

Mixing Apple microcomputer graphics for ultrasound scan measurement

Ulrruaound tn bled & BW Printed in the U.S.A. Vol. I I, No. 3, pp. 487-490. 0301-5629/E $3.00 + .oO Pergamon Press Ltd. 1985 *Original Contributio...

406KB Sizes 5 Downloads 83 Views

Ulrruaound tn bled & BW Printed in the U.S.A.

Vol. I I, No. 3, pp. 487-490.

0301-5629/E $3.00 + .oO Pergamon Press Ltd.

1985

*Original Contribution MIXING APPLE MICROCOMPUTER GRAPHICS FOR ULTRASOUND SCAN MEASUREMENT

Regional Medical Physics Department,

W. ALLAN Sunderland District General Hospital, Sunderland

SR4 7TP, England

and T. A. WHITTINGHAM Regional Medical Physics Department,

Newcastle General Hospital, Newcastle Upon Tyne, England

(Received 9 August 1984; in final form 30 November 1984)

Abstract-A modem microcomputer with high-resolution graphics can provide an inexpensive method for measurement on video images from a real-time ultrasound scanner. The problem which bas to be overcome to allow the computer graphics to be superimposed on the ultrasound video image and permit subsequent analysis is that of synchronization. The video signals must be synchronized before they can be mixed, but neither microcomputers nor ultrasound scanners provide facilities for external synchronization of their video output. A mixer has been designed which uses a buffer memory and allows the graphics of an Apple II microcomputer to be synchronized and mixed with an external video image; we used a Hitachi EUB22 real-time ultrasound scanner. The resulting combination is a versatile instrument which permits a wide range of measurements on ultrasonic images. Key Words: Ultrasound

scanner, Video synchronization,

1. INTRODUCTION Modem

diagnostic

video signals from the microcomputer and the ultrasound scanner can be superimposed on the same monitor screen is the synchronization of video signals from the two instruments. Neither the ultrasound scanner nor the microcomputer have facilities for external synchronization of their video outputs, because the video timings of both systems are derived from internal crystal oscillators which cannot be externally synchronized. The Apple II microcomputer was chosen because it provided the following features which were considered necessary for this application:

ultrasound

procedures often remeasurement, feature labelling, reference to look-up tables of normal population data, or various forms of data analysis. Many machines now incorporate a limited range of such facilities, but these are fixed and cannot be modified to suit particular needs. An alternative and more flexible approach is to link a microcomputer to the ultrasound scanner to perform the measurements. This makes the system versatile, since programs can be written, or changed if necessary, to suit any requirements, including the generation of labels or other text on the video screen. This note describes a mixer that has been designed and built to allow the high-resolution graphics display from an Apple II microcomputer to be overlaid on the image from a real-time ultrasound scanner (Hitachi EUB22). However, it should be noted that any video source could be substituted for the ultrasound scanner, including for example a TV camera or video tape recorder. The major problem to be overcome before the quire

facilities

Microcomputer.

for area and perimeter

1. high resolution graphics (280 X 192 points)

2.position input devices: e.g. graphics tablet or joystick

3.disk drives for program storage 4. input/output ports which allow easy interfacing. The mixer operates by storing in a buffer memory an exact copy of the data stored in the computer’s high-resolution graphics memory, and then at the correct time, i.e. synchronized with the external video signal (from the scanner), the data are read from the 481

Ultrasound in Medicine and

488

Biology

May/June 1985, Volume 11, Number 3

the mixer. This indicates that data stored needs to be transferred to the buffer memory during the next available write cycle from the R/W and timing control.

buffer and mixed with the scanner’s video signal. The result is a TV display on which the ultrasound image and the computer graphics are overlaid. Position coordinates from a graphics tablet (or joystick) are fed to the computer and used to outline or mark features on the scan image. Calculations are then made on these outlines, and the numerical results and other text are displayed on the screen. 2. CIRCUIT

in

2.2 Synchronization pulse separator The composite video signal from the ultrasound scanner is applied to the synchronization pulse separator, which removes the video signal and separates the horizontal (line) and vertical (frame) synchronizing pulses. These pulses are then used to synchronize the oscillator and read address counters.

DESCRIPTION

The circuit can be divided into several main units as shown in Fig. 1. The following sections give brief details of each unit.

2.3 Synchronized oscillator This circuit is the master clock within the mixer and is synchronized with the external video signal from the scanner. The oscillator used is a simple gated RC type (Fig. 2) which uses two NAND gates: a Schmitt trigger and an open collector type. The oscillator is started and stopped via a control line from the sync. separator. It will always begin with a positive half-cycle to ensure that all raster scan lines are correctly aligned. The oscillator frequency is 14 MHz, but timing signals of other frequencies are derived from it for use within the mixer.

2.1 Address decoder and latches This circuit is connected to the computer peripheral I/O port and monitors the computer address lines. Whenever an address within the range 2000 to 3FFF (hexadecimal) appears on the microcomputer address bus (i.e. page 1 of high-resolution graphics) and the microcomputer read/write (R/W) line is low, then this address and associated data are stored in the latches. Whenever this happens a ‘write data valid’ signal is sent to the R/W and timing control

Fnxx;nal

video

Read/ Write and timing control

V~V~:J synchronized

)

Memory timing 8 R/W signals

p;dr;ite

Write data valid Read clock



co&i

Valid data

I

I

1 Read address counters

h Read address 2 ’

Address Multiplexer

h Write

Y Suffer memory

address

I

Address %??I%&

h Graphics

dato

converter V.

Fig. 1. Block diagram

of microcomputer

mixer.

Microcomputer graphics for ultrasound scan measurement 0 W.

ALLAN

and T. A.

489

WHITTINGHAM

Control

I +---i-J

Control

1

7-_rT

T

C

Fig. 2. (a) Oscillator

circuit and (b) typical waveforms.

2.4 Read/write and timing control The R/W control logic produces timing signals to a. operate the buffer memory, b. indicate when valid data are available at the output of the buffer memory, c. initiate a buffer memory write cycle when valid data are stored in the latches, d. control the address multiplexer.

scanner’s image display has a total of 140 active scan lines: Therefore, the mixer will produce one active scan line which is aligned with each one from the scanner and will have 52 lines remaining. The mixer can be adjusted to provide about 260 points along each scan line, leaving 20 points to display text. Each scan line is equivalent to 180 mm depth in the patient, so each point is approximately 0.7 mm long. Therefore the microcomputer graphics pixels are suf-

2.5 Read address counters The read address counters generate all the addresses necessary to read data from the buffer memory and do so synchronously with the external video signal. This circuit also produces a blanking signal to inhibit output from the buffer memory for positions on the video monitor screen outside the high-resolution graphics page, which would otherwise contain spurious repetition of the graphics data. 2.6 Bufer memory The buffer memory consists of seven (16 K X 1 bit) dynamic RAMS, which are continually refreshed as data are read from them to the video display. Data from the buffer memory are output in parallel form and then converted to serial form in the parallel-toserial converter and mixed with the scanner’s video signal. 3. APPLICATION TO ULTRASONIC IMAGING 3.1 Display performance

The mixer provides a video graphics display identical to that of the Apple, which has a matrix of 280 points X 192 points, and each point can be addressed individually. This is equivalent to having 192 active scan lines, each of which are capable of displaying 280 points. In comparison, the Hitachi

Fig. 3. Photograph of scanner image showing a foetal head which has been outlined. The computer has calculated the area and perimeter of the outlined region and superimposed the

results onto

the

scanner momtor.

490

Ultrasound in Medicine and Biology

ficiently small that detail on the scanner image can be measured without significant error. 3.2 Software The major advantage of this system is its flexibility, which is achieved by allowing the software to be designed to suit any particular local requirements. Our requirements have been met by a program written in BASIC that calculates the area and perimeter of a region of interest and allows the patient’s name to be added to the scanner display. In order to perform these calculations, the region of interest must first be outlined, and, to achieve this, X and Y coordinates produced by a graphics tablet are used to steer a cross-wire-type cursor around the region. The program consists of three main sections: 1. X and Y calibration 2. area and perimeter calculation 3. displaying text and results. The first part of the program enables the graphics tablet and computer program to determine and store calibration factors with respect to the scanner. Calibration values which have been stored on disk may be used, or the system may be completely recalibrated. The area routine uses the trapezoidal rule to calculate the area of an enclosed region, and the perimeter measurement is obtained by summing the distances between each pair of X and Y coordinate points. The programs were written in BASIC, but operate sufficiently fast to produce no noticeable delay in providing the results. The final part of the program is necessary in order to display text on the graphics page, and to

May/June 1985, Volume 11, Number 3

achieve this a “shape table” for a set of alphanumeric text characters was constructed. The shape table characters are rotated through 90” (using Apple graphics commands) before being displayed in order to compensate for the scanner video display being at 90” to the normal orientation. It is clearly possible to write programs for more complex measurements and for the user to modify and extend these easily as required. For example, foetal trunk and limb measurements may be compared with various published values stored in look-up tables. Another application could be generating standardised report forms incorporating data from scans of patients. 4. APPLICATIONS VIDEO

TO OTHER SOURCES

The mixer was built for use with an ultrasound scanner, but any equipment which produces a standard video signal with either 625 or 525 lines could be used. Measurements can thus be performed on any image where manual input of coordinates is appropriate, since the analysis programs cannot operate automatically on the video image itself. The mixer uses 47 inexpensive and readily available integrated circuits, and the complete instrument has been built into a cabinet which fits underneath the microcomputer. Hardware and software details are available on application to W. Allan.

Acknowledgment-We would like to acknowledge Professor K. Boddy and Dr. E. D. Williams for their support of this work.