Radiol Oncol 1997; 31: 199-201. Nuclear medicine, IBM PC PIP-GAMMA-PF computer system Valentin Fidler, Milan Prepadnik, Jurij Fettich and Sergej Hojker Clinic for Nuclear Medicine, University Clinical Centre, Ljubljana, Slovenia Our own development of nuclear medicine computer system was mainly due to very high prices of commercial systems and was based on our knowledge and experiences in the development of some other nuclear medicine equipment and processing software. '•2 The project was started 5 years ago on the low cost IBM PC and after two prototypes a highly professional acquisition board was built along with the acquisition and data analysis software. The acquisition board is characterised by stable functioning and simple installation. After testing different modes of processor input of scintigraphic signals (DMA, PORT) the latest one was chosen because of its simpler programming code, good stability and the possibility of using it in DOS and WINDOWS. The acquisition software consists of a predefined set of acquisition protocols for standard nuclear medicine examinations, simulation of persistence scope with a possibility of changing the image orientation, zoom size, automatic adjustment of the image size, offset and pixel size, analysis of clinical image data and archiving the patient population and scintigraphic data by using departments network. To the database management and system processing routines - PIP by A. Todd-Pokropek (London University) we added some clinical processing modules for the most common examinations in nuclear medicine. The system was successfully applied in daily routine work at the clinic for nuclear medicine in Ljubljana and in some other places. Key words: nuclear medicine; radionuclide imaging; image processing, computer assisted; software Acquisition board The Gamma camera is functionally connected to the computer via an analogue-digital converter and control logic circuit (Diagram 1.1.). 1. Position signals The position signals X and Y (Diagram 1.2.) are defined by the following characteristics: - the displacement of scintigraphic image from the middle of matrix defined as X or Y offset - their variation range (scan height and width) corresponding to X and Y gain - analogue signals in V (volts) Correspondence to: Valentin Fidler, Ph.D., Clinic for Nuclear Medicine, University Clinical Centre, Zaloska 7, Ljubljana, Slovenia. X gain Y gain UDC: 538.163:621.383.8 Diagram 1.1. Functional diagram of interfacing board. 28 Fidler V et al. • generally non-symmetric signals in relation to 3. Analogue-digital conversion of X and Y signals 0 V - signal variation means the X - Y range (Siemens BASICAM : ± 2V, GE 300 A : ±1.5 V, Nuclear Chicago Searle : ± 2 V) - commonly constant values of X - Y signals until they are changed by Z sampling signal - coaxial cabling from gamma camera console to computer interfacing card with 70 £2 impedance of BNC connector - amplifier needed for more than 10 m long X -Y cables - IC designed for 0 V in the middle of the matrix - non-symmetric variation of X - Y signals related to 0 V means the image offset VZL/ / \ Diagram 1.2. Gamma camera signals: definition of X and Y offset and gain 2. Logical energy signal The logical signal Z, which represents the correct gamma ray energy, starts the X and Y conversion and sampling (Diagram 2.1.). X Y gam nonsymmctric X - Y signals offset time Diagram 2.1. Shape of Z signal and offset and gain of X and Y signals The digitalisation of X and Y signals is characterised by the following features: - the accuracy improvement of signal conversion: the AD converter with more bits is used for more reliable higher bits (pp. 12 bits for 1 byte magnitude conversion; after conversion the 4 less significant bits are rejected), dynamic linearity is improved - in high count scans ( > 2 million counts) the correction for dynamic non-linearity of ADC should generally be applied - each AD converter has its own characteristic linearity curve 4. Autoadjustment of interfacing board's gain and offset for input gamma camera signals The position signals X and Y from the gamma camera to the interfacing card must fit the computer matrix. This can be done basically by two methods either by manual adjustment of the gamma camera position signals on the interfacing card or by the feedback intervention "interfacing card - computer" (Diagram 4.1.). The last method considerably improves the effectiveness and simplicity of the whole acquisition system. We developed the logica circuit for a continuous change the gain of input X and Y signals from the gamma camera prior the analogue-to-digital conversion. The mean value of the gain setting 128 (range 0-255) corresponds to the range of x,y ±1.5 V for the whole matrix size. If the input signal's range varies up to ± 3 V, then at this gain setting half of the image will be cut in diameter (diagram 4.2.). With such a range, which can be manually changed for really extremely non-standard gamma camera signals, all the available gamma cameras can be used. When the input signals come from the gamma camera with a range of ± 0.75 V and the chosen gain is 128 then the image in the matrix will have half of the diameter's value of the gamma camera with signals in the range of ± 1.5 V. To set up the interfacing gain we shall start with the highest possible value of gain parameter (255). In this case we shall normally get a minimized image for most gamma cameras. Our task is now to increase Nuclear medicine, IBM PC PIP-GAMMA-PF computer system 29 A. Offset adjustment A. Offset adjustment X,Y input X,Y output Offset voltage DAC from PC i/O port Ti— B. Gain adjustment B. Gain adjustment X-Y signal input X-Y signal output D/A converter from PC I/O port Diagram 4.1. Digital gain and offset control of X and Y. A. Fixed IC setting X,Y range =± 1.5 V GAIN = 128 B. Initial gain value for iterative ïoop X,Y ranges: ± 0.5 V- ±3 V GAIN'= 255 \ 3 V ■ 0.5 V C. Iterative loop GAIN | => 2r | Diagram 4.2. Adjusting the interfacing card's gain and offset values the image size step by step by decreasing the interfacing gain value. The problem of non-central positioning of the image in the matrix can be solved simply by moving the image centre to the matrix centre. To start the image position in the matrix centre we set the offset to 128. If the image is not centred (non-symmetrical X,Y range), then we change the offset to a new value which is equal to the displacement of the image centre from the matrix centre. Instrumental needs To start the gain and offset set-up, the uniform radioisotope source (Co57 plate on collimator or point source 2 m from gamma camera without collimator) is used. Algorithm for autoadjustment of interfacing board's gain and offset Initial values The following starting values are chosen: For iterative loop gain = 255, offset in both directions = 128 Main loop The scan of 50000 counts in the matrix 256x256 is acquired. The activity profile in X and Y direction with thickness of 3 lines is formed, the maximum number of counts per profile element is searched for and the coordinates of this maximum are used to find the scan edges by applying threshold criteria. Displacement of the scan centre from the matrix centre (Diagram 4.3.) is computed on the basis of the following formulas: Xds= (XI + Xr)/2 - Xm Yds = (Yu + Yl)/2 - Ym where XI, Xr are the x co-ordinates of the left and the right scan edge Yu, Y1 are the co-ordinates of the upper and lower scan edge Xm, Ym are co-ordinates of the matrix centre Xds, Yds are displacements of the scan from the matrix centre These values are subtracted from the current offsets. Similarly, the deviations from the scan and matrix size in both directions are computed using the following formulas: Dx = (Md - (Xr-Xl))/2 Dy = (Md - (Yl-Yu))/2 where Md is one dimensional matrix size Dx, Dy are halves of the difference between the matrix size and the scan size These values should be subtracted from the current gain values if the edge coordinates are computed with high precision. But the smaller the starting image's diameter the less exact computation for edge coordi-nates is possible. The subtracted gain 30 Fidler V et al. values can lead to the image size greater than the matrix size and therefore it is difficult to find the optimal gain setting using the software technique described above. Because of this we prefer to subtract only half of the Dx and Dy and the image size is slowly approaching the matrix size and the corresponding gain values the optimal settings. Stopping condition If Dx and Dy are smaller than 2, the procedure for gain/offset-up is stopped and the corresponding values for gain and offset stored in the calibration file and set to the interfacing card- To visually check the algorithm's success, all intermediate scans are displayed during software adjustment of the gain settings until the scan size equals to the matrix size. Problems The following problems arise most frequently durign the autoadjustment of gain and offset: - insufficient radioactivity in flood or point source, - nonadequately calibrated gamma camera with "holes" or "hot spots" in the scan (the edge coordinates can be miscomputed). 5. Correction of dynamic non-linearity At high count images (over 2 million counts) this correction is necessary to remove the stripes which appear at some horizontal and vertical matrix lines. The stripes in the image appear at all horizontal and vertical lines where the bit content of the co-ordinate is changing from total "1" to "0" in most bit positions (e.g. from X(Y) =11111 to X(Y) =100000) because of the so called bit flipping.The effect of "bit flipping" is not the same for all co-ordinates in question. Higher content of the "1" bits leads to Uanalogue Diagram 5. Dynamic non-linearity curve. more frequent flipping (diagram 5.). To correct this ADC "malfunction", the uniform distribution of input signals in X and Y direction is applied and the extent of bit flipping is measured in each position. 6. Acquisition software It consists of four basic units: - entering the patient population, instrumental and acquisition data (part of the PIP system). For clinical work we built a set of predefined studies which can be called up to avoid the time consuming input of instrumental and acquisition parameters for each patient. A new study protocol can be easily added to the existing set.. - functioning as persistence scope for checking the patient positioning, the adjustment of the zoom and the image orientation and, if necessary (in the installation phase) the adjustment of the image size, offset and pixel size. - starting the predefined acquisition During the acquisition we have a possibility of finishing the complete study (static and dynamic studies) of finishing the current scan (in static mode acquisition). Each scan is currently displayed if the acquisition time is exceeds 10 seconds for static acquisition or 2 seconds for dynamic acquisition, otherwise only the frame and group numbers, the time, the countrate and the total time are displayed (the reason for this is to prevent the count loss in fast framing and scan displaying). - storing the sequence of images from virtual memory to hard disk and returning to the main PIP menu (part of PIP system). This phase can be upgraded if required in such a way that the data can be stored on some other unit as well (e.g. on archive disk). Nuclear medicine, IBM PC PIP-GAMMA-PF computer system 31 - hardware and acquisition software installation The interfacing card called GAMMA-PF and relevant acquisition software were constructed in such a way that the hardware and software can easily be installed (see installation manual). The interfacing card is installed in an empty computer slot like any other computer card without any additional intervention in the computer switches. The same is also true for the acquisition software installation which is done by running the INSTALL command from the installation disk. For the optimal image size and shape the software is included which recursively adjusts them from the uniform radiation flux on the gamma camera (uniform source on the gamma camera detector or point source two meters from the detector). No hardware adjustment of the image gain and offset is needed. The functioning of the interfacing card is very stable and no intervention is needed except in the case of electrical or physical damage to the card. - maintenance The best way of maintaining the interfacing card would be either sending back the malfunctioning interfacing card or which is also acceptable because of the low card price of the card, to have an additional card at hand, which can immediately be installed and the damaged one sent back to the supplier for repair (highly recommended to prevent any interruption of clinical investigations). 7. Networking The basic function of the nuclear medicine network system should be providing the records of the patient population and a scintigraphic data acquisition on large scale storage media, communication between the acquisition, processing and reporting stations, printing the reports on network or local printer and access to external network.3 The solution of this task can be achieved by applying low cost network hardware and software (eg NOVEL, MS WORKS for WINDOWS, etc). When planning the network system for the department we should take into account the department's organisation and economy. The network system can considerably lower the overall department's expence per patient's examination study, by increassing the effectiveness of the department in using the digital storage and displaying system as patient study retrieval system and low cost high resolution printer for reporting. All these demands can be fullfiled by using the low cost IBM PC hardware and software technology. The following basic functions of PIP-GAMMA-PF network (Diagram 7) are available: - storing patient study files (IMG, XAC) on the network server's archive disk (hard disk with a capacity more than 2 GB) - storing patient's coded images (the image with sequential scans, curves, ROIs, patient's population data and quantitative estimates of organ's function) on the server's archive disk - archiving patient document files (the physician's report, the image of results, patient population data) on the archive disk - printing the patient's documents on the network printer (laser or inkjet printer with resolution at least 600x600 dots/inch) - distributing the application software from the server's disk to acquisition and processing IBM PC stations - access to hospital, regional and international network Diagram 7. Functional schema of PIP-GAMMA-PF network. where A is PIP-GAMMA-PF acquisition system P is PIP-GAMMA-PF processing system R is PC reporting system (MS WORD) S is network server D is server's archive disk PR is network printer The acquisition system needs the following settings in PIP.LGO file: acqndir = C:/PIP/DATA datadir = C:/PIP/DATA archive = H:/PIP/DATA where C is the logical label for the system disk in the acquisition system and H is the logical label for the network server's archive disk The processing system should be set at the following values in PIP.LGO: datadir = H:/PIP/DATA and the output coded result images (PCX format) should be stored in an appropriate subdirectory on H:/GAMMA/ (e.g. H:/GAMMA/LUNGS/), which is for the time being programmed in GAMMA-PF user program. 32 Fidler V et al. Results The following results were achieved in the project: - one full-size AT bus professional interfacing card (ISA bus, four layers, PORT input), installation disk and manual - simple installation of the interfacing card in an empty slot of IBM PC compatible computer and installation of software with the "install" command from the installation disk - a simplified and shorter acquisition programming code with PORT input of data - a set of predefined studies for clinical examinations - the acquisition can be stopped either to finish the current image or to finish the study - the sequence of images is displayed continuously - the continuous displaying the frame and group numbers, time and count rate - acceptable count loss for clinical examinations4 - a high functioning stability observed over a period of two years - network system with acquisition, processing, reporting, archiving, printing and communicating on local or extended level3 - good results with MAG3 kidney studies.5 Conclusions An upgraded four layer professional interfacing card was built for the ISA bus, together with the installation disk and a manual. The whole installation procedure of inserting the interfacing card in an empty slot of on IBM PC compatible computer and the installation of the acquisition software are simple and can be performed by a nuclear medicine technologist. Entering the scintigraphic data has been simplified by replacing the absolute address- ing (DMA) with PORT input/output access. The image orientation, the zoom size, image size and the shape are controlled by software. The ADC dynamic non-linearity correction is applied to high count images. As cardiac gated acquisition with two low-memory buffers has high count loss (over 20%), there is a need for 32-bit operational system and 32-bit C programming language. To improve the speed of the acquisition (first pass studies), upgrading the interfacing card by using the new PCI bus is necessary in the next project activities. Acknowledgement The research work was granted by the International Atomic Energy Agency in Vienna, Austria and the Ministry for Science and Technology of Slovenia. References 1. Fidler V, Prepadnik M. Razvoj PC grafične postaje za medicinsko slikanje. Zbornik prispevkov s kongresa slovenskega društva za medicinsko informatiko z mednarodno udeležbo, Bled, 20-23, September 1992: 55-60. 2. Fidler V, Prepadnik M, Hojker S. Development of Non-Symmetric Two-Dimensional Filtering in Fourier Transform Space. Information Processing in Medical Imaging. Progress in Clinical and Biological Research, 363, New York: Wiley-Liss, 1991: 95-106. 3. Fidler V, Prepadnik M, Fettich J. Development of Nuclear Medicine Computer System for Acquisition and Analysis of Scintigraphic Image Data. CADAM-95 (Computer Aided Data Analysis in Medicine). Institut "Jozef Stefan", IJS Publishing, 125-35. 4. Kopp P. IAEA Gamma Camera Interface Cards. Test Programme and Results for the Slovenian Interface. IAEA report, l-3,Vienna: 9-th August, 1995. 5. Bergmann. Software control of normal kidney studies. COST B2 project. EANM'95 congress. Brussels: August, 1995 (in press).