Búsqueda Imágenes Maps Play YouTube Noticias Gmail Drive Más »
Iniciar sesión
Usuarios de lectores de pantalla: deben hacer clic en este enlace para utilizar el modo de accesibilidad. Este modo tiene las mismas funciones esenciales pero funciona mejor con el lector.

Patentes

  1. Búsqueda avanzada de patentes
Número de publicaciónUS5871019 A
Tipo de publicaciónConcesión
Número de solicitudUS 08/935,128
Fecha de publicación16 Feb 1999
Fecha de presentación22 Sep 1997
Fecha de prioridad23 Sep 1996
TarifaPagadas
Número de publicación08935128, 935128, US 5871019 A, US 5871019A, US-A-5871019, US5871019 A, US5871019A
InventoresMarek Belohlavek
Cesionario originalMayo Foundation For Medical Education And Research
Exportar citaBiBTeX, EndNote, RefMan
Enlaces externos: USPTO, Cesión de USPTO, Espacenet
Fast cardiac boundary imaging
US 5871019 A
Resumen
An ultrasonic transducer acquires a series of ultrasound tomograms as it continuously rotates through a range of angles. When positioned in a left ventricular long axis view, serial sectional slices are acquired within 6 seconds from which a 3D image is reconstructed. The boundary of the left ventricle is identified in this 3D image using a reference database produced by a learning process that captures expert knowledge of left ventricle cavity shapes.
Imágenes(5)
Previous page
Next page
Reclamaciones(2)
I claim:
1. A method for producing a cardiac image using a rotatable ultrasonic transducer, the steps comprising: producing a signal indicative of cardiac phase;
acquiring a series of tomographic data sets as the ultrasonic transducer is continuously rotated through a range of angular orientations, each acquired tomographic data set depicting a cross-section through the subject heart at an angular orientation indicated by the ultrasonic transducer and at a cardiac phase indicated by said signal;
selecting a particular cardiac phase which the cardiac image is to depict;
producing a 3D image data set by selecting from said series of tomographic data sets tomographic data sets acquired at substantially the selected cardiac phase and at different transducer angular orientations;
producing said cardiac image from said 3D image data set.
2. A method for identifying the location of a cardiac cavity boundary in a 3D image data set, the steps comprising:
establishing a reference database which indicates the likely location of a plurality of nodes on the cardiac cavity boundary with respect to a set of cardiac reference locations;
identifying the cardiac reference locations in the 3D image data set;
establishing an initial cardiac cavity boundary by interpolating between the identified cardiac reference locations in the 3D image data set;
establishing regions of interest in the 3D image data set corresponding to the location of each node in the reference database; and
calculating a location in each region of interest which represents the most likely location of the cardiac cavity boundary therein.
Descripción
STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH

This invention was made with U.S. Government support awarded by the National Institute of Health (NIH) Grant No.: HL 52494. The U.S. Government has certain rights in this invention.

CROSS REFERENCE TO RELATED APPLICATION

This application is based on provisional application Ser. No. 60/026,541, filed on Sep. 23, 1996 and entitled "FAST CARDIAC BOUNDARY IMAGING".

BACKGROUND OF THE INVENTION

The field of the invention is echocardiography and particularly, the measurement of left ventricular volume using 3D ultrasound data.

Assessment of left ventricular ("LV") function is clinically important. Diastolic and systolic volumes and derived parameters, such as ejection fraction, are generally accepted indicators of LV function. Echocardiography is a widely available clinical method which allows measurement of these parameters. Precision and accuracy of echocardiographic measurements is typically compromised by user's subjectivity, limited windows of access for obtaining echocardiographic scans, and ultrasound signal attenuation and scattering resulting in image artifacts.

In the past decade, compared to single or biplane tomographic techniques that require geometrical assumptions about LV shape, three-dimensional (3D) echocardiography has been shown to provide more precise and accurate evaluation of cardiac volumes. This is particularly relevant in patients with irregular LV geometry, detected during an initial echocardiographic study through multiple tomographic projections. So far, however, the 3D technique has been limited to experimental use due to cumbersome image acquisition (i.e. restricted access windows, long acquisition times, custom probes and special probe holders), time consuming and subjective data processing (i.e. digitization from video tapes and manual delineation of boundaries in numerous serial tomograms), the use of special projections (i.e. parallel or rotational scans with specific incremental steps), and mapping of endo- and epicardium to multiparameter (i.e. computationally intense and subjective for required adjustment of multiple features) models and allowed only limited objective utilization of a priori knowledge about LV geometry.

The concept of 3D ultrasound data acquisition was first described by Baum and Greenwood in 1961, (G. Baum and J. Greenwood, "Orbital Lesion Location by Three-Dimensional Ultrasonography", N.Y. State J Med, 61:4149,4157, 1961). They obtained serial parallel ultrasound images of the human orbit and created a 3D display by stacking together sequential photographic plates bearing the ultrasound images.

Using a transthoracic echocardiographic (TTE) approach, Dekker et al., (D. L. Dekker, R. L. Piziali and D. Dong Jr., "A System For Ultrasonically Imaging The Human Heart In Three Dimensions", Comput. Biomed. Res., 7:544-553, 1974), were among the first to obtain a 3D computer matrix of ECG and respiratory gated image data with a probe attached to a mechanical arm which tracked its spatial motion. Images were subsequently displayed as selected 2D sections. Geiser et al., (E. A. Geiser, L. G. Christie, Jr., D. A. Conetta, C. R. Conit and G. S. Gossman, "A Mechanical Arm For Spatial Registration Of Two-Dimensional Echocardiographic Sections", Cathet. Cardiovasc. Diagn., 8:89-101, 1982), and other investigators have also employed mechanical location systems because of their relative simplicity and low cost.

Ghosh et al., (A. Ghosh, N. C. Nanda and G. Maurer, "Three-Dimensional Reconstruction Of Echocardiographic Images Using The Rotation Method", Ultrasound Med. Biol., 8:655-661, 1982), used a mechanical arm which permits rotation of the transducer only about its imaging axis. Rotation was registered by a precision potentiometer. Although still relying on mechanical parts, this approach introduced a fixed polar coordinate system resulting in a proportionally sampled LV contour in 30° angular increments. Several other investigators have pivoted or rotated the transthoracic transducer at a single location in an effort to obtain tomograms for 3D reconstruction of the LV from a single acceptable acoustic window. The quality of these reconstructions was often limited by the available window and variations in contact of the transducer face with the skin surface during the lengthy acquisition.

Mortiz et al., (W. E. Moritz, and P. L. Shreve, "A Microprocessor-Based Spatial-Locating System For Use With Diagnostic Ultrasound", Pro. IEEE, 64:966-974, 1976), introduced an acoustic position location system ("spark gap"). They employed this device to obtain an arbitrary series of sector scans through the heart which were used to create a computer 3D wire frame model of the LV and calculate its volume (W. E. Moritz, A. S. Pearlman, D. H. McCabe, D. K. Medema, M. E. Ainsworth and M. S. Boles, "An Ultrasonic Technique For Imaging The ventricle In Three-Dimensions And Calculating Its Volume", IEEE Trans. Biomed. Eng., 30:482-492, 1983). King and his coworkers applied this system to guided image acquisition for clinical quantitative evaluation of the LV (D. L. King, M. R. Harrison, D. L. King Jr., A. S. Gopal, R. P. Martin and A. N. DeMaria, "Improved Reproducibility Of Left Arterial And Left Ventricular Measurement By Guided Three-Dimensional Echocardiography", J. Am. Coll. Cardiol., 20:1238-1245, 1992; P. M. Sapin, K. D. Schroder, A. S. Gopal, M. D. Smith, A. N. DeMaria and D. L. King, "Comparison Of Two- And Three-Dimensional Echocardiography With Cineventriculography For Measurement Of Left Ventricular Volume In Patients", J. Am. Coll. Cardiol., 24:1054-1063, 1994; A. S. Gopal, M. J. Schnellbaecher, Z. Shen, O. O. Akinboboye, P. M. Sapin and L. D. King, "Freehand Three-Dimensional Echocardiography For Measurement of Left Ventricular Mass: In Vivo Anatomic Validation Using Explanted Human Hearts", J. Am. Coll. Cardiol., 30:802-810, 1997). Other investigators have also used the spark gap system for calculation of left ventricular volume, mass and for determination of the mitral valve shape. This transducer location technique eliminated the physical connection between the transducer and the reference system thus overcoming some of the restrictions imposed by mechanical transducer location systems. The technique, however, requires a clear line of sight between the transmitting and receiving elements which may not always be feasible. Another disadvantage is that taking tomograms at arbitrary angles may cause unnecessary over-sampling of certain regions and under-sampling elsewhere.

Maehle and coworkers (J. Maehle, K. Bjoernstad, S. Aakhus, H. G. Torp and B. A. J. Angelsen, "Three-Dimensional Echocardiography For Quantitative Left Ventricular Wall Motion Analysis: A Method For Reconstruction Of Endocardial Surface And Evaluation Of Regional Dysfunction", Echocardiography, 11:397-408, 1994), evaluated rotational acquisition system using only 3 or 4 tomograms acquired in polar coordinate. The rest of the LV contour was restored using spline interpolation. This "triplane" or "quadruplane" approach has expectably proven to be superior over single- or biplane methods. The limited number of views makes this method sensitive to foreshortening of the LV apex and may not be sufficient for reproduction of LVs with complicated shape. This work, however, highlighted the fact that a limited number of tomograms greatly reduces an elaborate outlining of an LV contour while still providing valuable information about its function.

The transesophageal echocardiographic (TEE) technique provided a new window to the heart after its clinical introduction in the 1980's (J. B. Seward, B. K. Khandheria, J. K. Oh, M. D. Abel, B. W. Hughes, W. D. Edwards, B. A. Nichols, W. K. Freeman and A. J. Tajik, "Transesophageal Echocardiography: Technique, Anatomic Correlation, Implementation And Clinical Applications", Mayo Clin. Proc., 63:649-680, 1988). Close proximity of the transducer to the heart allowed uniformly higher quality images than those provided by transthoracic echocardiography. Kuroda, Greenleaf, et al. (T. Kuroda, T. M. Kinter, J. B. Seward, H. Yanagi and J. F. Greenleaf, "Accuracy Of Three-Dimensional Volume Measurement Using Biplane Transesophageal Echocardiographic Probe: In vitro Experiment", J. Am. Echo., 4:475-484, 1991) describe 3D LV reconstruction for morphology and volume assessment using a set of sequential 2D tomographic longitudinal images acquired by rotation of the shaft of a transesophageal probe. Martin et al. (R. W. Martin and G. Bashein, "Measurement Of Stroke Volume With Three-Dimensional Transesophageal Ultrasonic Scanning: Comparison With Thermodilution Measurement", Anesthesiology, 70:470-476, 1989; R. W. Martin, G. Bashein M. L. Nessly and F. H. Sheehan, "Methodology For Three-Dimensional Reconstruction Of The Left Ventricle From Transesophageal Echocardiography", Ultrasound Med. Biol., 19:27-38, 1993) have devised an endoscopic micromanipulator for multiplanar transesophageal echocardiographic (TEE) imaging. This system requires a modified transesophageal probe which allows controlled "fan" sweeping with the transducer, thus collecting a pyramidal volume of images. This system capitalizes on an unlimited ultrasound window through the transesophageal access.

Pandian et al. (N. G. Pandian, N. C. Nanda, S. L.

Schwartz, P. Fan, Q. Cao, R. Sanyal, T. Hsu, b. Mumm, H.

Wollschlager, A. Weintraub, "Three-Dimensional And Four-Dimensional Transesophageal Echocardiographic Imaging Of The Heart And Aorta In Humans Using A Computed Tomographic Imaging Probe", Echocardiography 9:677-687, 1992) have evaluated the first commercially available Echo-CT system (Tomtec Imaging Systems, Inc.) for LV function assessment. This PC-based system processes the video signal from an ultrasound scanner and features a model for ECG and respiratory gating. It uses movable holders for TTE probes and a dedicated TEE probe which is made straight and stiff after insertion for an incremental parallel scanning. This system provides dynamic 3D images and can be accommodated to virtually any acquisition geometry and imaging system (N. C. Nanda, R. Sanyal, S. Rosenthal and J. K. Kirklin, "Multiplane Transesophageal Echocardiographic Imaging And Three-Dimensional Reconstruction", Echocardiography, 9:667-676, 1992). However, complicated articulation of the TEE probe and rather bulky mechanical adapters for TTE probes make a routine use of this system difficult.

Variable plane (multiplane) transducers have recently been introduced by all major ultrasonic transducer manufacturers (Hewlett Packard, Acuson, Aloca, Toshiba, etc.). A miniature transducer array is mechanically rotated inside the probe tip to acquire successive tomographic views, which combined form a 3D image data set. Typically, both ECG and respiratory gating are used so that each incremental view is acquired during the same phase of the cardiac and respiratory cycles. This requires several minutes to collect a complete 3D data set and it is difficult to keep the patient motionless and the transducer in proper position.

Another factor contributing to extended scan time is the fact that ultrasound cardiac images are prone to noise, signal dropout, and other artifacts. This and an intrinsic variability of biological shapes make it very difficult to identify heart cavity boundaries without an extensive 3D data set which requires a long time to acquire.

A single application of noise removal and edge detection operators, such as those described by Pitas and Venetsanopoulos (I. Pitas and A. N. Venetsanopoulos, "Order Statistics In digital Image Processing", Proceedings of IEEE 80:1892-1921, 1992) results in sparse information about cardiac boundaries. Additional a priori knowledge about LV shape consuming manual delineation.

Coppini et al. (G. Coppini, R. Poli and G. Valli, "Recovery Of The 3-D Shape of The Left Ventricle From Echocardiographic Images", IEEE Transactions On Medical Imaging 14:301-317, 1995) combine conventional edge detection methods and edge grouping through a curvature analysis with a conventional, two-layer neural network, trained on edge position, direction length, angle, and other local parameters to determine which edge was associated with the LV boundary. Subsequently, an elastic, closed surface ellipsoidal model is used to form the endocardial surface by fitting into the recognized edges. Parametrization of the model represents a significant computer load and requires user-guided adjustment of values controlling flexibility and expansion of the model.

Manhaeghe et al. (C. Manhaeghe, I. Lemahieu, D. Vogelaers and F. Colardyn, "Automatic Initial Estimation Of The Left Ventricular Myocardial Midwall In Emission tomograms Using Kohonen Maps", IEEE Transactions on Pattern Analysis and Machine Intelligence 16:259-266, 1994) use self-organizing maps (SOM) to delineate myocardial midwall in emission tomograms. The SOM is an unsupervised neural network technique, introduced by T. Kohonen (T. Kohonen, "Self-Organizing Maps", Springer-Verlag, N.Y., 1995). The SOM consists of nodes that distribute themselves according to intensities in the emission images. Connection of neighboring nodes results in a closed outline of the myocardial midwall.

SUMMARY OF THE INVENTION

The present invention is practiced by rapidly acquiring a 3D image data set using an ultrasonic transducer, processing the 3D image data set to locate a cardiac cavity boundary, and calculate the volume within that cardiac cavity boundary.

One aspect of the invention is the quick acquisition of a 3D data set using a rotating ultrasonic transducer. The quick acquisition of ultrasound tomograms is based on a continuous rotation of the transducer while acquiring serial sectional planes. No gating is employed, however, the cardiac phase is recorded as each serial sectional plane is acquired. The number of collected images is a product of a time of rotation and a frame rate. For example, a typical 6-second rotation with 30 frames/sec will collect 6×30=180 frames over 180° span, i.e. 1 frame will represent 1° increment which is sufficient for high resolution 3D reconstruction of static structures.

When applied to cardiac imaging the continuous collection of all image frames remains unchanged, but only those frames associated with a particular cardiac cycle phase (i.e. R wave, T wave, etc.) are selected for the 3D image data set. Assuming 80 beats/min. and 6-second rotation, then 8 slices yield gating for one phase. This slice sampling determines lower-resolution (gross-anatomic) 3D reconstruction of a heart and provides data for precise and accurate left ventricular volume measurement. Slower rotation (and thus acquisition longer than 6 seconds) results in more collected frames and, therefore, higher slice resolution, if required. Creation of a series of volumes for several cardiac cycle phases yields four-dimensional (4D) imaging (height, width, depth, time).

Another aspect of the invention is the identification of a cardiac cavity boundary from a limited 3D image data set. A reference database which indicates the likely location of nodes on the cardiac cavity boundary is established by a learning process and during a performing process regions of interest are located in the acquired 3D image data set corresponding to the node locations in the reference database, and the cardiac cavity boundary is located in each region of interest using the 3D image data therein.

A general object of the invention is to acquire 3D ultrasound image data in a short scan time. By continuously rotating the ultrasonic transducer and acquiring tomogram slices at the maximum frame rate an entire 3D image data set can be acquired in seconds. This enables images of moving organs such as the heart to be acquired at many of its phases.

Another object of the invention is to locate cavity boundaries in variable (i.e., lower-resolution or dense) 3D ultrasound image data of typically limited quality (noise, dropouts, etc.). A learning process in which experts identify cavity boundaries in 3D images is used to produce a reference database which indicates regions where the cavity boundary is most likely to be found. This reference database is employed during a performing process to locate the cavity boundary in a 3D image of a patient.

The foregoing and other objects and advantages of the invention will appear from the following description. In the description, reference is made to the accompanying drawings which form a part hereof, and in which there is shown by way of illustration a preferred embodiment of the invention. Such embodiment does not necessarily represent the full scope of the invention, however, and reference is made therefore to the claims herein for interpreting the scope of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a pictorial representation of the imaging planes from which a rotating ultrasonic transducer acquires a 3D image data set according to the preferred embodiment of the invention;

FIG. 2 is a flow chart of a program that assigns to each image pixel a probability of a presence of a cardiac boundary (a CWTR detector) used in the preferred embodiment of the invention;

FIG. 3 is a flow chart of a program which carries out the learning process and the performing process of the present invention;

FIG. 4 is a schematic representation of the scheme of initial node placement on one out of 48 hemielliptic contours that form the initial hemiellipsoid, individual nodes are distributed proportionally along each contour, and assignment of mitral and apical nodes supports spatial orientation of the generated hemiellipsoid;

FIG. 5 is a schematic drawing of nodes mapped onto a rectangular lattice which defines their neighborhood relationships in which direct linking represents neighborhoods along the endocardial circumference within a slice, cross-linking connects neighborhoods across adjacent slices, and diagonal linking is a neighborhood connection to a neighbor of the node bridge by a cross-link;

FIG. 6 is a schematic representation of how the average node position is defined by a mean vector between an initial node position and the nearest point on an expert outline;

FIG. 7 is a pictoral view which demonstrates mapping of a left ventricular endocardial surface as it can be obtained from a patient using quick echocardiographic image acquisition and the performing process of the present invention; and

FIG. 8 is a block diagram of the preferred embodiment of the fast cardiac boundary imaging (CBI) system.

DESCRIPTION OF THE PREFERRED EMBODIMENT

Quick image acquisition is performed with ultrasonic transducer 8 during a clinical study using "propeller" rotational imaging geometry, as shown in FIG. 1. Although other comparable geometry can be used, an important characteristic of the "propeller" geometry is that the slice resolution is unchanged along the imaging axis at the same radial distances. This property makes this technique particularly useful for reconstruction of images of the whole LV. Referring to FIG. 1, the transducer 8 rotates in a 180° arc about its imaging axis 10 acquiring cross-sectional planes through the LV as indicated at 12. These cross-sectional (tomographic) planes form a data set for reconstruction of a 3D image of the LV. The last position of the imaging plane (i.e. 180°) is a mirrored image of the initial position of the imaging plane (i.e. 0°). In the TTE approach, for complete reconstruction of the left ventricle (LV), for example, the points which are located at the cross-section of the MV annulus are indicated at 14. The assumed long axis of the LV is defined by a line extending from the annulus center to an LV apex indicated at 16. This LV long axis may not be parallel to the imaging axis 10 of the transducer 8. The MV hinge and apical points 14 and 16, respectively, in the set of cross-sectional planes determine the spatial orientation of the LV. The commercial availability of a rotatable TTE transducer 8 is anticipated. The same geometry also applies to transducer and a rotatable TEE commercially available from Hewlett Packard and sold under the trademark OMNIPROBE. This transducer has been used in the preferred embodiment.

Using low density rotational geometry, i.e. with as few as three or four slices, yields accurate LV volumes. The validation has been performed in vitro using axially symmetrical latex balloons or mildly asymmetrically deformed balloons with a smooth transition from deformed to intact regions. Under these circumstances, spline interpolation, which has been used to fill the voids between adjacent slices, reproduces the endocardial surface adequately for accurate volumetric results. However, limited surface sampling made this method sensitive to apical foreshortening, and therefore, unsuitable for reproduction of more complicated shapes, and improper for 3D anatomical reconstruction. Additionally, LV boundaries are often incomplete in ultrasound images due to signal attenuation and noise. Checking of data in adjacent reconstructed slices (i.e. 3D mathematical solution) may substitute information for adequate manual or computer-driven delineation of the LV cavity boundary. A large angular span between adjacent slices (i.e. 45° or 60° using four or three slices, respectively) may not provide sufficient sampling along the rotational circumference (i.e. insufficient slice resolution) to approximate missing LV wall anatomy from the previous and subsequent slices.

For a typical size of the papillary muscles or width of the left ventricular outflow tract (LVOT), the circumferential distance between boundary points should not exceed 1-1.5 cm even in a dilated LV. Depiction of 3D anatomy using this level of slice resolution is termed herein as "gross-anatomy imaging". Approximately 6 to 9 tomograms spread over 180° rotation of the transducer 8 are required to yield this circumferential distance from 1.0 to 1.5 cm between adjacent slices in a dilated LV with a short axis diameter of 6 cm. If the dilated LV has a hemiellipsoidal geometry and its long axis is 9 cm, then the circumference of the endocardium in each long-axis tomogram (i.e. the circumference of a hemiellipsis) is approximately 21 cm. This circumference can be divided into 14 to 21 segments to obtain the desired sampling of 1.0 to 1.5 cm. In the preferred embodiment boundary partitioning with 17 nodes into 16 longitudinal segments is done in each long-axis tomogram for endocardial contour mapping.

Constantly rotating transducers have been employed in clinical studies. No reinsertion of the TEE probe or attachment of rotational devices for TTE scanning was necessary. Rotation over 180° took only 6 seconds to complete. This short scan time allowed a repeat of image collection during the course of a routine clinical study to achieve optimal viewing angles. This approach assumes a regular cardiac rhythm, which may not be the case even in a normal subject where the heart rate increases and decreases periodically with quiet inspiration and expiration by approximately 5% (i.e. sinus arrhythmia). These slight irregularities in the cardiac rhythm may cause only barely discernible distortion in the interpolated, gross-anatomical 3D reconstructions.

Only patients with a heart rate equal to or greater than 60 beats/min (bpm) were considered for data acquisition in order to collect at least 6 tomograms for sufficient slice resolution. However, this did not represent an obstacle because most patients have a heart rate above the 60 bpm limit. Rotatable transducers with an adjustable rate of rotation would remove this limitation and are under commercial development by Hewlett Packard and Acuson. Post-priori ECG gating was used to interactively pick appropriate slices. Six-second breathholding was not practical in sedated patients examined by TEE. Thus, respiratory gating was not used and adjacent slices were mutually registered using a cross-correlation method to compensate for transducer motion relative to the heart during the respiratory cycle.

Quick image acquisition using a continuously rotatable transducer 8 is a clinically feasible method of 3D image data collection that offers many advantages. The number of collected tomograms during one sweep is a product of the time of transducer rotation and an acquisition frame rate. The requirement to obtain at least six post priori ECG-gated images can be satisfied in most cases. A slower rotation rate (and thus an acquisition time longer than 6 seconds) allows collection of a sufficient number of tomograms in patients with bradycardia, or it provides higher slice resolution (if required) in patients with a heart rate over 60 bpm. Unlike conventional approaches to serial image acquisition, where the ultrasonic scanning plane is incrementally rotated with respect to pre-determined ECG and respiratory gating limits, the present invention introduces the concept of a quick acquisition using continuous transducer rotation. Distortion of the reconstructed gross anatomy from the resulting lower resolution 3D image data set does not influence LV volume measurement in a statistically detectable manner (i.e. the resulting volumes were precise and accurate). No assumption about heart rate regularity is necessary if the transducer 8 also produces an indication of its angular orientation during rotation.

The rapid continuous acquisition technique actually collects images throughout typically 6-9 complete cardiac cycles over the 6-second period of transducer rotation, assuming a heart rate of 60-90 bpm. This method is thus a source of quickly acquired four-dimensional (4D) data of a beating heart, where the fourth dimension is cardiac phase and each tomographic, cross-sectional plane is acquired while the heart is at a particular phase of its cardiac cycle. The cardiac phase is recorded (using ECG tracing) along with the acquired tomographic images during the 6-second rotational scan of the transducer 8. Thus, 6-9 complete 3D image data sets can be formed, and the data sets represent 6-9 successive cardiac phases. Redundant data along the imaging axis 10 (i.e. at an intersection of the tomographic planes) are averaged, and missing image data (due to drop outs, etc.) for a particular angle and cardiac phase can be interpolated from nearby samples.

The method is also useful for image acquisition from static organs (e.g. abdominal 3D ultrasound, etc.) where a 6-second acquisition at 30 frames/sec with no need for gating results in 6×30=180 collected serial images and thus yields a rapidly-acquired, high resolution 3D image with 1° slice increments.

The second aspect of the invention is a novel approach for analyzing the acquired 3D image data set to accurately define the LV boundary and measure LV cavity volume. The approach includes a new, noise-resistant cardiac boundary detection process, based on order statistics, and a new solution for 3D mapping of a cardiac cavity surface, which makes use of incomplete (i.e. dropout-prone) echocardiographic images. The latter system consists of a unique learning algorithm and a novel 3D application of neural network techniques of self-organization. In the preferred embodiment, the system is applied to the analysis of the LV.

Echocardiographic images can be separated into two classes--the cavity blood pool, characterized by a low mean value of gray, and the myocardium, characterized by a high mean value of gray. Cardiac boundaries are indirectly indicated as the interface between these two classes. This interface, however, may not exactly match endo- and epicardium boundaries due to artifacts that are often associated with ultrasound images.

Major artifacts (image dropouts) are caused by signal attenuation or parallel orientation of the beam with respect to the boundary. Conventional edge detectors are sensitive to noise, typically contained in ultrasound images, and produce results with numerous false edges. Complicated recognition methods and user-controlled thresholding methods are then required to pick only those edges that are related to the LV boundary. Various noise-filtering techniques are available, however, they have to be used carefully to prevent or at least minimize deterioration of true edges.

A block diagram of the preferred embodiment is shown in FIG. 8. It employs the quick image acquisition technique described above and carried out with the rotatable echocardiographic transducers 8. It also includes a computer cardiac boundary imaging (CBI) system, implemented as a C language program using a commercially available software package (Khoros 1.0, The University of New Mexico, 1992) and a Sun SPARCstation 20. Appendix 1 discloses a user interface as it appears after activation of this code. Appendix 2 discloses a file "CBI.pane" which defines this interface. Appendix 3 discloses a file "CBI.conf" which defines appropriate configuration and library links for the Khoros 1.0 package.

Appendix 4 discloses a file "CBI.prog" which is the complete C code which performs the knowledge-based cardiac boundary imaging system. This code includes appropriate library calls for implementation in Khoros 1.0. The code automatically generates data files ROI-- ITER-- D and ROI-- ITER-- S (number of learning iterations for diastolic and systolic contours); ROI-- X-- D and ROI-- X-- S (x-coordinates of vectors describing diastolic and systolic contours); and ROI-- Y-- S and ROI-- Y-- S (y-coordinates of vectors describing diastolic and systolic contours). The C code includes standard subroutines for spline interpolation (i.e. spin2, splie2, spline, splint), array memory space allocation (i.e. vector, matrix, cube, hypercube) and removal (i.e. free-- vector, free-- matrix, free-- cube, free-- hypercube), and a standard error message (i.e. nrerror) published in W. H. Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling, "Numerical Recipes in c. The Art of Scientific Computing", Cambridge University Press, New York, N.Y., 1989. The source code in Appendix 4 contains explanatory notes and process block numbers which are used in the following description of the preferred embodiment of the invention.

The cardiac cavity boundary imaging system of the present invention includes a "learning" process 60 and a "performing" process 62. The flow chart for these two processes is shown in FIG. 3. The learning process 60 requires as input at process block 64 a set of serial echo tomograms with expert outlines of the endocardium and with labeled apical (AP) and mitral valve MV hinge points 16 and 14, respectively. Clinical tomograms must be collected consistently, starting with a four-chamber long-axis image and rotating in a counter-clockwise direction (when looking at a TEE transducer face) or clockwise direction (when looking at a TTE transducer face). A preprocessing step is required to normalize gray scale levels (in 8-bit images used in the preferred embodiment) to a range from 1 to 250. An echocardiography expert defines the MV and AP points 14 and 16, respectively, using 1×1 pixel labels, as well as the endocardium outline in each tomogram. The pixel labels and the outline must be of unique intensity values other than 1 to zero.

The learning process generates an initial estimate of LV size and geometry at process blocks 66 and 68 by fitting a deformable hemiellipsoid (represented by proportionally distributed nodes) into the identified AP and MV points 16 and 14, respectively, in each echotomogram of the set. As shown in FIG. 4, a spline, that starts at one of the MV points 14, continues through the AP point 16 and ends at the other MV point 14, is generated in each slice thus creating initial hemielliptical contours. Contours produced from all tomograms form a hemiellipsoid which fits into the MV and AP points 14 and 16. A total of 48 hemielliptical contours are generated for a 3D data set, but because only 6-9 outlined tomograms typically compose the patient cardiac 3D scan, the intermediate contours are generated using bicubic spline interpolation. Subsequently, 49 nodes 17 are distributed proportionally along each contour and thus placed in initial positions to divide the contour into 48 partitions. The first and last (49th) nodes are called the MV nodes 14, because they match the MV point positions, and the middle (25th) node is called the AP node 16. This completes an initial estimate of the LV cavity boundary surface by a hemiellipsoidal model based only on the MV and AP points 14 and 16 labeled by the expert user in all component tomograms. This is referred to herein as the "initial LV estimate".

As shown in FIG. 5, the design with 48 contours and 49 nodes per contour provides a framework for node mapping into a 2D lattice with 48×49=2352 elements. This mapping represents a standard database for description of LV geometry and its variations. No matter how many serial tomograms are actually collected during the learning process 60, they are consistently interpolated into a 48×49 lattice of nodes.

A positional vector between each node of the hemiellipsoidal model and the nearest point on the echotomogram outline is calculated at process block 70. As shown in FIG. 6, a positional vector 20 from the initial node location 17 in an initial LV estimate to the nearest point of the expert LV outline is calculated for each node 17 in the data set. This is repeated using various, expert-outlined, serial LV tomograms. The resulting mean value of the vector 20 defines an average node position 21. A two standard deviation (SD) range around the average node position 21 defines an ROI where a search for the LV boundary in the acquired image data begins. Individual ROIs 22 may topologically overlap, but are treated separately by the system. The size of the individual ROIs 22 shows the degree of probable variation of LV geometry at each particular average node location based on the knowledge embodied in the expert LV outlines. This way the system creates a priori knowledge about plausible LV geometry (i.e. an average LV model) and its variation.

The average LV model is defined by vectors in a "reference" database 72. The vectors can be recalled by the performing process 62, as diagrammatically shown by link 76. The reference database 72 of node position vectors is generated by the learning process 60 during its first activation and is expanded by new vector measurements whenever a new expert outline is input. The latter is indicated by loop 74. The database has been designed with the following dimensions (Di):

D1 --standardized number of 48 outlines;

D2 --standardized number of 49 nodes per outlines;

D3 --number of examined phases, currently 2 (i.e. diastole and systole);

D4 --number of learning iterations per node at a particular phase, (i.e. number of patient data sets used for learning).

The reference database 72 contains original positional vectors and it outputs these through link 76 along with their mean and 2SD values whenever requested by the performing process 62. Thus, for example, 51,744 positional vectors are stored for the standard number of 2352 nodes and 2 phases after 11 learning iterations. These data allow description of average LV diastolic and systolic geometry in 3D , yet result in a very small memory load.

The positional vectors in reference database 72 do not define LV shape directly. Rather, they provide plausible spatial constraints in which the LV cavity boundary should exist with respect to an initial estimate of LV geometry. The spatial constraints are expressed as the ROI 22 around each individual average node position 21. As will be described below, the initial estimate is (similarly to the learning process 60) carried out also during the performing process 62 by fitting splines through MV and AP points 14 and 16 in patient tomograms, thus creating the initial 3D hemiellipsoidal model. This assures compatibility between the learning and performing processes and gives the system the desired flexibility to deal with various LV sizes and geometries. Naturally, computer knowledge and the resulting performance can be only as good as the preceding learning process 60. Separate reference databases 72 may be required not only for diastolic and systolic geometries, but also for intermediate phases or for various clinical pathologic entities.

In the performing process 62, serial tomograms acquired from a patient with user-labeled apical and mitral points are input at block 80. The user manually identifies the apical and mitral points 16 and 14 in each image using a cursor. This initial user interaction is the only manual input in an otherwise automatic LV cavity boundary detection process. The performing process 62 employs (through the link 76) the reference database 72 to locate the LV boundary in these patient 3D image sets.

In the preferred embodiment a cavity-to-wall transition region ("CWTR") detection process 36 is used on the acquired 3D image data set 38 in the performing process 62. This detection process is illustrated by the flow chart in FIG. 2 which will now be described. Histogram equalization of the 3D image data set 38 is performed first at process block 40, followed by two iterations of a median filter to suppress impulsive noise indicated at process block 42. This is followed by a so called "HiLomean" filter indicated at process block 44, the output of which is normalized at process block 46 to translate its output intensity values into probabilities between 0 and 1 (i.e. CWTR probability mapping). A CWTR image 48 is also produced by multiplying the probability at each pixel by 255 as indicated at process block 50. The CWTR image indicates location of boundaries visually by high intensity bands.

The "HiLomean" filter 44 used in the preferred embodiment is an important element of the boundary detection process and will now be described in detail.

In general, a rank ordered mean filter can be defined as follows: ##EQU1## where β (0<β≦1) defines the selected rank in the ordered input values x.sub.(j) and n is a number of pixels in a filter window. Assuming that transition from black to white corresponds to a numerical transition from 0 to 255 in an 8-bit gray scale image, the filter defined by equation (1) can produce a mean value biased towards the lowest intensities (i.e. darkest pixel values) and has been termed the "Lomean" filter. Its operation is adjusted through a parameter β: the setting of β close to 0 will result in a significant bias to lowest intensities, the setting of β=1 will result in the conventional mean filter.

Consequently, the filter ##EQU2## can bias the mean towards high intensities as it sums the ordered input values x.sub.(j) in the descending direction. This filter is called a "Himean" filter. Setting β close to 0 will match the maximal bias, and setting β=1 will, similarly to the Lomean filter, result in conventional mean filter performance.

Taking the absolute value of the difference between Himean and Lomean values calculated in accordance with equations 1) and 2) results in a function, proportional to the probability of the presence of the CWTR. The filter 44 that calculates this function has been termed "HiLomean" filter and is defined as follows: ##EQU3##

In the preferred embodiment, an n=m×m filter window has been employed and the continuous scale of βn values has been replaced by discrete ranking characterizing the number of ordered pixel intensities within the mxm window used in the HiLomean filter. The 0th rank means that only the lowest and highest pixel intensity values were included for filter operation; the 1st rank means that 1×m lowest and highest pixel intensity values were taken; the 2nd rank means that 2×m lowest and highest intensities were considered, etc. For particular noise conditions, the lowest possible rank should be used to obtain a maximum dynamic range of the resulting values. The minimal configuration of the HiLomean filter 44 includes the use of a 9×9 pixel window. Preprocessing by at least one iteration of a 9×9 median filter prevents the blotchy appearance of the resulting images, typical for filters based on ranking of local pixel intensities. The combination of the HiLomean filter 44 with the median filter 42 and other supporting image operations (i.e. histogram equalization 40 and gray scale normalization 46) forms the CWTR detector 36.

Tests performed on average or suboptimal quality clinical echocardiographic images demonstrate that noise resistance and edge preservation is optimal using a 1st rank of ordered values and a window size between 9×9 and 17×17 pixels (for 1 pixel=0.342 to 0.457 mm calibration). The preferred configuration of the CWTR detector 36 uses a 13×13 window (i.e. a compromise between 9×9 and 17×17 pixel size).

The performing process 62 first fits an initial hemiellipsoidal model into the identified AP and MV points 14 and 16 as indicated at process block 82. This is the same step used in the learning process 60 in block 66 to produce automatically an initial outline of the LV endocardial boundary using spline interpolation through AP and MV points in each tomogram. Because of limited initial input data (i.e. only 3 points in each tomogram), the resulting contour represents a greatly generalized (hemiellipsoidal) reproduction of an LV cavity and would typically underestimate its volume, especially in asymmetrically enlarged LVs. The model provides, however, a foundation for node distribution in a 3D space with respect to LV size and orientation as revealed by the AP and MV points 14 and 16.

The next step in the performing process 62 is to distribute nodes to average positions with respect to the initial model as indicated at process block 84. This is also analogous to the learning process 60 described above. As indicated, 17 nodes are sufficient to define an LV cavity boundary in each long-axis tomogram. During learning about LV geometry, the system internally describes the boundary through the standardized database 72 with 49 nodes per slice. This number of nodes assures a reserve for future higher spatial resolution imaging. In the performing mode, however, the average position of each of 17 nodes and the size of the corresponding ROI for each node are derived from the reference database 72. Neighboring nodes are interconnected by splines. This completes generation of a 3D "average model" of the LV cavity boundary in an examined 3D data set.

In other words, automatic relocation of nodes to their "average" positions with respect to the initial model in the patient 3D data set utilizes previously gained knowledge (from experts) about a plausible LV cavity boundary shape. Location of nodes in the 3D image set and the ROI associated with each node provide information where to search for the cavity boundary of the LV, thus avoiding confusion by other cardiac boundaries and image artifacts. This point is critical for understanding the unique functioning of the system: it first learns from experts (process 60) how an LV may look like and then it uses this a priori knowledge to define a plausible variation of LV boundary location in a previously unseen patient 3D image set. This simulates the human expert process of learning and then applying the learned experience to a new situation.

The tomographic data acquired from the patient are also processed through the CWTR detector 36 to create a CWTR probability map 52. Pixel intensities in this CWTR map represent the probability of a presence of the transition region between the LV cavity and the LV wall, i.e. the probability of a presence of the cavity boundary. Automatic placement of nodes in the average outline and assignment of corresponding ROIs defined in the reference database 72 restricts this process to the endocardial region. Selectivity of individual ROIs with respect to the endocardium depends on local variability of LV shape and wall thickness in images used during the prior development of the reference database 72 (i.e. during the learning process). Construction of an initial hemiellipsoidal model, calculation of average node positions with respect to this model, and determination of corresponding ROIs represent a main pathway in the performing process 62. The CWTR detector 36 is activated independently and the resulting CWTR probability mapping is combined with the ROIs in block 86.

A modified self-organizing map (SOM) algorithm, which is implemented in block 86 as a part of the performing process 62 is responsible for a final adjustment of node positions so that they optimally fit into the CWTR. This multi-iterative procedure relocates each node from its average position in the center of the associated ROI towards a location within the ROI that represents the highest intensity values in the CWTR image. Starting with an average LV model, it forms a final LV model. This process respects node spatial neighborhood relationships. This means that each node may eventually not match the highest local CWTR probability in its ROI. This "cost-minimizing" process is elaborated on in the following paragraphs.

If the SOM algorithm were executed directly on CWTR images (without masking through the use of the ROIs as taught by the present invention), the nodes would be spread all over the image to represent distribution of pixel intensities. If the nodes were initially grouped at one spot or placed randomly, as is typically done when using the "classical" SOM algorithm, many iterations of SOM training would be required to distribute the nodes closely to the target contour. Far fewer iterations are required by the present invention to achieve the same degree of certainty because the process is limited to placing nodes in the ROIs from the reference database 72. The method according to the present invention thus changes the classic SOM algorithm in the following ways:

1) Introduction of a priori knowledge about LV geometry. This knowledge is gained during the learning process 60 and this knowledge is used to place nodes at their average positions. Thus, the distribution of nodes corresponds to LV orientation in 3D space, plausible geometry and size from the start of the SOM algorithm. This modification increases the speed of the algorithm and relates individual nodes to local anatomy. This is important for anticipated studies on regional wall motion abnormalities.

2) Restriction of each node to a ROI that represents local variation of LV geometry learned from real LV images during the learning process 60. The nodes are allowed to move freely only within their corresponding ROIs. This prevents an escape of nodes beyond the LV region and allows a logical LV outline to be produced when boundary definition by the acquired image data is suboptimal.

3) During self-organization, only immediate neighbors in 3D space are considered for position adjustment simultaneously with the winning node in the preferred embodiment (there are eight immediate neighbors mapped on a 2D lattice). This is because with typical angular increments θ=22.50 between echocardiographic tomograms (180°, 8 collected tomograms, 180/8=22.5), the neighbors beyond the immediate ones are unlikely to be anatomically related. The winning node is the one which is to be moved by a fractional distance to a point randomly selected within the associated ROI by an iterative self-organization process. The fractional distance is controlled by a learning parameter α and is set to α=0.3 in the preferred embodiment, based on previous optimization tests. Setting of α is not critical as it affects mostly the rate of approach of a node to its final position and lessly the smoothness of the resulting contour. The parameter α approaches zero during the course of finite number of self-organizing process iterations, also called "training cycles."

4) Fractional adjustment of neighboring node positions is controlled, besides the learning parameter α, also by a function of cos θ which represents a vector component of the winning node motion and effectively decreases translation of nodes in neighboring slices (i.e. in the elevation direction). Theoretically, for biplane imaging, where θ=90°, there would be no adjustment of neighbors across the tomograms (no matter how much the winning node moved) because cos 90°=0. Neighbors beyond the 90° angular distance are not considered for adjustment at all. Analogous rules apply to nodes within each tomogram (i.e. in azimuthal direction).

The modified SOM algorithm is used to perform final delineation of the LV boundary. This is accomplished through iterative spatial redistributing (organizing) of winning nodes according to their attraction to the CWTR. The SOM algorithm represents a tool for minimization of a total cost of antagonistically acting shaping and smoothing effects. The shaping effect is caused by attraction of winning nodes to areas with highest CWTR values. The smoothing effect relays this transition to neighboring nodes and results in adjustment of their positions too. Other "cost-minimizing" algorithms, such as active contour models (balloons, snakes) and parametrically deformable models could be used too, presumably with similar results but at a price of subjective adjustments of various parameters controlling their functioning.

Final fitting of the generated contour is accomplished in the preferred embodiment after 300 SOM training cycles are applied to each ROI. Thus, for final adjustment of 17 nodes (and the same number of ROIs) in 8 slices, a total of 17×8×300=40,800 training cycles are required. This requires approximately 2 minutes using the Sun SPARCstation 20.

This iterative process takes into account not only the attraction to the CWTR (as the points with higher CWTR detector output values have proportionally higher changes to be presented). It also evaluates mutual neighborhood relationships of nodes in 3D space (i.e. adjustment of a node position causes some positional adjustment of its neighbors). All nodes are eventually connected using bicubic spline interpolation thus forming at process block 88 a 3D spatial network of nodes which form a "wire frame" model as shown in FIG. 7.

LV cavity boundary recovery by the knowledge-based system is not completely automatic, although the operator involvement is minimal. The performing process 62 requires interactive manual definition of the AP and MV points 16 and 14 in each serial tomogram. Assuming a typical number of 8 tomograms, 24 points have to be labeled which requires about 1-2 minutes. From here, the system works automatically. Average node positions are determined using a priori knowledge in the stored system data base 72 gained during the process of learning, and a final adjustment of node position within a corresponding ROI is carried out over a course of tens of thousands iterations. The automatic process thus greatly minimizes the user interaction and the consequent influence of subjective manual choices made by the user.

The novelty of the knowledge-based system is not only in its ability to learn about a plausible LV geometry and its variation, but also in practical utilization of 3D spatial relationships of individual nodes for parametrization of the LV endocardial surface. It should be kept in mind that the nodes are interrelated not only within each tomogram but also across tomograms. Any positional change of a node is reflected by positional adjustment of its spatial neighbors in adjacent tomograms. If a node is associated with a noise region or an image dropout, and there is little or no clue for its final placement, its position may be derived from the spatial location of its neighbors.

An LV cavity surface acquired with 22.5° increments (8 rotational tomograms) is mapped to the lattice of nodes (FIG. 5) representing 3.75° increments (48 contours). During the learning process 60, this mapping represents organization of nodes into a reference database 72. During the performing process 62, all stages of endocardial boundary detection and formation (i.e. initial, average and final models), discussed above are generated within the frame of this lattice to assure compatibility with the reference database 72. The lattice demonstrated in FIG. 5 also establishes direct, cross, and diagonal linking (neighborhood relationships) used during the final adjustment of node positions by self-organizing process in process block 86. Spline interpolation and vector component (of a node positional adjustment) calculation are employed because spatial resolution represented by the lattice is substantially higher than that of the acquired data. A reverse process (from 3.570 to 22.5° slice resolution) is applied to place nodes and generate LV boundary outlines in original slices in the end of the performing process in block 88.

A novel knowledge-based system for delineation of the LV cavity boundary from sparse and noise-prone data has been described. System operation requires only minimal initial user interaction. The system consists of a unique statistical learning process about LV geometry and its variation and a novel performing process for automatic distribution of nodes that represent the LV endocardial surface in 3D . The two processes 60 and 62 are combined with quick image acquisition and automatic CWTR detection. The system has been applied to ultrasound images of the LV and acts as a trainable "computer expert" for delineation of endocardial boundaries and LV volume calculation. Other applications are possible, since the system can be used for surface mapping of any hollow object which on average maintains some general shape that can be represented by an initial model. The actual object can then be parametrized through differences from the initial model. The differences are described by vectors and stored in a standardized reference database 72. A major advantage of this invention is that a great deal of geometrical variability is covered by adaptation of the initial model, parametrized through node positions. Closer fitting is accomplished by relocating the nodes to their average positions with respect to the model which is based upon knowledge gained through the learning process 60. Final fitting is achieved by node position adjustment to regions with the highest probability of the presence of the endocardium (i.e. the CWTR detector) using a cost minimizing function, represented in the preferred embodiment by a modified, unsupervised neural network process (i.e. SOM). This three-stage process (i.e. initial model→average model→final fitting) is potentially also applicable to LV epicardial boundary detection, and boundary detection and volumetry of the right ventricle, and other generally ellipsoidal (or hemiellipsoidal) organ cavities.

Both learning and performing processes are associated with a special reference database 72 that accumulates data about 3D geometry of the subject and stores them in a standardized format. The reference database 72 is capable of handling different angular increments during the learning and performing modes. This is potentially useful for 3D acquisition and resulting reconstruction with various slice resolutions, even within a single image volume.

The 3D design of the system supports corrected identification of LV cavity boundary by bridging gaps through neighborhood linking of nodes in ultrasound images with dropouts and high levels of noise. Reproduction of LV surface from a multi-tomographic data set, where nodes used for surface mapping are mutually interconnected, yields an averaging (smoothing) effect, particularly desirable in the apical region with a high sampling density. Unlike single or biplane approaches, the 3D nature of the system avoids the need for assumptions about LV shapes. ##STR1##

                                  APPENDIX 2__________________________________________________________________________F 4.2 1 0 1 70×7+10+20 +35+1 `CANTATA Visual ProgrammingEnvironment forthe KHOROS System` cantataM 1 1 100×40+10+20 +23+1 `CBI` subform1P 1 0 80×38+22++0+0 `Automated Cardiac Boundary Imaging` CBIl 1 0 0 1 0 0 50×1+2+2 +0+0 "`Input Image"image in a propeller-likeformat`O 1 0 0 1 0 0 50×1+2+3 +0+0 "`Output Image"resulting output imagewith theSOM superimposed` ol 1 0 1 1 0 50×1+2+5 +0+0 0 `Cardiac phase  ``diastole` `systole``selectdiastolic or systolic phase` phasei 1 0 1 1 0 24×1+36+6 +0+0 251 255 255 `Delineation color` `valueof an LVoutline` delinclrl 1 0 1 1 0 30×1+2+6 +0+0 0 `ROI learning mode``no --v ` `yes -->``learn aboutthe ROI from expert outlines` roilrni 1 0 1 1 0 24×1+36+7 +0+0 251 255 254 `AP/MV point color` `valueof AP andMV points` pointclri 1 0 1 1 0 28×1+2+8 +0+0 2 2 300 `Cycles/node` `no. of trainingcycles per onenode` repi 1 0 1 1 0 28×1+2+9 +0+0 1 1 1 `2D neighbors``number of neighborswithin aslice` neigh2di 1 0 1 1 0 28×1+2+10 +0+0 1 1 1 `3D neighbors``number of neighborsacrossslices` neigh3df 1 0 1 1 0 60×1+2+12 +0+0 0 1 0.1 `Low alpha ``value of thetrainingparameter alpha`l-- alphaf 1 0 1 1 0 60×1+2+13 +0+0 0 1 0.3 `High alpha ``value of thetrainingparameter alpha`h-- alphaT 1 0 1 1 0 40×1+2+15 +0+0 1 `SOM algorithm:``SOM algorithmselection` algori 1 0 1 1 0 1×1+18+1 +0+0 0 1 1 `modified``modified algorithm` algi 1 0 1 0 0 1×1+18+0 +0+0 0 1 0 `classic``classical algorithm` algET 1 0 1 1 0 50×1+36+15 +0+0 5 `No. of nodes:``number of BCI nodesin oneslice` nnodi 1 0 1 0 0 1×1+24+2 +0+0 9 49 49 `49``number of nodes` ni 1 0 1 0 0 1×1+24+1 +0+0 9 49 41 `41``number of nodes` ni 1 0 1 0 0 1×1+24+0 +0+0 9 49 33 `33``number of nodes` ni 1 0 1 0 0 1×1+16+2 +0+0 9 49 25 `25``number of nodes` ni 1 0 1 0 0 1×1+16+1 +0+0 9 49 17 `17``number of nodes` ni 1 0 1 0 0 1×1+16+0 +0+0 9 49 9 `09``number of nodes` nEl 1 0 1 1 0 30×1+2+19 +0+0 1 `Output outline` `linear` `spline``Delineation ofnodes using lines or splines` delinitpT 1 0 1 1 0 50×1+36+19 +0+0 3 `Window size:` `window size forfeaturecalculation` wsi 1 0 1 0 0 1×1+24+1 +0+0 9 25 25 `25``window size` mi 1 0 1 0 0 1×1+24+0 +0+0 9 25 17 `17``window size` mi 1 0 1 0 0 1×1+16+1 +0+0 9 25 13 `13``window size` mi 1 0 1 0 0 1×1+16+0 +0+0 9 25 9 `09``window size` mET 1 0 1 1 0 50×1+2+21 +0+0 3 `Print node coord.``prints node xyzcoordinatetriplets for xprizm3 plot` coordi 1 0 1 0 0 1×1+20+2 +0+0 0 2 2 `yes - outlined apex``apex asoutlined` oi 1 0 1 0 0 1×1+20+1 +0+0 0 2 1 `yes - averaged apex``apexaveraged` oi 1 0 1 0 0 1×1+20+0 +0+0 0 2 0 `no   ``no printout` oER 1 0 1 13×2+2+25 `Execute``do operation` cmdtool CBIH    1   13 ×2+49+25  `Help`  `documentation  for  CBI`$MAREK-- TOOLBOX/doc/manpages/CBI.1EEE__________________________________________________________________________

              APPENDIX 3______________________________________/* CBI.conf */cfile: $MAREK-- TOOLBOX/src/somhfile: $MEREK-- TOOLBOX/src/somlfile: $MEREK-- TOOLBOX/src/Libman1file: $MEREK-- TOOLBOX/man/man1man3file: $MEREK-- TOOLBOX/man/man3progfile: $MEREK-- TOOLBOX/src/sompanefile: $MEREK-- TOOLBOX/repos/cantata/subformshelpfile: $MEREK-- TOOLBOX/doc/manpagessubhelpfile: $MEREK-- TOOLBOX/repos/cantata/subformstopsrc: $MEREK-- TOOLBOX/src______________________________________

                                  APPENDIX 4__________________________________________________________________________short-- prog-- descriptionThis is a practical realization of the Cardiac Boundary Imaging (CBI)algorithm. Khoros ™ software package (Khoros 1.0, The University ofNew Mexico) and Sun SPARC workstation have been used for implementationof the source C language code. Provided with this `CBI.prog` file arealso `CBI.pane` and `CBI.conf` files that define user interface andappropriate configuration within the Khoros 1.0 package, respectively.Using the same version of Khoros and apropriate hardware platformallows immediate implementation of the CBI system. The code isoriginal except for standard subroutines which include splineinterpolation (i.e. splin2, splie2, spline, splint), array memory spaceallocation (i.e. vector, matrix, cube, hypercube) and removal (i.e.free-- vector, free-- matrix, free -- cube, free--hypercube), and a standarderror message (i.e. nrerror). These routines were published in W. H.Press, B. P. Flannery, S. A Teukolsky, and W. T. Vetterling, `NumericalReceipes in C. The Art of Scientific Computing`, Cambridge UniversityPress, New York, NY, 1989.short-- prog-- description-- endshort-- lib-- descriptionThe Cardiac Boundary Imaging (CBI) library function (the C code)performs automated delineation of a left ventricular (LV) boundary in3D echocardiographic (echo) images. A series of individual echotomograms is expected in the VIFF (Khoros-specific) format. The systemcan be executed in two modes: learning and performing. In the learningmode, the images must contain expert LV cavity boundary delineation,and labeled two mitral valve (MV) hinge and one apical (AP) points. Inthe performing mode, only MV and AP labels are expected. Label means aone pixel dot at a particular location (i.e., exactly 3 labels areexpected in each tomogram). A gray scale intensities unique from therest of the image must be used for outlines and labels, preferably 255and 254, respectively, in the 8-bit tomograms.short-- lib-- description-- endman1-- long-- descriptionThe Cardiac Boundary Imaging (CBI) algorithm uses mapping of LV cavityboundary (i.e. endocardial) surface by means of a mesh of linked points(nodes) in 3D Cartesian coordinates. The CBI is based on gaining apriori knowledge about plausible (average) LV shape and its localvariability from expert endocardial outlines of various hearts during alearning proces, and applying this knowledge to selection anddelineation of endocardial boundary in 3D (i.e., mapping of endocardialsurface) during a performing process. The system learns and stores theknowledge about LV shape by means of vectors. Vectors define an`average LV model` (a plausible shape of LV surface) with respect to an`initial hemiellipsoidal model` (flexible hemiellipsoidal surface). Thehemiellipsoidal model is formed in first steps of learning by fittingsplines into MV and AP points in tomographic scans from differenthearts. Iterative execution of the learning algorithm (i.e.presentation of another cardiac expert outlines) increases the numberof vectors associated with each node thus providing better mean and SDstatistics about LV geometry. Vector values cumulated for each nodeduring iterative learning are stored in a `reference database`represented by a multidimensional matrix.The system utilizes knowledge about the plausible LV shape during theperforming process by constructing an average model with respect to aninitial hemiellipsoidal model created from examined (i.e. previouslyuknown) data, where the average node positions with their associated2SD ranges define regions of interest (ROIs) restricts furtheroperations to regions of endocardium. A custom cavity-to-walltransition region (CWTR) detector is employed during the performingprocess to assess the probability of `being a boundary point` for eachpixel in all tomograms. The CWTR detector is based on order statisticsof gray values within a 2D sliding window (kernel). It transforms theoriginal image into an array of probability values (within a range from0 to 1) where a higher value means the higher probability of a presenceof the boundary. The resulting probabilities can be displayed as a CWTRimage where cardiac boundaries appear as high-intensity bands. Eachnode is then translated from its centered position within thecorresponding ROI closer to the endocardial boundary using a modifiedself-organizing map (SOM) algorithm. This, essentially cost-minimizing,method adjusts final position of each node with respect to attractionto spots with highest CWTR values and with respect to neighborhoodrelationships of nodes. Thus, a final endocardial surface map isgenerated. Neighborhood spatial relationships and restriction to ROIsare important features that prevent inapropriate placement of nodes ortheir escape from within the endocardial region.man1-- long-- description-- endman1-- examplesman1-- examples-- endman1-- restrictionsAccepts only 1-BYTE (i.e. 8-bit grayscale) images.man1-- restrictions-- endman1-- see-- alsoman1-- see-- also-- endman3-- long-- descriptionman3-- long-- description-- endman3-- restrictionsAccepts only 1-BYTE images.man3-- restrictions-- endman3-- see-- alsosom1-9man3-- see-- also-- endusage-- additionsusage-- additions-- endinclude-- includesinclude-- includes-- endinclude-- additionsinclude-- additions-- end/* DEFINITION OF IMAGE FORMAT, COLOR MAP, AND INPUT/OUTPUTSTRUCTURES */include-- macros#define CHECKINPUT(program, image) propertype(program,image,VFF-- TYPE-- 1-- BYTE,TRUE);.backslash. proper-- num-- images(program,image,1,TRUE);\ proper-- map-- enable(program,image,VFF-- MAP--OPTIONAL,TRUE);\include-- macros-- endmain-- variable-- list struct xvimage *image, *end-- image, *readimage( );main-- variable-- list-- endmain-- before-- lib-- call if (check-- args( )) exit(1); image = readimage(CBI→i-- file); \ if (image == NULL){ \  (void) fprintf(stderr, "CBI: cannot read input image\n");\  exit(1);\ CHECKINPUT(program, image);main-- before-- lib-- call-- end/* CREATION OF LINKS TO VARIABLES CONTROLED THROUGH THE USERINTERFACE */main-- library-- call if (|ICBI(image, &end-- image, CBI→phase-- logic,CBI→roilrn-- logic,CBI→delinclr-- int,CBI→pointclr-- int,CBI→rep-- int,CBI→neigh2d-- int,CBI→neigh3d-- int,CBI→l-- alpha-- float,CBI→h-- alpha-- float,CBI→algor-- toggle,CBI→delinitp-- logic,CBI→nnod-- toggle,CBI→ws-- toggle,CBI→coord-- toggle)) {  (void) fprintf(stderr, "CBI: library call failed\n");  sleep (3);  exit(1); }main-- library-- call-- endmain-- after-- lib-- call(void) writeimage(CBI→o-- file, end-- image);main-- after-- lib-- call-- endlibrary-- includeslibrary-- includes-- endlibrary-- input.IP "phase" 15sets diastolic or systoilic cardiac phase.IP "roilrn" 15sets ROI learning or performing mode.IP "delinclr, pointclr" 15color (grayscale intensity) of LV delineation and AP/MV points.IP "rep" 15number of training repetitions for each node.IP "neigh2d, neigh3d" 15neighbors initially considered for SOM formation.IP "l-- alpha, h-- alpha" 15values of a low and high limit of the training parameter alpha.IP "algor" 15select classical or modified SOM algorithm.IP "mode3d" 15select performance in 2d or 3d mode.IP "delinitp" 15resulting outline will be generated using linear or spline interpolation.IP "nnod" 15number of nodes in each individual slice.IP "ws" 15window size employed in the CWTR detection process.IP "coord" 15prints node coordinates in xyz triplets for xprizm3library-- input-- endlibrary-- output.IP "prop-- image" 15xvimage structure, the resulting image after cylindrical torectangular coordinates conversion.library-- output-- end/* DECLARATION THE CBI FUNCTION */library-- defintICBI(image, end-- image, phase, roi, delinclr, pointclr,repetitions, neigh2d,\neigh3d, l-- alpha, h-- alpha, algorithm, delinitp,nnod, ws, coord)struct xvimage *image, **end-- image;int phase, roi, delinclr, pointclr, repetitions, neigh2d, neigh3d;int algorithm, delinitp, nnod, ws, coord;float l-- alpha, h-- alpha;library-- def-- end/* START OF THE C CODE */library-- code#define RMAX 2147483647.0#define pi 3.1415926536#define LARGE 1.0e30#define MINI 0.0001#define CLASSIC 0#define MODIFIED 1#define LINEAR 0#define SPLINE 1#define PERFORM 0#define LEARN 1#define DIASTOLE 0#define SYSTOLE 1#define MAXNONODES 49 /* SET THE STANDARD NUMBER OF NODES */#define MAXNOSLICES 48 */ SET THE STANDARD NUMBER OF SLICES */{ FILE *file; int register i, j, k, l, m, c, r, s; int c1, c2, r1, r2, s1, nd, rg, z, ss; int img-- cols, img-- rows, img-- slices, img--slsize, img-- volsize; int mov-- slices, mov-- volsize; int temp, temp1, temp2, temp-- dist, count, flg-- count; int flg-- beg, flg-- end; int roi-- count, roi-- count-- max; int value, value-- u, value-- d, value-- l, value--r; int cycles, num-- tr-- cycles, cycle-- count; int n, sum; int go, go0, go1, go2, flag; int neigh-- rad-- slc, tmp-- neigh-- rad-- slc,neigh-- rad-- vol, tmp-- neigh-- rad-- vol; int neigh-- rad-- slc1, neigh-- rad-- slc2,neigh-- rad-- vol1, neigh-- rad-- vol2; int ii, tmp-- r, tmp-- c; int numwritten, numread; int slch, slcl, nodh, nodl; int niter, iterate; int elips-- radx, elips-- rady; float yp1=1.0e30; float ypn=1.0e30; float x, x1, x2, y, y1, y2; float x-- itsc, y-- itsc; float mvc, mvr, fs; float beta, gama, delta, ang-- dif, tmp-- ang-- dif; float radius, radius-- hi, radius-- lo; float *ord-- coord, *tmpc-- coord, *tmpr-- coord; float *tmpc-- coord2, *tmpr-- coord2; float *ord1-- coord, *regc1-- coord, *regr1-- coord,*regc1-- coord2, *regr1-- coord2; float *ord2-- coord, *regc2-- coord, *regr2-- coord,*regc2-- coord2, *regr2-- coord2; float *roi-- iter; float ***roi-- x-- open, ***roi-- y-- open,***roi-- x-- all, ***roi-- y-- all; float **nod-- roi, **gr-- cntr; float **roi-- x-- new, **roi-- y-- new, **roi--x-- avg, **roi-- y-- avg; float ***nod-- coord, ***nod-- coord-- init,***nod-- coord-- all; float ***hilomn-- arr; float ****roi-- loc-- vol; float fract, tmp-- nod, tmp-- nod-- a, tmp--nod-- b, fcycles; float sumh, sumv, sumn; float aver, stdevx, stdevy; float hilomn, hilomn-- max; float reduc-- factor, vect-- comp-- factor; float tmp-- alpha, elips-- rad, slct; float dist, dist1, dist2, short-- dist, close-- dist,tmp-- dist; float fmaxnoslices, fmaxnonodes, fslc, fnd, fn, fimg-- slices,fnnod; float slcl-- frc, slch-- frc, nodl-- frc, nodh--frc; float averx, avery, averx2, avery2, sumx, sumy, sumx2, sumy2; float x1-- is, y1-- is, x2-- is, y2-- is; float ic, ir, nc, nr, cc, rr; float ftmp-- c, ftmp-- r, nc-- i, nr-- i,elips-- ratx, elips-- raty; float m1, m2, min, tmp-- min; float ang-- slc, ang-- incr-- slc, ang-- vol,ang-- incr-- vol; char tmpstr 16!; char dir 64!, filename 64!; char *program = "ICBI", end; char *khome = NULL; unsigned char *img-- val; unsigned char *mov-- val; *end-- val, *nod-- val,*reg-- val, *ftr-- val, *hit-- val; struct xvimage *endimage, *nodimage, *regimage, *ftrimage, *hitimage; void wire( ); void hilomean( ); void conpts1( ); void conpts2( ); void place-- node( ); void splin2( ); void splie2( ); void spline( ); void splint( ); void nrerror( ); void free-- vector( ); void free-- matrix( ); void free-- cube( ); void free-- hypercube( ); float *vector( ), **matrix( ), ***cube( ), ****hypercube( ); extern char *getenv( ); /* SETUP OF A PHASE AND MODE (PROCESS), INTRODUCTORYCHECKUP */if(phase==DIASTOLE) printf("\nDIASTOLIC phase,");if(phase==SYSTOLE) printf("\nSYSTOLIC phase,");if(roi==PERFORM)  printf("PERFORMING mode.");if(roi==LEARN)  printf("LEARNING mode.");printf("\nPlease wait...\n");if (|(propertype(program, image, VFF-- TYP-- 1-- BYTE,FALSE))) { (void) fprintf (stderr, "\n\n%s:  ", program); (void) fprintf (stderr, "Image must be of type 1-BYTE\n"); sleep(3); return (0);}if (|(proper-- num-- images (program, image, 1, FALSE))) { (void) fprintf (stderr, "\n\n%s:  ", program); (void) fprintf (stderr, "Can only work on files with oneimage\n\n"); sleep(3); return (0);}if (|(h-- alpha>l-- alpha)) { (void) fprintf (stderr, "\n\n%s:  ", program); (void) fprintf (stderr, "Select h-- alpha>l-- alpha.\n\n"); sleep(3); return (0);}/* IDENTIFICATION OF AN INPUT IMAGE SET *//********************************//* SEE PROCESS BLOCKS 64 AND 80 *//********************************/img-- cols  = image → row-- size;img-- rows  = image → col-- size;img-- slices  = image → num-- data-- bands;img-- slsize  = img-- cols*img-- rows;img-- volsize = img-- slsize*img-- slices;img-- val = (unsigned char *)(image→imagedata);ang-- incr-- vol = pi/(float)img-- slices;ang-- incr-- slc = (2*pi)/(float)nnod;if (|(img-- slices>=2)) { (void) fprintf (stderr, "\n\n%s:  ", program); (void) fprintf (stderr, "Volume must contain at least 2slices.\n\n"); return (0); } /* IMAGE SPACE ALLOCATION */   /* ALLOCATE "ENDIMAGE" FOR COMBINED PLACEMENT OFTRACINGS AND NODES */  endimage = creatimage(   (unsigned long) img-- rows,   (unsigned long) img-- cols,   (unsigned long) VFF-- TYP-- 1-- BYTE,   (unsigned long) 1,   (unsigned long) img-- slices,   "This image contains manual tracings and Kohonen nodes.",   (unsigned long) 0,   (unsigned long) 0,   (unsigned long) VFF-- MS-- NONE,   (unsigned long) VFF-- MAPTYP-- NONE,   (unsigned long) VFF-- LOC-- IMPLICIT,   (unsigned long) 0);  (if (endimage == NULL)  {   fprintf(stderr,   "\nCBI: Memory for the endimage was not allocated.\n");   sleep(3);   return(0);  }  end-- val = (unsigned char *)(endimage→imagedata);   /* ALLOCATE "NODIMAGE" FOR PLACEMENT OF NODES WITHRELATED ROIS */ \nodimage = createimage(   (unsigned long) image-- rows,   (unsigned long) img-- cols,   (unsigned long) VFF-- TYP-- 1-- BYTE,   (unsigned long) 1,   (unsigned long) img-- slices,   "This images contains nodes with related ROIs.",   (unsigned long) 0,   (unsigned long) 0,   (unsigned long) VFF-- MS-- NONE,   (unsigned long) VFF-- MAPTYP-- NONE,   (unsigned long) VFF-- LOC-- IMPLICIT,   (unsigned long) 0);  if (nodimage == NULL)  {   fprintf(stderr,   "\nCBI: Memory for the nodimage was not allocated.\n");   sleep(3);   return(0);  } \nod-- val = (unsigned char *)(nodimage→imagedata);  /* ALLOCATE "REGIMAGE" FOR SHOWING THE INITIAL OUTLINE */  regimage = createimage(   (unsigned long) img-- rows,   (unsigned long) img-- cols,   (unsigned long) VFF-- TYP-- 1-- BYTE,   (unsigned long) 1,   (unsigned long) img-- slices,   "This image shows the prohibited region.",   (unsigned long) 0,   (unsigned long) 0,   (unsigned long) VFF-- MS-- NONE,   (unsigned long) VFF-- MAPTYP-- NONE,   (unsigned long) VFF-- LOC-- IMPLICIT,   (unsigned long) 0);  if (regimage == NULL)  {   fprintf(stderr,   "\nCBI: Memory for the regimage was not allocated.\n");   sleep(3);   return(0);  }  reg-- val = (unsigned char *)(regimage→imagedata); /* ALLOCATE ARRAYS */ n = 5; /* 3 INIT. NODES + 2 DUPLICATES OF THE 1ST AND THE LAST ONE*/ roi-- iter  = vector(1); ord-- coord  = vector(n); tmpc-- coord  = vector(n); tmpr-- coord  = vector(n); tmpc-- coord2  = vector(n); tmpr-- coord2  = vector(n); ord1-- coord  = vector(n+2); regc1-- coord  = vector(n+2); regr1-- coord  = vector(n+2); regc1-- coord2 = vector(n+2); regr1-- coord2 = vector(n+2); ord2-- coord  = vector(nnod+2); regc2-- coord  = vector(nnod+2); regr2-- coord  = vector(nnod+2); regc2-- coord2 = vector(nnod+2); regr2-- coord2 = vector(nnod+2);  gr-- cntr      = matrix(img-- slices,2); /* GRAV. CENTER OF AP AND MVPOINTS */ nod-- roi    = matrix(img-- slices,nnod); /* ROI RADIUS FOR EACH NODE    */  roi-- x-- new          = matrix(img-- slices,MAXNONODES); /* NEW ROI XCOORDINATES */  roi-- y-- new          = matrix(img-- slices,MAXNONODES); /* NEW ROI YCOORDINATES */ roi-- x-- avg        = matrix(img-- slices,MAXNONODES); /* AVERAGE ROI XCOORD. */ roi-- y-- avg        = matrix(img-- slices,MAXNONODES); /* AVERAGE ROI YCOORD. */ hilomn-- arr    = cube(img-- slices,img-- rows,img-- cols); /*    HILOMEAN VALUES*/ nod-- coord-- init= cube(img-- slices,nnod,2); /* INITIALNODE COORDINATES*/  nod-- coord-- all = cube(img-- slices,MAXNONODES,3); /*ALL NODECOORD,ANG TO GC */ nod-- coord      = cube(img-- slices,nnod,5); /* X, Y, SDX, SDY, ROI AREA      */ /* OPEN FILES WITH NUM OF DIASTOLIC AND SYSTOLIC LEARNINGITERATIONS */ if((khome=getenv("KHOROS-- HOME"))==NULL)  khome="/usr/khoros"; sprintf(dir,"%s/marek-- toolbox/data",khome); if(phase==DIASTOLE) sprintf(filename,"%s/ROI-- ITER-- D",dir); if(phase==SYSTOLE) sprintf(filename,"%s/ROI-- ITER-- s",dir); file=fopen(filename,"r"); if(file |= NULL)  { \numread=fread((char*)roi-- iter,sizeof(float),1,file); \niter = roi-- iter 0!;  printf("\n%d iterations of ROI learning preceded.",  \niter);  } else if(roi==LEARN)  {  printf("\nNO iteration of ROI learning preceded.");  roi-- iter 0!=0.0;  } else  {  fprintf(stderr, "\nCould not open the file ROI-- ITER..for reading.\n");  sleep(3);  return(0);  } fclose(file); niter = roi-- iter 0!; /* ALLOCATE ARRAYS FOR EXISTING (N) AND FUTURE (N+1) VECTORCOORDINATES */ roi-- x-- open  = cube(niter,MAXNOSLICES,MAXNONODES); /*LOADED ROIX COORD. */ roi-- y-- open  = cube(niter,MAXNOSLICES,MAXNONODES); /*LOADED ROIY COORD. */ roi-- x-- all  = cube(niter+1,MAXNOSLICES,MAXNONODES); /* ALLROI XCOORD. */ roi-- y-- all  = cube(niter+1,MAXNOSLICES,MAXNONODES); /* ALLROI YCOORD. */  /* OPEN FILES WITH PREVIOUSLY "LEARNED" DIASTOLIC ANDSYSTOLIC VECTORS */ /***************************/ /* SEE LOOP 74 and link 76 */ /***************************/ if(phase==DIASTOLE) sprintf(filename,"%s/ROI-- X-- D",dir); if(phase==SYSTOLE) sprintf(filename,"%s/ROI-- X-- S",dir); file=fopen(filename,"r"); if(file |= NULL)  {  for(j=0; j<niter; j++)  {  for(k=0; k<MAXNOSLICES; k++)  \numread=fread((char*)roi-- x-- open j! k!,sizeof(float),MAXNONODES,file);  }  printf("\n%4d items read from the file ROI-- X...",   j*numread*MAXNOSLICES);  } else if(roi==LEARN)  {  printf("\nNO previous ROI-- X.. file available.");  } else  {  fprintf(stderr,"\nCould not open the file ROI-- X.. forreading.\n");  sleep(3);  return(0);  } fclose(file); if(phase==DIASTOLE) sprintf(filename,"%s/ROI-- Y-- D",dir); if(phase==SYSTOLE) sprintf(filename,"%s/ROI-- Y-- S",dir); file=fopen(filename,"r"); if(file |= NULL)  {  for(j=0; j<niter; j++)  {   for(k=0; k<MAXNOSLICES; k++)  \numread=fread((char*)roi-- y-- open j! k!,sizeof(float),MAXNONODES,file);  }  printf("\n%4d items read from the file ROI-- Y....backslash.n",   j*numread*MAXNOSLICES);  } else if(roi==LEARN)  {  printf("\nNO previous ROI-- Y.. file available..backslash.n");  } else  {  fprintf(stderr,"\nCould not open the file ROI-- Y.. forreading.\n");  sleep(3);  return(0);  } fclose(file); /* SET INITIAL VALUES OF VARIABLES, IMAGES AND ARRAYS */ fimg-- slices = img-- slices; fnnod   = nnod; fmaxnoslices = MAXNOSLICES; fmaxnonodes = MAXNONODES; roi-- count-- max = 0; /* LARGEST ROI IN ALL SLICES */ for(i=0; i<image-- volsize; i++) {  *(end-- val+i) = *(image-- val+i);  *(nod-- val+i) = *(img-- val+i);  *(reg-- val+i) = 0; } for(s=0; s<img-- slices; s++) {  for(r=0; r<img-- rows; r++)  {  for(c=0; c<img-- cols; c++)  {   hilomn-- arr s! r! c!=0.0;  }  } } for(i=0; i<niter; i++) {  for(j=0; j<MAXNOSLICES; j++)  {  for(k=0; k<MAXNONODES; k++)  {   roi-- x-- all i! j! k!=roi-- x-- open i! j! k!;   roi-- y-- all i! j! k!=roi-- y-- open i! j! k!;  }  } } /* SLICE-BY-SLICE PROCESSING */ for(s=0; s<img-- slices; s++) { /* IDENTIFY APICAL (AP) AND MITRAL VALVE (MV) NODES */ /* AND PLACE THEM TO "NOD-- COORD" ARRAY. */  /* THIS IS COMMON FOR BOTH LEARNING AND PERFORMINGPROCESSES */ /* IMAGE MUST BE ORIENTED WITH THE MV AT THE BOTTOM AND THEAP AT THE TOP */ go0 = 1; go1 = 2; go2 = 3; count=0; for(r=0; r<img-- rows; r++) {  for(c=0; c<img-- cols; c++)  {  temp = c + r*img-- cols + s*img-- slsize;  value = *(img-- val+temp);  if(value==pointclr)  {   count++;  }  /* GIVE AN ERROR MESSAGE IF MORE THAN 3 LABELS IDENTIFIED */  if(count>3)  {   fprintf(stderr,   "\nSlice %d: More than 3 expected labels (1×AP,2×MV) found.\n", s);   sleep(3);   return(0);  }  /* DETECT APICAL (AP) NODE LOCATION AND ...*/  if(value==pointclr && go0>0)  {   tmpc-- coord 2! = nod-- coord s! nnod/2! 0! = c;   tmpr-- coord 2! = nod-- coord s! nnod/2! 1! = r;   go0--;   /* ...REPLACE THE AP POINT BY AN AVERAGE VALUE FROM ITS 4NEIGHBORS */   /* I.E. MAKE IT "DISAPPEAR" AFTER FIGURING OUT ITSCOORDINATES */  sum = *(img-- val+temp+1)   + *(img-- val+temp-1) +  *(img-- val+temp+img-- cols) + *(img-- val+temp);  aver = (float)sum / 4.0;  *(img-- val+temp) = rint(aver);  } /* DETECT LOCATION ONE OF ONE OF THE MITRAL NODES (MV1)AND... */ if(value==pointclr && go1>0)  {  tmpc-- coord 1! = tmpc-- coord 4! = nod-- coord s! 0! 0!= c;  tmpr-- coord 1! = tmpr-- coord 4! = nod-- coord s! 0! 1!= r;  go1--;  /* ...MAKE IT DISAPPEAR */  sum = *(img-- val+temp+1)   + *(img-- val+temp-1) +  *(img-- val+temp+img-- cols) + *(img-- val+temp);  aver = (float)sum / 4.0;  *(img-- val+temp) = rint(aver);  } /* DETECT LOCATION OF THE OTHER MITRAL NODE (MV2) AND... */ if(value==pointclr && go2>0)  {  tmpc-- coord 0! = tmpc-- coord 3! = nod-- coord s! nnod-1! 0! = c;  tmpr-- coord 0! = tmpr-- coord 3! = nod-- coord s! nnod-1! 1! = r;  go2--;  /* ...MAKE IT DISAPPEAR */  sum = *(img-- val+temp+1)   + *(img-- val+temp-1) +  *(img-- val+temp+img-- cols) + *(img-- val+temp);  aver = (float)sum / 4.0;  *(img-- val+temp) = rint(aver);  } }} /* GIVE AN ERROR MESSAGE IF LESS THAN 3 LABELS IDENTIFIED */  if(count<3)  {  fprintf(stderr,  "\n%Slice %d: Less than 3 labels (AP, MV1, MV2)found.\n", s);  sleep(3);  return(0);  } /* GIVE TO THE LEFT (I.E. LOWER X COORD.) MV POINT LOWER ORDERVALUE */ if(nod-- coord s! 0! 0!>nod-- coord s! nnod-1! 0!)  {  tmpc-- coord 1! = tmpc-- coord 4! = nod-- coord s! nnod-1! 0!;  tmpr-- coord 1! = tmpr-- coord 4! = nod-- coord s! nnod-1! 1!;  cc = tmpc-- coord 0! = tmpc-- coord 3! = nod-- coord s! 0! 0!;  rr = tmpr-- coord 0! = tmpr-- coord 3! = nod-- coord s! 0! 1!;  nod-- coord s! 0! 0! = nod-- coord s! nnod-1! 0!;  nod-- coord s! 0! 1! = nod-- coord s! nnod-1! 1!;  nod-- coord s! nnod-1! 0! = cc;  nod-- coord s! nnod-1! 1! = rr;  } /* FIND GRAV. CENTER OF THE AV, MV1, MV2 POINTS, SET THE LVLONG AXIS */ gr-- cntr s! 0!=rint((tmpc-- coord 1!+tmpc-- coord 2!+tmpc-- coord 3!)/3.0); gr-- cntr s! 1!=rint(((2.0*tmpr-- coord 2!+(tmpr--coord 1!+   tmpr-- coord 3!)/2.0)/3.0)); /* LEARNING PROCESS PART 1 */ /***************************/ /* SEE LEARNING PROCESS 60 */ /***************************/ if(roi==LEARN)  {  printf("\nLearning from slice %d (slices 0 - %d).", s,img-- slices-1); /* FIT SPLINES TO MV AND AP POINTS (INITIAL MODEL) */ /************************/ /* SEE PROCESS BLOCK 66 */ /************************/ for(i=0; i<n; i++) ord-- coord i! = i; spline(ord-- coord,tmpc-- coord,n,yp1,ypn,tmpc-- coord2); spline(ord-- coord,tmpr-- coord,n,yp1,ypn,tmpr-- coord2); /* DETECT AN EXPERT OUTLINE */ count=0; for(i=0; i<img-- slsize; i++) {  value = *(img-- val+i);  if(value==delinclr)  count++; } if(count==0)  {  fprintf(stderr,"\nSlice %d: No delineation detected..backslash.n", s);  sleep(3);  return(0);  }  /* PROPORTIONALLY DISTRIBUTE THE STANDARD NUMBER OFNODES */ /* TO INITIAL POSITIONS */ /************************/ /* SEE PROCESS BLOCK 68 */ /************************/ sumx=sumy=0.0; sumx2=sumy2=0.0; fract = 2.0/(float)(MAXNONODES-1); for(j=0; j<MAXNONODES; j++) {  tmp-- nod  = 1.0 + (float)j*fract;  splint(ord-- coord,tmpc-- coord,tmpc-- coord2,n,tmp-- nod,&cc);  splint(ord-- coord,tmpr-- coord,tmpr-- coord2,n,tmp-- nod,&rr); \nod-- coord-- all s! j! 0! = cc; \nod-- coord-- all s! j! 1! = rr; /* DEFINE POSITIONAL VECTORS, I.E. FIND NEAREST POINT */ /* ON THE EXPERT OUTLINE FOR EACH NODE */ /************************/ /* SEE PROCESS BLOCK 70 */ /************************/ dist = (img-- cols>img-- rows ? img-- cols:img--rows); for(r=0; r<img-- rows; r++)  {  for(c=0; c<img-- cols; c++)  {  value = *(img-- val+c+r*img-- cols+s*img-- slsize);  if(value==delinclr)   {   x = c-cc;   y = r-rr;   tmp-- dist = sqrt(pow(x,2.0)+pow(y,2.0));   if(tmp-- dist<dist)   {   dist=tmp-- dist;   roi-- x-- new s! j!=x;   roi-- y-- new s! j!=y;   }   }  }  } sumx = sumx+roi-- x-- new s! j!; sumy = sumy+roi-- y-- new s! j!; sumx2 = sumx2+pow(roi-- x-- new s! j!;2.0); sumy2 = sumy2+pow(roi-- y-- new s! j!;2.0); } averx = sumx/MAXNONODES; avery = sumy/MAXNONODES; averx2= sumx2/MAXNONODES; avery2= sumy2/MAXNONODES; stdevx= sqrt(fabs(averx2-pow(averx,2.0))); stdevy= sqrt(fabs(avery2-pow(avery,2.0))); averx=fabs(averx); avery=fabs(avery); for(j=1; j<MAXNONODES-1; j++) {  x=fabs(roi-- x-- new s! j!);  y=fabs(roi-- y-- new s! j!);  if(x>averx+2.0*stdevx)  roi-- x-- avg s! j!=(roi-- x-- news s! j-1!+averx+roi-- x-- new s! j+1!/3.0;  else roi-- x-- avg s! j!=roi-- x-- new s! j!;  if(y>avery+2.0*stdevy)  roi-- y-- avg s! j!=(roi-- y-- new s! j-1!+avery+roi-- y-- new s! j+1!)/3.0;  else roi-- y-- avg s! j!=roi-- y-- new s! j!;  }  for(j=1; j<MAXNONODES-1; j++)  {  roi-- x-- news s! j!=roi-- x-- avg s! j!;  roi-- y-- news s! j!=roi-- y-- avg s! j!;  } }/* END OF LEARNING PROCESS PART 1 *//* PERFORMING PROCESS PART 1 *//*****************************//* SEE PERFORMING PROCESS 62 *//*****************************/if(roi==PERFORM) { printf("\nInitial node position setting in slice %d (slices 0- %d).", s, img-- slices-1); /* FIT SPLINES TO MV AND AP POINTS (INITIAL MODEL) */ /************************/ /* SEE PROCESS BLOCK 82 */ /************************/ for(i=0; i<n; i++)  {  ord-- coord i! = i;  regc1-- coord i+1! = tmpc-- coord i!;  regr1-- coord i+1! = tmpr-- coord i!;  } for(i=0; i<n+2; i++) ord1-- coord i! = i; spline(ord-- coord,tmpc-- coord,n,yp1,ypn,tmpc-- coord2); spline(ord-- coord,tmpr-- coord,n,yp1,ypn,tmpr-- coord2); /* THE FOLLOWING CODE DELINEATES A REGION AMONG THE TWO*/ /* MV POINTS AND A POINT AT PROXIMAL 2/3 OF THE LV LONG AXISBY */ /* FITTING SPLINES. THIS APPROXIMATES AN AREA OF MV MOTION.*/ regc1-- coord 6! = regc1-- coord 3! = regc1-- coord 0! =gr-- cntr s! 0!; regr1-- coord 6! = regr1-- coord 3! = regr1-- coord 0! =gr-- cntr s! 0!; spline(ord1-- coord,regc1-- coord,n+2,yp1,ypn,regc1--coord2); spline(ord1-- coord,regr1-- coord,n+2,yp1,ypn,regr1--coord2); ic = regc1-- coord 1!; ir = regr1-- coord 1!; count=1; do{ /* THIS ALGORITHM ASSURES CONTINUOUS OUTLINE */  go = 0;  flag = 1;  fract = 3.0/(500.0*(float)count);  for(i=0; i<(500*count) && flag==1; i++)  {  tmp-- nod = 1.0 + (float)i*fract;  splint(ord1-- coord,regc1-- coord,regc1-- coord2,n+2,tmp.sub.-- nod,&nc);  splint(ord1-- coord,regr1-- coord,regr1-- coord2,n+2,tmp.sub.-- nod,&nr);  dist = sqrt(pow((nc-ic),2.0)+pow((nr-ir),2.0));  if(dist>1.0)   {   go = 1;   flag = 0;   ic = regc1-- coord 1!;   ir = regr1-- coord 1!;   }  else   {   c1 = ic = nc;   r1 = ir = nr;   if(c1>0 && c1<img-- cols && r1>0 && r1<img-- rows)   {   temp = c1 + r1*img-- cols + s*img-- slsize;   *(reg-- val+temp) = 250;   }   }  }  count++; } while(go==1);  /* A MASK OF A REGION PROHIBITED FOR ENDOCARDIAL EDGEDETECTION IS */ /* DEFINED BY FILLING THE ABOVE DESCRIBED AREA WITH PIXELSOF A SAME */ /* VALUE. THIS AVOIDS CONFUSION OF THE BOUNDARY DETECTION*/ /* ALGORITHM BY MV EDGES. */ for (r=0; r<img-- rows; r++) { flg-- beg = 0; flg-- end = 0; for(c=0; c<img-- cols; c++) { temp = c + r*img-- cols + s*img-- slsize; value = *(reg-- val+temp); if(value==250 && flg-- beg==1)  {  c2=c;  flg-- end=1;  } if(value==250 && flg-- beg==0)  {  c1=c;  flg-- beg=1;  } } if(flg-- beg==1 && flg-- end==1)  conpts2(reg-- val, c1, r, c2, r, img-- cols, img-- rows,s, 250); }  /* DISTRIBUTE THE NODES TO AVERAGE POSITIONS (AVERAGEMODEL) */ /************************/ /* SEE PROCESS BLOCK 84 */ /************************/ fract = 2.0/(float)(nnod-1); for(i=0; i<nnod; i++) { tmp-- nod = 1.0 + (float)i*fract; splint(ord-- coord,tmpc-- coord,tmpc-- coord2,n,tmp-- nod,&cc); splint(ord-- coord,tmpr-- coord,tmpr-- coord2,n,tmp-- nod,&rr); nod-- coord s! i! 0! = cc; nod-- coord s! i! 1! = rr; } fs = s; fslc = fs*((fmaxnoslices-1.0)/(fimg-- slices-1.0)); slcl = fslc; slch = slcl+1; if(slch==MAXNOSLICES) slch=MAXNOSLICES-1; slcl-- frc = fslc-slcl; for(i=0; i<nnod; i++) { roi-- count=0; fn = i; fnd = fn*((fmaxnonodes-1.0)/(fnnod-1.0)); nodl = fnd; nodh = nodl+1; if(nodh==MAXNONODES) nodh = MAXNONODES-1; nodl-- frc = fnd-nodl; sumx=sumy=0.0; sumx2=sumy2=0.0; for(j=0; j<niter; j++) { x1 = roi-- x-- all j! slcl! nodl!+nodl-- frc*  (roi-- x-- all j! slcl! nodh!-roi-- x-- all j! slcl! nodl!); x2 = roi-- x-- all j! slch! nodl!+nodl-- frc*  (roi-- x-- all j! slch! nodh!-roi-- x-- all j! slch! nodl!); y1 = roi-- y-- all j! slcl! nodl!+nodl-- frc*  (roi-- y-- all j! slcl! nodh!-roi-- y-- all j! slcl! nodl!); y2 = roi-- y-- all j! slch! nodl!+nodl-- frc*  (roi-- y-- all j! slch! nodh!-roi-- y-- all j! slch! nodl!); x = x1+slcl-- frc*(x2-x1); y = y1+slcl-- frc*(y2-y1); sumx = sumx+x; sumy = sumy+y; sumx2 = sumx2+pow(x,2.0); sumy2 = sumy2+pow(y,2.0); } averx = sumx/niter; avery = sumy/niter; averx2 = sumx2/niter; avery2 = sumy2/niter; stdevx = sqrt(fabs(averx2-pow(averx,2.0))); stdevy = sqrt(fabs(avery2-pow(avery,2.0))); /* DEFINE ROIS, FIND THE LARGEST ROI */ nod-- coord s! i! 0!  = c1 = nod-- coord s! i! 0!+averx; nod-- coord-- init s! i! 0! = nod-- coord s! i! 0!; nod-- coord s! i! 1!  = r1 = nod-- coord s! i! 1!+avery; nod-- coord-- init s! i! 1! = nod-- coord s! i! 1!; nod-- coord s! i! 2! = rint(2.0*stdevx); nod-- coord s! i! 3! = rint(2.0*stdevy); elips-- radx = nod-- coord s! i! 2!; elips-- rady = nod-- coord s! i! 3!; for(r=-elips-- rady; r<=elips-- rady; r++) {  for(c=-elips-- radx; c<=elips-- rads; c++)  {  dist1=dist2=0.0;  if(elips-- radx|=0) dist1=pow((float)c,2.0)/pow((float)elips-- radx,2.0);  if(elips-- rady|=0) dist2=pow((float)r,2.0)/pow((float)elips-- rady,2.0);  dist=dist1+dist2;  c2=c+c1;  r2=r+r1;  if(dist<=1.0 && c2>=0 && c2<img-- cols && r2>=0 && r2<img--rows)  roi-- count++; /* NUMBER OF PIXELS IN THE ACTUAL ROI */  } } nod-- coord s! i! 4! = roi-- count; /* ROI AREA IN PIXELS */ /* FIND THE LARGEST ROI IN ALL SLICES */ if(roi-- count>roi-- count-- max) roi-- count--max=roi-- count; } }/* END OF PERFORMING PROCESS PART 1 */}/* END OF SLICE-BY-SLICE PROCESSING *//* LEARNING PROCESS PART 2 *//***************************//* SEE LEARNING PROCESS 60 *//***************************/if(roi==LEARN) { /* UPDATE STANDARD DATABASE OF POSITIONAL VECTORS */ /************************/ /* SEE PROCESS BLOCK 72 */ /************************/ printf("\n"); for(s=0; s<MAXNOSLICES; s++) { fs = s; fslc = fs*((fimg-- slices-1.0)/(fmaxnoslices-1.0)); slcl = fslc; slch = slcl+1; slcl-- frc = fslc-slcl; if(slch==img-- slices) slch = img-- slices-1; for(i=0; i<MAXNONODES; i++) {  roi-- x-- all niter! s! i!=roi-- x-- new slcl! i!+slcl-- frc*  (roi-- x-- new slch! i!-roi-- x-- new slcl! i!);  roi-- y-- all niter! s! i!=roi-- y-- new slcl! i!+slcl-- frc*  (roi-- y-- new slch! i!-roi-- y-- new slcl! i!);  } } /* UPDATE THE NUMBER OF LEARNING ITERATIONS */ roi-- iter 0!+=1.0; niter=roi-- iter 0!; /* GENERATE OUTPUT DATA FILES OF POSITIONAL VECTORS */ if(phase==DIASTOLE) sprintf(filename,"%s/ROI-- ITER-- D",dir); if(phase==SYSTOLE) sprintf(filename,"%s/ROI-- ITER-- S",dir); file=fopen(filename,"w+"); if(file |= NULL)  { \numwritten=fwrite((char*)roi-- iter,sizeof(float),1,file);  printf("\n%1d iterations of ROI learning completed.\n", niter);  } else  {  fprintf(stderr,"\nCould not open the file ROI-- ITER..for writing.\n");  sleep(3);  return(0);  } fclose(file); if(phase==DIASTOLE) sprintf(filename,"%s/ROI-- X-- D",dir); if(phase==SYSTOLE) sprintf(filename,"%s/ROI-- X-- S",dir); file=fopen(filename,"w+"); if(file |= NULL)  { for(j=0; j<niter; j++)  {   for(k=0; k<MAXNOSLICES; k++)  \numwritten=fwrite((char*)roi-- x-- all j! k!,sizeof(float),    MAXNONODES,file);  }  printf("\n%4d items written to the file ROI-- X...",  j*numwritten*MAXNOSLICES);  } else  {  fprintf(stderr,"\nCould not open the file ROI-- Y.. forwriting.\n");  sleep(3);  return(0);  } fclose(file); if(phase==DIASTOLE) sprintf(filename,"%s/ROI-- Y-- D",dir); if(phase==SYSTOLE) sprintf(filename,"%s/ROI-- Y-- S",dir); file=fopen(filename,"w+"); if(file |= NULL){  for(j=0; j<niter; j++)  {    for(k=0; k<MAXNOSLICES; k++)    numwritten=fwrite((char*)roi-- y-- all j! k!,sizeof(float),        MAXNONODES,file);  }  printf("\n%4d items written to the file ROI-- Y . ..",j*numwritten*MAXNOSLICES);}   else{  fprintf(srderr,"\nCould not open the file ROI-- Y .. for writing.\n");  sleep(3);  return(0);}   fclose(file);  /* CREATE DATA FOR DISPLAY OF ROIS OF ALL 49 NODES PERSLICE */ for(s=0; s<img-- slices; s++) {  fs = s;  fslc = fs*((fmaxnoslices-1.0)/(fimg-- slices-1.0));  slcl = fslc;  slch = slcl+1;  if(slch==MAXNOSLICES) slch=MAXNOSLICES-1;  slcl-- frc = fslc-slcl;  for(i=0; i<MAXNONODES; i++)  {  /* CALCULATE AVERAGE POSITION AND ROI OF EACH NODE (FORDISPLAY) */  sumx=sumy=0.0;  sumx2=sumy2=0.0;  for(j=0; j<niter; j++)  {  x = roi-- x-- all j! slcl! i!+slcl-- frc*  (roi-- x-- all j! slch! i!-roi-- x-- all j! slcl! i!);  y = roi-- y-- all j! slcl! i!+slcl-- frc*  (roi-- y-- all j! slch! i!-roi-- y-- all j! slcl! i!);  sumx = sumx+x;  sumy = sumy+y;  sumx2 = sumx2+pow(x,2.0);  sumy2 = sumy2+pow(y,2.0);  }  averx = sumx/niter;  avery = sumy/niter;  averx2= sumx2/niter;  avery2= sumy2/niter;  stdevx= sqrt(fabs(averx2-pow(averx,2.0)));  stdevy= sqrt(fabs(avery2-pow(avery,2.0)));  /* CREATE IMAGE FILE WITH NODES AND THEIR ROIS */  c1=averx+nod-- coord-- all s! i! 0!;  r1=avery+nod-- coord-- all s! i! 1!;  elips-- radx=rint(2.0*stdevx);  elips-- rady=rint(2.0*stdevy);  for(r=-elips-- rady; r<=elips-- rady; r++)  {  for(c=-elips-- radx; c<=elips-- radx; c++)  {  dist1=dist2=0.0;  if(elips-- radx>0) dist1=pow((float)c,2.0)/pow((float)elips--radx,2.0);  if(elips-- rady>0) dist2=pow((float)r,2.0)/pow((float)elips--rady,2.0);  dist=dist1+dist2;  c2=c+c1;  r2=r+r1;  if(dist<=1.0 && c2>=0 && c2<img-- cols && r2>=0 && r2<img--rows)   {   value = *(nod-- val+c2+r2*img-- cols+s*img-- slsize);   *(nod-- val+c2+r2*img-- cols+s*img-- slsize) = 255;   }  }  }  place-- node(nod-- val,c1,r1,s,img-- cols,img--rows,img-- slices);  } } *end-- image = nodimage; }/* END OF LEARNING PROCESS PART 2 *//* PERFORMANING PROCESS PART 2 *//*****************************//* SEE PERFORMING PROCESS 62 *//*****************************/if(roi==PERFORM) { printf("\n\nMemory allocation for ROIs and featureprocessing."); printf("\nPlease wait..."); /* ALLOCATE SPACE FOR ALL ROIS */ roi-- loc-- vol = hypercube(img-- slices,nnod,roi--count-- max,3); for(s=0; s<img-- slices; s++) {  for(i=0; i<nnod; i++)  {  for(l=0; l<roi-- count-- max; l++)  {  roi-- loc-- vol s! i! l! 0!=-1.0;  roi-- loc-- vol s! i! l! 1!=-1.0;  roi-- loc-- vol s! i! l! 2!=  0.0;  }  } } /* DEFINE INDIVIDUAL ROIS, NORMALIZE THEIR SIZE */ for(s=0; s<img-- slices; s++) {  for(i=0; i<nnod; i++)  {  /* DEFINE PIXELS ENCOMPASSED IN INDIVIDUAL ROIS */  c1=nod-- coord s! i! 0!;  r1=nod-- coord s! i! 1!;  elips-- radx=nod-- coord s! i! 2!;  elips-- rady=nod-- coord s! i! 3!;  count=0;  for(r=-elips-- rady; r<=elips-- rady; r++)  {  for(c=-elips-- radx; c<=elips-- radx; c++)  {  dist1=dist2=0.0;  if(elips-- radx|=0) dist1=pow((float)c,2.0)/pow((float)elips-- radx,2.0);  if(elips-- rady|=0) dist2=pow((float)r,2.0)/pow((float)elips-- rady,2.0);  dist=dist1+dist2;  c2=c+c1;  r2=r+r1;  if(dist<=1.0 && c2>=0 && c2<img-- cols && r2>=0 && r2<img--rows)  {   roi-- loc-- vol s! i! count! 0!=c2; /* COLUMN COORDINATE */   roi-- loc-- vol s! i! count! 1!=r2; /* ROW COORDINATE */   roi-- loc-- vol s! i! count! 2!=1.0; /* FLAG (START OF BLANKARRAY) */   count++;   }  }  } } /* CWTR DETECTION PROCESS CONTAINING THE HILOMEAN FILTER*/ /************************/ /* SEE PROCESS BLOCK 72 */ /************************/  hilomn-- max = 0.0;  for(i=0; i<nnod; i++)  {  for(j=0; j<roi-- count-- max; j++)   {   if(roi-- loc-- vol s! i! j! 2!==1.0)   {   c=roi-- loc-- vol s! i! j! 0!;   r=roi-- loc-- vol s! i! j! 1!;   if(|(c-ws/2<0∥c+ws/2>img-- cols-1∥r-ws/2<0.parallel.r+ws/2>img-- rows-1))    {    hilomean(img-- val, c, r, s, img-- cols, img-- rows,ws, &hilomn);    hilomn-- arr s! r! c!=hilomn;    if(hilomn>hilomn-- max) hilomn-- max=hilomn;    }   }   }  }  }  /* ALLOCATES SPACE FOR THE FEATURE IMAGE CONTAINING CWTRVALUES */ ftrimage = createimage(   (unsigned long) img-- rows,   (unsigned long) img-- cols,   (unsigned long) VFF-- TYP-- 1-- BYTE,   (unsigned long) 1,   (unsigned long) img-- slices,   "This is a feature image.",   (unsigned long) 0,   (unsigned long) 0,   (unsigned long) VFF-- MS-- NONE,   (unsigned long) VFF-- MAPTYP-- NONE,   (unsigned long) VFF-- LOC-- IMPLICIT,   (unsigned long) 0); if (ftrimage == NULL)  {  fprintf(stderr,  "\nCBI: Memory for the ftrimage was not allocated.\n");  sleep(3);  return(0);  } ftr-- val = (unsigned char *)(ftrimage→imagedata); /* PROCESS IMAGE WITH THE HILOMEAN FILTER */ /************************/ /* SEE PROCESS BLOCK 44 */ /************************/ for(s=0; s<img-- slices; s++) {  for(i=0; i<nnod; i++)  {  flag = 1;  for(j=0; j<roi-- count-- max; j++)  {  if(roi-- loc-- vol s! i! j! 2!==1.0)   {   c=roi-- loc-- vol s! i! j! 0!;   r=roi-- loc-- vol s! i! j! 1!;   /* MAKE THE HILOMEAN VALUES INCREASE GEOMETRICALLYFOR MORE */    /* INTENSE ATRACTION OF NODES TO SPOTS WITH HIGHPROBABILITY */   /* OF A BOUNDARY AND NORMALIZE THE VALUES TO  0, 1!. */   /************************/   /* SEE PROCESS BLOCK 46 */   /************************/   hilomn-- arr s! r! c!=   pow(hilomn-- arr s! r! c!,2.0)/pow(hilomn-- max,2.0);   }   if(roi-- loc-- vol s! i! j! 2!==0.0)   {   if(flag==1)    {    count=j; /* BEGINING OF A BLANK ARRAY SECTION */    flag=0;    }   roi-- loc-- vol s! i! j! 0!=roi-- loc-- vol s! i! j-count! 0!;   roi-- loc-- vol s! i! j! 1!=roi-- loc-- vol s! i! j-count! 1!;   roi-- loc-- vol s! i! j! 2!=1.0; /* FILL A BLANK IN THEARRAY */   }  }  } } /* MULTIPLY NORMALIZED HILOMEAN VALUES BY 255 */ /************************/ /* SEE PROCESS BLOCK 50 */ /************************/ for(s=0; s<img-- slices; s++)  {  for(r=0; r<img-- rows; r++)  {  for(c=0; c<img-- cols; c++)   {   temp = c + r*img-- cols + s*img-- slsize;   value= hilomn-- arr s! r! c!*255.0;   *(ftr-- val+temp) = value;   }  }  }  /* DEFINE HIT IMAGE WHICH WILL SHOW RANDOMLY SELECTEDPIXELS IN ROIS */ hitimage = createimage(   (unsigned long) img-- rows,   (unsigned long) img-- cols,   (unsigned long) VFF-- TYP-- 1-- BYTE,   (unsigned long) 1,   (unsigned long) img-- slices,   "This is a hit image - shows randomly selected pixels.",   (unsigned long) 0,   (unsigned long) 0,   (unsigned long) VFF-- MS-- NONE,   (unsigned long) VFF-- MAPTYP-- NONE,   (unsigned long) VFF-- LOC-- IMPLICIT,   (unsigned long) 0); if (hitimage == NULL)  {  fprintf(stderr,  "\nCBI: Memory for the hitimage was not allocated.\n");  sleep(3);  return(0);  } hit-- val = (unsigned char *)(hitimage→imagedata); for(i=0; i<img-- volsize; i++) *(hit-- val+i)=*(reg--val+i);   /* ADJUST NODE POSITIONS USING THE KOHONENSELF-ORGANIZING MAP (SOM) */ /************************/ /* SEE PROCESS BLOCK 86 */ /************************/ neigh-- rad-- vol = neighd; /* CONSIDERED NEIGHBORS ACROSSSLICES*/ neigh-- rad-- slc = neigh2d; /* CONSIDERED NEIGHBORS WITHINSLICES*/ fcycles=cycles=num-- tr-- cycles=repetitions*nnod*img--slices; /* # CYCLES*/ printf("\n\n%d training cycles follow.",cycles); printf("\nPlease wait..."); cycle-- count=0; /* SOM TRAINING CYCLES */ while(num-- tr-- cycles>0) }  /* REDUCTION FACTOR - APPROACHES ZERO DURING TRAININGCYCLES */  if(cycles==1) reduc-- factor = 1.0;  else reduc-- factor = ((float)num-- tr-- cycles-1)/(fcycles-1.0);  /* DEFINITION OF THE TRAINING PARAMETER ALPHA AND THENEIGHBORHOOD */  tmp-- alpha   = l-- alpha + (h-- alpha-l-- alpha)*reduc-- factor;  tmp-- neigh-- rad-- vol= rint((float)neigh--rad-- vol);  tmp-- neigh-- rad-- slc= rint((float)neigh--rad-- slc);  /* RANDOM PIXEL SELECTION FROM WITHIN A ROI */  ss = rint((double)(rand( )/RMAX)*(float)(img-- slices-1)); \nd = rint((double)(rand( )/RMAX)*(float)(nnod-1));  rg = rint((double)(rand( )/RMAX)*(float)(roi-- count--max-1));  c1 = ic = roi-- loc-- vol ss! nd! rg! 0!;  r1 = ir = roi-- loc-- vol ss! nd! rg! 1!;  temp = c1 + r1*img-- cols + ss*img-- slsize;  value = *(reg-- val+temp);  /* AVOID THE PROHIBITED MV REGION USING THE MASK */  while(|(value==0))  {  ss = rint((double)(rand( )/RMAX)*(float)(img-- slices-1));  nd = rint((double)(rand( )/RMAX)*(float)((nnod-1));  rg = rint((double)(rand( )/RMAX)*(float)(roi-- count--max-1));  c1 = ic = roi-- loc-- vol ss! nd! rg! 0!;  r1 = ir = roi-- loc-- vol ss! nd! rg! 1!;  temp = c1 + r1*img-- cols + ss*img-- slsize;  value = *(reg-- val+temp);  }  /* MARK HITS IN THE HIT IMAGE */  *(hit-- val + c1 + r1*img-- cols + ss*img-- slsize) =200;  /* WEIGHT INDIV. PIXELS - THIS WILL DEFINE NODE ATTRACTION*/  hilomn = hilomn-- arr ss! r1! c1!; /* HILOMEAN VALUES NORM. TO  0,1!*/  iterate = hilomn*10.0; /* PRESENT HIGHLY WEIGHTED PIXELS MORE OFTEN */ while(iterate>0)  {   /* TRAIN THE SOM ACROSS SLICES WHILE ADJUSTING NODEPOSITIONS */  for(k=-tmp-- neigh-- rad-- vol; k<=tmp-- neigh-- rad-- vol; k++)  {  flag = 0;  s  = ss+k;  if(s<0)  {  flag = 1;  s  = img-- slices+s;  ic  = img-- cols-1-ic;  }  if(s>img-- slices-1)  {  flag = 1;    s  = s-img-- slices;  ic  = img-- cols-1-ic;  }  /* FIND THE WINNING NODE (WINNER) IN THE ACTUAL SLICE */  /* AS A NEAREST NODE */  short-- dist = LARGE;  for(i=0; i<nnod; i++)  { \nc = nod-- coord s! i! 0!; \nr = nod-- coord s! i! 1!;  dist = sqrt(pow(ic-nc,2.0)+pow(ir-nr,2.0));  if(dist<short-- dist)  {  short-- dist = dist;  ii = i;  }  }  /* TRAIN THE SOM WITHIN THE SLICE WHILE ADJUSTING NODEPOSITIONS */  for(j=-tmp-- neigh-- rad-- slc; j<=tmp-- neigh-- rad-- slc; j++)  {  i = ii+j; /* NODE INDEXING */  if(i<0)  i = 0;  if(i>nnod-1) i = nnod-1; /* SET COORDINATES OF THE WINNER (ii) OR ITS NEIGHBORS (ii+j)*/ \nc = nod-- coord s! i! 0!; \nr = nod-- coord s! i! 1!;  /* VECTOR COMPONENT FACTOR - REDUCES ATRACTION TOREMOTE PIXELS */  ang-- vol = ang-- incr-- vol*abs(k); /* ELEVATIONCOMPONENT */  if(ang-- vol>pi/2.0) ang-- vol=pi/2.0;  ang-- slc = ang-- incr-- slc*abs(j); /* AZIMUTALCOMPONENT */  if(ang-- slc>pi/2.0) ang-- slc=pi/2.0;  vect-- comp-- factor = cos(ang-- vol)*cos(ang--slc);  mvc = (ic-nc)*vect-- comp-- factor;  mvr = (ir-nr)*vect-- comp-- factor;  /* AVAILABLE SOM ALGORITHMS */  if(algorithm==CLASSIC)  {  ftmp-- c = nc+tmp-- alpha*mvc;  ftmp-- r = nr+tmp-- alpha*mvr;  }  if(algorithm==MODIFIED)  {  /* DEFINE X AND Y AXES OF THE ACTUAL ROI */  elips-- radx=nod-- coord s! i! 2!;  elips-- rady=nod-- coord s! i! 3!;  /* FIND RATIO OF X AND Y AXES OF THE ACTUAL AND WINNINGROI */  elips-- ratx=nod-- coord s! i! 2!/nod-- coord s! ii! 2!;  elips-- raty=nod-- coord s! i! 3!/nod-- coord s! ii! 3!;  if(elips-- ratx<1.0) /* SQEEZE X VECTOR COMPONENT */   mvc = mvc*elips-- ratx;  if(elips-- raty<1.0) /* SQEEZE Y VECTOR COMPONENT */   mvr = mvr*elips-- raty;  ftmp-- c = nc+tmp-- alpha*mvc;  ftmp-- r = nr+tmp-- alpha*mvr;  nc-- i = nod-- coord-- init s! i! 0!;  nr-- i = nod-- coord-- init s! i! 1!;  /* LET NODES MOVE ONLY WITHIN THEIR ASSOCIATED ROIS */   if(elips-- radx|=0)   dist1=pow(nc-- i-ftmp-- c,2.0)/pow((float)elips--radx,2.0);   else   dist1=pow(nc-- i-ftmp-- c,2.0);   if(elips-- rady|=0)   dist2=pow(nr-- i-ftmp-- r,2.0)/pow((float)elips--rady,2.0);   else   dist2=pow(nr-- i-ftmp-- r,2.0);   dist=dist1+dist2;  /* IF ATTRACTION FROM OUTSIDE OF THE ROI, DO NOT MOVEAT ALL */  if(dist>1.0)   {   ftmp-- c = nc;   ftmp-- r = nr;   }  }  if(ftmp-- c<0.0) ftmp-- c=0.0;  if(ftmp-- r<0.0) ftmp-- r=0.0;  if(ftmp-- c>(float)(img-- cols-1)) ftmp-- c = img--cols-1;  if(ftmp-- r>(float)(img-- rows-1)) ftmp-- r = img--rows-1; \nod-- coord s! i! 0! = ftmp-- c; \nod-- coord s! i! 1! = ftmp-- r;  }  }  iterate--; } cycle-- count++; num-- tr-- cycles--; }/* END OF TRAINING CYCLES */ /* GENERATE IMAGE WITH RANDOM HITS - INTENDED FOR TESTINGPURPOSES */ /* writeimage("hitimage", hitimage); */ /* GENERATE A WIRE FRAME DATA SET WITH NODE COORDINATES*/ /************************/ /* SEE PROCESS BLOCK 88 */ /************************/ if(coord==1 ∥ coord==2)  {  do{   wire(nod-- coord, img-- cols, img-- rows, img--slices, nnod, coord);   printf("\n\nContinue? (y/n) ");   scanf("%s",&end);   }  while(end|=`y`);  }  /* CONNECT NODES WITH STRAIGHT LINES */  if(delinitp==LINEAR)  {  for(s=0; s<img-- slices; s++)   {   for(i=0; i<nnod-1; i++)   {   c1 = nod-- coord s! i! 0!;   r1 = nod-- coord s! i! 1!;   c2 = nod-- coord s! i+1! 0!;   r2 = nod-- coord s! i+1! 1!;   conpts2(end-- val, c1, r1, c2, r2, img-- cols, img--rows, s, delinclr);   conpts1(ftr-- val, c1, r1, c2, r2, img-- cols, img--rows, s);   }   c1 = nod-- coord s! 0! 0!;   r1 = nod-- coord s! 0! 1!;   c2 = nod-- coord s! nnod-1! 0!;   r2 = nod-- coord s! nnod-1! 1!;   conpts2(end-- val, c1, r1, c2, r2, img-- cols, img--rows, s, delinclr);   conpts1(ftr-- val, c1, r1, c2, r2, img-- cols, img--rows, s);   }  }  /* CONNECT NODES WITH SPLINES */  if(delinitp==SPLINE)  {  for(i=0; i<nnod+2; i++) ord2-- coord i! = i;  for(s=0; s<img-- slices; s++)   {   for(i=0; i<nnod; i++)   {   regc2-- coord i+1! = nod-- coord s! i! 0!;   regr2-- coord i+1! = nod-- coord s! i! 1!;   }   regc2-- coord 0! = regc2-- coord 1!;   regr2-- coord 0! = regr2-- coord 1!;   regc2-- coord nnod+1! = regc2-- coord nnod!;   regr2-- coord nnod+1! = regr2-- coord nnod!;   spline(ord2-- coord,regc2-- coord,nnod+2,yp1,ypn,regc2-- coord2);   spline(ord2-- coord,regr2-- coord,nnod+2,yp1,ypn,regr2-- coord2);   /* STARTING NODE COORDINATES */   ic = nod-- coord s! 0! 0!;   ir = nod-- coord s! 0! 1!;   /* DRAW SPLINES BETWEEN ADJACENT NODES */   count=1;   do{ /* THIS ALGORITHM ASSURES CONTINUOUS DELINEATION */   go = 0;   flag = 1;   fract = (float)(nnod-1)/(500.0*(float)count);   for(i=0; i<(500*count) && flag==1; i++)   {   tmp-- nod = 1.0 + (float)i*fract;   splint(ord2-- coord,regc2-- coord,regc2-- coord2,nnod+2,tmp-- nod,&nc);   splint(ord2-- coord,regr2-- coord,regr2-- coord2,nnod+2,tmp-- nod,&nr);   dist = sqrt(pow((nc-ic),2.0)+pow((nr-ir),2.0));   if(dist>1.0)    {    go = 1;    flag = 0;    ic = nod-- coord s! 0! 0!;    ir = nod-- coord s! 0! 1!;    }   else    {    c1 = ic = nc;    r1 = ir = nr;    if(c1>0 && c1<img-- cols && r1>0 && r1<img-- rows)    {    temp = c1 + r1*img-- cols + s*img-- slsize;    *(end-- val+temp) = delinclr;    *(ftr-- val+temp) = delinclr;    }    }   }   count++;    }   while(go==1);   c1 = nod-- coord s! 0! 0!;   r1 = nod-- coord s! 0! 1!;   c2 = nod-- coord s! nnod-1! 0!;   r2 = nod-- coord s! nnod-1! 1!;   conpts2(end-- val, c1, r1, c2, r2, img-- cols, img--rows, s, delinclr);   conpts2(ftr-- val, c1, r1, c2, r2, img-- cols, img--rows, s, delinclr);   }   }  *end-- image = endimage;    */ GENERATE CWTR IMAGE - INTENDED ONLY FOR TESTINGPURPOSES */  /************************/  /* SEE PROCESS BLOCK 48 */  /************************/  /* writeimage("ftrimage", ftrimage); */  }/* END OF PERFORMING PROCESS PART 2 */ printf("\n\nAll done\n\n"); sleep(2); return(1);}/* ----------------------------- SUBROUTINES ----------------------------- *//* ----------------- write coordinates for wire model-----------------*/void wire(nod-- pol, cols, rows, slices, nodes, flag)float ***nod-- pol;int cols, rows, slices, nodes, flag;{ int s, i, j, rct-- cols, rct-- rows, rct-- slices; float xx, zz, theta, rad, sumx, sumy, sumz; float ***nod-- rct, ***cube( ); \nod-- rct = cube(slices,nodes,3); /* x,y,z coord. in arect. space */  /* size of the rectangular space */  rct-- cols  = cols;  rct-- rows  = rows;  rct-- slices = cols;  printf("\nRectangular space: x=%d, y=%d, z=%d",    rct-- cols, rct-- rows, rct-- slices);  for(s=0; s<slices; s++)  {  for(i=0; i<nodes; i++)   {   rad = nod-- pol s! i! 0!-(cols-1)/2.0;   /* front hemicylinder */   if(rad>0.0)   theta = pi*((float)s/slices);   /* rear hemicylinder */   else   theta = pi*((float)s/slices)+pi;   /* Cartesian coord., here, origin is in the middle (|) */   xx = fabs(rad)*cos(theta);   zz = fabs(rad)*sin(theta);  \nod-- rct s! i! 0!=(rct-- cols-1)/2.0+xx;  \nod-- rct s! i! 1!=(rows-1)-nod-- pol s! i! 1!;  \nod-- rct s! i! 2!=rct-- slices-1-((rct--slices-1)/2.0-zz);   }  } /* calculate an average AP node position */ if(flag==1)  {  sumx = sumy = sumz = 0.0;  for(s=0; s<slices; s++)  {  sumx += nod-- rct s! nodes/2! 0!;  sumy += nod-- rct s! nodes/2! 1!;  sumz += nod-- rct s! nodes/2! 2!;  }  for(s=0; s<slices; s++)  {  nod-- rct s! nodes/2! 0! = sumx/(float)slices;  nod-- rct s! nodes/2! 1! = sumy/(float)slices;  nod-- rct s! nodes/2! 2! = sumz/(float)slices;  } } /* print x, y, z coordinates along nodes ("vertically") */ printf("\n\nNode coordinates in 3D"); printf("\n\nvertical wires → xprizm3 rows:%d", 2*slices);  for(s=0; s<slices; s++)  {  printf("\n");  for(i=0; i<=nodes/2; i++)  {  printf("\n %6.2f %6.2f %6.2f",  \nod-- rct s! i! 0!, nod-- rct s! i! 1!, nod--rct s! i! 2!);  }  }  for(s=0; s<slices; s++)  {  printf("\n");  for(i=nodes-1; i>=nodes/2; i--)  {  printf("\n %6.2f %6.2f %6.2f",  \nod-- rct s! i! 0!, nod-- rct s! i! 1!, nod--rct s! i! 2!);  }  } s=0; printf("\n"); for(i=0; i<=nodes/2; i++)  {  printf("\n %6.2f %6.2f %6.2f",  \nod-- rct s! i! 0!, nod-- rct s! i! 1!, nod--rct s! i! 2!);  } /* print x, y, z coordinates along slices ("horizontally") */ printf("\nhorizontal wires → xprizm3 rows: %d",(nodes-1)/2+1);  for(i=0; i<=nodes/2; i++)  {  printf("\n");  for(s=0; s<slices; s++)  {  printf("\n %6.2f %6.2f %6.2f",  \nod-- rct s! i! 0!, nod-- rct s! i! 1!, nod--rct s! i! 2!);   }  j=nodes-1-i;  for(s=0; s<slices; s++)   {   printf("\n %6.2f %6.2f %6.2f",   \nod-- rct s! j! 0!, nod-- rct s! j! 1!,nod-- rct s! j! 2!);   }  s=0;  printf("\n %6.2f %6.2f %6.2f",   nod-- rct s! i! 0!, nod-- rct s! i! 1!, nod-- rct s! i!2!);  } } /* ----------------- feature processing: hilomean filter------------------- */ void hilomean(data, x, y, z, cols, rows, window, hilomn-- out) unsigned char *data; int x, y, z, cols, rows, window; float *hilomn-- out; {  int register i, j, c, r;  int slsize, temp, value, count;  float hisum, *hi-- arr, ftemp;  float losum, *lo-- arr, diff;  void free-- vector( );  float *vector( );  slsize = cols*rows;  hi-- arr= vector(window*window);  lo-- arr= vector(window*window);  count = 0;  for(r=0; r<window; r++)  {  for(c=0; c<window; c++)   {   temp = x+c-window/2 + (y+r-window/2)*cols + z*slsize;   value = *(data+temp);   hi-- arr count! = value;   lo-- arr count! = value;   count++;   }  }  for(i=0; i<window; i++)  {  for(j=i+1; j<window*window; j++)   {   if(hi-- arr i!<hi-- arr j!)   {   ftemp = hi-- arr i!;   hi-- arr i! = hi-- arr j!;   hi-- arr j! = ftemp;   }   if(lo-- arr i!>lo-- arr j!)   {   ftemp = lo-- arr i!;   lo-- arr i! = lo-- arr j!;   lo-- arr j! = ftemp;   }   }  }  hisum = losum = 0.0;  for(i=0; i<window; i++)  {  hisum += hi-- arr i!;  losum += lo-- arr i!;  }  diff = (hisum/(float)window) - (losum/(float)window);  *hilomn-- out = diff; } /* ------------------ connect two points (vers. 1) -------------------------- */ #define TINY 0.0001 void conpts1(data, x1, y1, x2, y2, cols, rows, z) unsigned char *data; int x1, y1, x2, y2, cols, rows, z; {  int slsize, temp, img-- temp, x-- bg, x-- ed, y--bg, y-- ed, x, y, xx, yy, val;  int total, count, i;  float x-- df, y-- df, a, b, **line-- arr;  float **matrix( );  void free-- matrix( );  slsize = cols * rows;  x-- df = x1 - x2 + TINY;  y-- df = y1 - y2 + TINY;  b  = y-- df/x-- df;  a  = (float)y1 - b * (float)x1;  x-- bg = (x1 < x2 ? x1 : x2);  y-- bg = (y1 < y2 ? y1 : y2);  x-- ed = (x1 > x2 ? x1 : x2);  y-- ed = (y1 > y2 ? y1 : y2);  total= (x-- ed-x-- bg+1) + (y-- ed-y-- bg+1);  /* allocate an array for line data coordinates (x˜0, y˜1)and a flag (˜2) */  line-- arr=matrix(total, 3);  for(i=0; i<total; i++) line-- arr i! 2!=1.0;  /* put actual connection into the array */  count=0;  for(x = x-- bg; x <= x-- ed; x++)  {  y = (rint)(a + b * (float)x);  line-- arr count! 0!=x;  line-- arr count! 1!=y;  count++;  }  for(y = y-- bg; y <= y-- ed; y++)  {  x = (rint)(((float)y - a) / b);  line-- arr count! 0!=x;  line-- arr count! 1!=y;  for(i=0; i<count-1; i++)  {  xx=line-- arr i! 0!;  yy=line-- arr i! 1!;  if(xx==x && yy==y) line-- arr count! 2!=0.0;  }  count++;  }  for(i=0; i<count; i++)  {  if(x>=0 && x<cols && y>=0 && y<rows && line-- arr i! 2!==1.0)   {   x=line-- arr i! 0!;   y=line-- arr i! 1!;   img-- temp = x + y * cols + z * slsize;   val=*(data + img-- temp);   if(val<=200) *(data + img-- temp)=240;   else *(data + img-- temp)=100;   }  }  free-- matrix(line-- arr,total); } #undef TINY /* --------------------- connect two points (vers. 2) ----------------------- */ #define TINY 0.0001 void conpts2(data, x1, y1, x2, y2, cols, rows, z, value) unsigned char *data; int x1, y1, x2, y2, cols, rows, z, value; {  int slsize, temp, img-- temp, x-- bg, x-- ed, y--bg, y-- ed, x, y;  float x-- df, y-- df, x-- d, y-- d, a, b;  slsize = cols * rows;  x-- df = x1 - x2;  y-- df = y1 - y2;  b  = y-- df / (x-- df + TINY);  a  = (float)y1 - b * (float)x1;  x-- bg = (x1 < x2 ? x1 : x2);  y-- bg = (y1 < y2 ? y1 : y2);  x-- ed = (x1 > x2 ? x1 : x2);  y-- ed = (y1 > y2 ? y1 : y2);  x-- d = x-- ed - x-- bg;  y-- d = y-- ed - y-- bg;  /* draw the actual connection */  for(x = x-- bg; x <= x-- ed; x++)  {  y = (rint)(a + b * (float)x);  if(y >= 0 && y < rows)   {   img-- temp = x + y * cols + z * slsize;   *(data + img-- temp) = value;   }  }  for(y = y-- bg; y <= y-- ed; y++)  {  x = (rint)(((float)y - a) / b);  if(x >= 0 && x < cols)   {   img-- temp = x + y * cols + z * slsize;   *(data + img-- temp) = value;   }  } } #undef TINY /* --------------- place node in image (for depiction)--------------------- */ void place-- node(data, x, y, z, cols, rows, slices) unsigned char *data; int x, y, z, cols, rows, slices; { int slsize = cols*rows, val; /* LABEL THE NODE POSITION BY "X" */ if(x>0 && y>0 && x<cols-1 && y<rows-1)  {  *(data+x+y*cols+z*slsize)   = 0;  *(data+x-1+(y-1)*cols+z*slsize) = 0;  *(data+x+1+(y-1)*cols+z*slsize) = 0;  *(data+x-1+(y+1)*cols+z*slsize) = 0;  *(data+x+1+(y+1)*cols+z*slsize)  = 0;  *(data+x+(y-1)*cols+z*slsize)  = 255;  *(data+x+1+y*cols+z*slsize)  = 255;  *(data+x+(y+1)*col+z*slsize)  = 255;  *(data+x-1+y*cols+z*slsize)  = 255;  } else  {  printf("\nThe node at x=%d, y=%d, z=%d is at the edge or outof image\n",  x, y, z);  } }----------- */following subroutines are from `Numerical Recipes` /* -------------------------------- splin2 -------------------------------- */ /* Calculates bicubic spline interpolation */ void splin2(x1a,x2a,ya,y2a,m,n,x1,x2,y) float x1a  !,x2a  !,**ya,**y2a,x1,x2,*y; int m,n; {  int j;  float *ytmp,*yytmp,*vector( );  void spline( ),splint( ),free-- vector( );  ytmp=vector(n);  yytmp=vector(m); /* <<<<<<<<< */  for (j=0;j<=m-1;j++)   splint(x2a,ya j!,y2a j!,n,x2,&yytmp j!);  spline(x1a,yytmp,m,1.0e30,1.0e30,ytmp);  splint(x1a,yytmp,ytmp,m,x1,y);  free-- vector(ytmp);  free-- vector(yytmp); } /* ----------------------------- splie2 --------------------------------- */ /* Returns second derivatives for bicubic spline interpolation (splin2)*/ void splie2(x1a,x2a,ya,m,n,y2a) float x1a  !,x2a  !,**ya,**y2a; int m,n; {  int j;  void spline( );  for (j=0;j<=m-1;j++)   spline(x2a,ya j!,n,1.0e30,1.0e30,y2a j!); } /* ----------------------------- spline ---------------------------------- */ /* Arrays x  ! and y  ! contain a tabulated function, and yp1 and ypnare    given 1st derivatives of the interpolating function at points 1 and n*/ /* This function returns an array y2  ! that contains the secondderivatives    of the interpolating function at the tabulated points xi */ void spline(x,y,n,yp1,ypn,y2) float x  !,y  !,yp1,ypn,y2  !; int n; {  int i,k;  float p,qn,sig,un,*u,*vector( );  void nrerror( );  void free-- vector( );  u=vector(n-1);  if (yp1 > 0.99e30)   y2 0!=u 0!=0.0;  else {   y2 0! = -0.5;   u 0!=(3.0/(x 1!-x 0!))*((y 1!-y 0!)/(x 1!-x 0!)-yp1);  }  for (i=1;i<=n-2;i++) {   sig=(x i!-x i-1!)/(x i+1!-x i-1!);   p=sig*y2 i-1!+2.0;   y2 i!=(sig-1.0)/p;   u i!=(y i+1!-y i!)/(x i+1!-x i!) - (y i!-y i-1!)/(x i!-x i-1!);   u i!=(6.0*u i!/(x i+1!-x i-1!)-sig*u i-1!)/p;  }  if (ypn > 0.99e30)   qn=un=0.0;  else {   qn=0.5;   un=(3.0/(x n-1!-x n-2!))*(ypn-(y n-1!-y n-2!)/(x n-1!-x n-2!));  }  y2 n-1!=(un-qn*u n-2!)/(qn*y2 n-2!+1.0);  for (k=n-2;k>=0;k--)   y2 k!=y2 k!*y2 k+1!+u k!;  free-- vector(u); } /* ----------------------------- splint ---------------------------------- */ /* Given value of x, arrays x  !, y  !, and y2  !, this routine returnsy. */ void splint(xa,ya,y2a,n,x,y) float xa  !,ya  !,y2a  !,x,*y; int n; {  int klo,khi,k;  float h,b,a,out;  void nrerror( );  klo=0;  khi=n-1;  while (khi-klo > 1) {   k=(khi+klo) >> 1;   if (xa k! > x) khi=k;   else klo=k;  }  h=xa khi!-xa klo!;  if (h ==0.0) nrerror(¢Bad XA input to routine SPLINT");  a=(xa khi!-x)/h;  b=(x-xa klo!)/h;  *y=a*ya klo!'b*ya khi!+((a*a*a-a)*y2a klo!+(b*b*b-b)*y2a!khi!)*(h*h)/6.0; } /* --------------------------- nrerror ------------------------------------ */ void nrerror(error-- text) char error-- text  !; {  void exit( );  fprintf(stderr,"\nRun-time error...\n");  fprintf(stderr,"%s\n",error-- text);  fprintf(stderr,"...now exiting to system...\n");  exit(1); } /* ---------------------------- vector -------------------------------------- */ float *vector(n) int n; {  float *v;  v=(float *)malloc((unsigned)n*sizeof(float));  if (|v) nrerror("allocation failure in vector( )");  return v; } /* ----------------------------- matrix -------------------------------------*/ float **matrix(nr,nc) int nr,nc; {  int i;  float **m;  m=(float **) malloc((unsigned)nr*sizeof(float*));  if (|m) nrerror("allocation failure 1 in matrix( )");  for(i=0;i<nr;i++) {   m i!=(float *) malloc((unsigned) (nc)*sizeof(float));   if (|m i!) nrerror("allocation failure 2 in matrix( )");  }  return m; } /* ------------------------------ cube --------------------------------------*/ float ***cube(ns,nr,nc) int ns,nr,nc; {  int i,j;  float ***c;  c=(float ***) malloc((unsigned)ns*sizeof(float**));  if (|c) nrerror("allocation failure 1 in cube( )");  for(i=0;i<ns; i++)   {   c i!=(float **) malloc((unsigned)nr*sizeof(float));   if (|c i!) nrerror("allocation failure 2 in cube( )");   for(j=0;j<nr;j++)   {   c i! j!=(float *) malloc((unsigned)nc*sizeof(float));   if (|c i! j!) nrerror("allocation failure 3 in cube( )");   }   }  return c; } /* ------------------------------ hypercube ---------------------------------*/ float ****hypercube(nt,ns,nr,nc) int nt,ns,nr,nc; {  int g,i,j;  float ****h;  h=(float ****) malloc((unsigned)nt*sizeof(float***));  if (|h) nrerror("allocation failure 1 in hypercube( )");  for(g=0;g<nt;g++)  {  h g!=(float ***) malloc((unsigned)ns*sizeof(float));  if (|h g!) nrerror("allocation failure 2 in hypercube( )");  for(i=0;i<ns;i++)   {   h g! i!=(float **) malloc((unsigned)nr*sizeof(float));   if (|h g! i!) nrerror("allocation failure 3 in hypercube( )");   for(j=0;j<nr;j++)   {   h g! i! j!=(float *) malloc((unsigned)nc*sizeof(float));   if (|h g! i! j!) nrerror("allocation failure 4 in hypercube( )");   }   }  }  return h; } /* ---------------------------- free-- vector ---------------------------------*/ void free-- vector(v) float *v; {  if(v |= NULL)   free((char*)(v)); } /* --------------------------- free-- matrix ---------------------------------*/ void free-- matrix(m,nr) float **m; int nr; {  int i;  for(i=0;i<nr;i++) free((char*)(m i!));  free((char*)(m)); } /* ----------------------------- free-- cube ---------------------------------*/ void free-- cube(c,ns,nr) float ***c; int ns,nr; {  int i,j;  for(i=0;i<ns;i++)   {   for(j=0;j<nr;j++)   {   free((char*)(c i! j!));   }   free((char*)(c i!));   }  free((char*)(c)); } /* -------------------------- free-- hypercube --------------------------------*/ void free-- hypercube(h,nt,ns,nr) float ****h; int nt,ns,nr; {  int g,i,j;  for(g=0;g<nt;g++)  {  for(g=0;i<ns;i++)   {   for(j=0;j<nr;j++)   {   free((char*)(h g! i! j!));   }   free((char*)(h g! i!));   }  free((char*)(h g!));  }  free((char*)(h)); }library-- code-- endlibrary-- modslibrary-- mods-- end__________________________________________________________________________
Citas de patentes
Patente citada Fecha de presentación Fecha de publicación Solicitante Título
US5159931 *20 Nov 19893 Nov 1992Riccardo PiniApparatus for obtaining a three-dimensional reconstruction of anatomic structures through the acquisition of echographic images
US5239591 *3 Jul 199124 Ago 1993U.S. Philips Corp.Contour extraction in multi-phase, multi-slice cardiac mri studies by propagation of seed contours between images
US5435310 *23 Jun 199325 Jul 1995University Of WashingtonDetermining cardiac wall thickness and motion by imaging and three-dimensional modeling
US5485845 *4 May 199523 Ene 1996Hewlett Packard CompanyRotary encoder for intravascular ultrasound catheter
US5487388 *1 Nov 199430 Ene 1996Interspec. Inc.Three dimensional ultrasonic scanning devices and techniques
US5568811 *13 Ene 199529 Oct 1996Vingmed Sound A/SMethod for motion encoding of tissue structures in ultrasonic imaging
US5577506 *30 Oct 199526 Nov 1996Hewlett Packard CompanyCatheter probe having a fixed acoustic reflector for full-circle imaging
Otras citas
Referencia
1 *Automatic Initial Estimatin of the Left Ventricular Myocardial Midwall in Emission Tomograms Using Kohonen Maps , IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 16, No. 3, Mar. 1994, Manhaeghe, et al.
2Automatic Initial Estimatin of the Left Ventricular Myocardial Midwall in Emission Tomograms Using Kohonen Maps, IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 16, No. 3, Mar. 1994, Manhaeghe, et al.
3 *Classifying Tissue and Structure in Echocardiograms , IEEE Engineering in Medicine and Biology, pp. 754 760, Nov./Dec. 1994, Brotherton, et al.
4Classifying Tissue and Structure in Echocardiograms, IEEE Engineering in Medicine and Biology, pp. 754-760, Nov./Dec. 1994, Brotherton, et al.
5 *Detecting Left Ventricular Endocardial and Epicardial Boundaries by Digital Two Dimensional Echocardiography , IEEE Transactions on Medical Imaging, vol. 7, No. 2, Jun. 1988, Chu, et al.
6Detecting Left Ventricular Endocardial and Epicardial Boundaries by Digital Two-Dimensional Echocardiography, IEEE Transactions on Medical Imaging, vol. 7, No. 2, Jun. 1988, Chu, et al.
7 *Edge Detectors Based on Nonlinear Filters , IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. PAMI 8, No. 4, Jul. 1986, Pitas, et al.
8Edge Detectors Based on Nonlinear Filters, IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. PAMI-8, No. 4, Jul. 1986, Pitas, et al.
9 *Learning Based Ventricle Detection from Cardiac MR and CT Images , IEEE Transactions on Medical Imaging, vol. 16, No. 4, Aug. 1997, Weng, et al.
10Learning-Based Ventricle Detection from Cardiac MR and CT Images, IEEE Transactions on Medical Imaging, vol. 16, No. 4, Aug. 1997, Weng, et al.
11 *Martin et al., Methodology For Three Dimensional Reconstruction Of The Left Ventricle From Transesophageal Echocardiograms, Ultrasound in Medical and biology, vol. 19. No. 1. pp. 27 38, 1993.
12Martin et al., Methodology For Three-Dimensional Reconstruction Of The Left Ventricle From Transesophageal Echocardiograms, Ultrasound in Medical and biology, vol. 19. No. 1. pp. 27-38, 1993.
13 *McCann et al., A method for three dimensional ultrasonic imaging of the heart in vivo, Dynamic Cardiovascular Imaging, vol. 1, No. 2, pp. 97 109, 1987.
14McCann et al., A method for three-dimensional ultrasonic imaging of the heart in vivo, Dynamic Cardiovascular Imaging, vol. 1, No. 2, pp. 97-109, 1987.
15 *Recovery of the 3 D Shape of the Left Ventricle from Echocardiographic Images , IEEE Transcations on Medical Imaging, vol. 14, No. 2, Jun. 1995, pp. 301 317, Coppini, et al.
16Recovery of the 3-D Shape of the Left Ventricle from Echocardiographic Images, IEEE Transcations on Medical Imaging, vol. 14, No. 2, Jun. 1995, pp. 301-317, Coppini, et al.
17 *The Self Organizing Map , Proceedings of the IEEE, Vo. 78, No. 9, Sep. 1990, Teuvo Kohonen.
18The Self-Organizing Map, Proceedings of the IEEE, Vo. 78, No. 9, Sep. 1990, Teuvo Kohonen.
Citada por
Patente citante Fecha de presentación Fecha de publicación Solicitante Título
US6038074 *19 May 199814 Mar 2000Ricoh Company, Ltd.Three-dimensional measuring apparatus and method, image pickup apparatus, and apparatus and method for inputting image
US6248070 *28 Sep 199919 Jun 2001Kabushiki Kaisha ToshibaUltrasonic diagnostic device
US62496931 Nov 199919 Jun 2001General Electric CompanyMethod and apparatus for cardiac analysis using four-dimensional connectivity and image dilation
US6352509 *16 Nov 19995 Mar 2002Kabushiki Kaisha ToshibaThree-dimensional ultrasonic diagnosis apparatus
US6366684 *2 Abr 19992 Abr 2002U.S. Philips CorporationImage processing method and system involving contour detection steps
US6368285 *18 Ago 20009 Abr 2002Biosense, Inc.Method and apparatus for mapping a chamber of a heart
US6385476 *21 Sep 19997 May 2002Biosense, Inc.Method and apparatus for intracardially surveying a condition of a chamber of a heart
US64384031 Nov 199920 Ago 2002General Electric CompanyMethod and apparatus for cardiac analysis using four-dimensional connectivity
US6464639 *24 Oct 200015 Oct 2002Cybermed, Inc.Method for modeling an internal object of a human body and apparatus thereof
US647007020 Dic 200022 Oct 2002Cedara Software Corp.Image reconstruction using multiple X-ray projections
US647348820 Dic 200029 Oct 2002Cedara Software Corp.Three dimensional image reconstruction from single plane X-ray fluorograms
US648215929 Feb 200019 Nov 2002Ge Medical Systems Kretztechnik Gmbh & Co OhgMethod for the examination of objects with ultrasound
US6484048 *21 Oct 199919 Nov 2002Kabushiki Kaisha ToshibaReal-time interactive three-dimensional locating and displaying system
US6491636 *7 Dic 200010 Dic 2002Koninklijke Philips Electronics N.V.Automated border detection in ultrasonic diagnostic images
US6500118 *22 Oct 199931 Dic 2002Kabushiki Kaisha ToshibaThree-dimensional ultrasonic diagnostic apparatus
US658754130 Sep 20021 Jul 2003Cedara Software Corp.Three dimensional image reconstruction from single plane x-ray fluorograms
US6633773 *29 Sep 200014 Oct 2003Biosene, Inc.Area of interest reconstruction for surface of an organ using location data
US666186930 Sep 20029 Dic 2003Cedara Software Corp.Image reconstruction using multiple X-ray projections
US6708055 *6 May 200216 Mar 2004University Of FloridaMethod for automated analysis of apical four-chamber images of the heart
US6778690 *13 Ago 199917 Ago 2004Hanif M. LadakProstate boundary segmentation from 2D and 3D ultrasound images
US6813373 *3 Abr 20012 Nov 2004Koninklijke Philips Electronics, N.V.Image segmentation of embedded shapes using constrained morphing
US6839456 *5 Jun 20034 Ene 2005Matsushita Electric Industrial Co., Ltd.System for accurately obtaining a contour and/or quantitative information from an echo image with reduced manual operation
US6863655 *10 Jun 20028 Mar 2005Ge Medical Systems Global Technology Company, LlcUltrasound display of tissue, tracking and tagging
US6878114 *14 Nov 200312 Abr 2005Aloka Co., Ltd.Ultrasonic diagnostic device
US7092749 *11 Jun 200315 Ago 2006Siemens Medical Solutions Usa, Inc.System and method for adapting the behavior of a diagnostic medical ultrasound system based on anatomic features present in ultrasound images
US7110583 *30 Ene 200219 Sep 2006Matsushita Electric Industrial, Co., Ltd.Ultrasonic diagnostic device and image processing device
US7162065 *1 Jun 20049 Ene 2007John P. Robarts Research InstututeProstate boundary segmentation from 2D and 3D ultrasound images
US7171427 *25 Abr 200330 Ene 2007Oracle International CorporationMethods of navigating a cube that is implemented as a relational object
US718920812 Abr 200013 Mar 2007Endocardial Solutions, Inc.Method for measuring heart electrophysiology
US72633976 Abr 200428 Ago 2007St. Jude Medical, Atrial Fibrillation Division, Inc.Method and apparatus for catheter navigation and location and mapping in the heart
US72898433 Dic 200430 Oct 2007St. Jude Medical, Atrial Fibrillation Division, Inc.Software for mapping potential distribution of a heart chamber
US7295714 *16 Jun 200313 Nov 2007Ricoh Company, Ltd.Image processing circuit and image processing method that prevent problems occurring in image reduction
US73216762 Jun 200422 Ene 2008Koninklijke Philips Electronics N.V.Automatic determination of the long axis of the left ventricle in 3D cardiac imaging
US7333962 *22 Feb 200619 Feb 2008Microsoft CorporationTechniques to organize test results
US7359535 *20 Jun 200315 Abr 2008Ge Medical Systems Global Technology Company, LlcSystems and methods for retrospective internal gating
US7372984 *5 May 200513 May 2008California Institute Of TechnologyFour-dimensional imaging of periodically moving objects via post-acquisition synchronization of nongated slice-sequences
US750264226 Abr 200510 Mar 2009Siemens AktiengesellschaftMethod and device for visually supporting an electrophysiological catheter application
US7507204 *4 Ene 200524 Mar 2009Medison Co., Ltd.Apparatus and method for forming 3D ultrasound image
US7519206 *19 Nov 200114 Abr 2009Siemens Medical Solutions Usa, Inc.Detection of features in images
US76273867 Oct 20041 Dic 2009Zonaire Medical Systems, Inc.Ultrasound imaging system parameter optimization via fuzzy logic
US7670297 *30 Jun 19982 Mar 2010St. Jude Medical, Atrial Fibrillation Division, Inc.Chamber mapping system
US780682927 Ene 20055 Oct 2010St. Jude Medical, Atrial Fibrillation Division, Inc.System and method for navigating an ultrasound catheter to image a beating heart
US781980222 Nov 200526 Oct 2010General Electric CompanyCatheter tip
US78268817 Jun 20002 Nov 2010St. Jude Medical, Atrial Fibrillation Division, Inc.Endocardial chamber mapping system
US78312887 Jun 20009 Nov 2010St. Jude Medical, Atrial Fibrillation Division, Inc.Method for mapping potential distribution of a heart chamber
US793001230 Sep 200419 Abr 2011St. Jude Medical, Atrial Fibrillation Division, Inc.Chamber location method
US7940955 *26 Jul 200610 May 2011Delphi Technologies, Inc.Vision-based method of determining cargo status by boundary detection
US800270524 Jul 200623 Ago 2011Zonaire Medical Systems, Inc.Continuous transmit focusing method and apparatus for ultrasound imaging system
US803643610 Oct 200711 Oct 2011Cedara Software Corp.System and method for segmenting a region in a medical image
US806467029 Sep 200422 Nov 2011Northrop Grumman Systems CorporationAnalysis of multidimensional data
US82089983 Nov 200526 Jun 2012St. Jude Medical, Atrial Fibrillation Division, Inc.Representing the geometry of a heart chamber
US83337059 Sep 201018 Dic 2012St. Jude Medical, Atrial Fibrillation Division, Inc.System and method for navigating an ultrasound catheter to image a beating heart
US839855310 Ene 200719 Mar 2013Urodan ApsMethod and an apparatus for recording bladder volume
US8463065 *7 Dic 200611 Jun 2013Commonwealth Scientific And Industrial Research OrganisationLinear feature detection method and apparatus
US8529446 *31 May 200710 Sep 2013Siemens AktiengesellschaftMethods for determining parameters and planning clinical studies in automatic study and data management systems
US878431824 Jul 200622 Jul 2014Zonare Medical Systems, Inc.Aberration correction using channel data in ultrasound imaging system
US8838216 *2 May 200816 Sep 2014Imperial Innovations LimitedMethod of and apparatus for generating a model of a cardiac surface having a plurality of images representing electrogram voltages
US20080194920 *31 May 200714 Ago 2008Siemens AktiengesellschaftMethods for determining parameters and planning clinical studies in automatic study and data management systems
US20090149734 *25 Nov 200811 Jun 2009Kabushiki Kaisha ToshibaDiagnostic imaging apparatus, magnetic resonance imaging apparatus, and x-ray ct apparatus
US20090154792 *7 Dic 200618 Jun 2009Commonwealth Scientific And Industrial Research OrganisationLinear Feature Detection Method and Apparatus
US20100249589 *25 Mar 200930 Sep 2010Peter LysyanskySystem and method for functional ultrasound imaging
US20100280399 *2 May 20084 Nov 2010Imperial Innovations LimitedMethod of and apparatus for generating a model of a cardiac surface having a plurality of images representing electrogram voltages
USRE4133423 Sep 199311 May 2010St. Jude Medical, Atrial Fibrillation Division, Inc.Endocardial mapping system
DE102004020587A1 *27 Abr 200424 Nov 2005Siemens AgVerfahren und Vorrichtung zur visuellen Unterstützung einer elektrophysiologischen Katheteranwendung mit 2D-Durchleuchtungsbildern
EP1034742A19 Mar 199913 Sep 2000Kreztechnik AktiengesellschaftMethod for investigating objects with ultrasound
EP1545286A2 *17 Sep 200329 Jun 2005Diagnostic Ultrasound CorporationThree-dimensional system for abdominal aortic aneurysm evaluation
WO2002013142A1 *1 Ago 200114 Feb 2002Andrew Timothy RamseyComputed tomography
WO2006121435A2 *6 May 200516 Nov 2006California Inst Of TechnnologyFour-dimensional imaging of periodically moving objects via post-acquisition synchronization of nongated slice-sequences
Clasificaciones
Clasificación de EE.UU.600/450, 128/916, 600/441
Clasificación internacionalG01S15/89, A61B8/14
Clasificación cooperativaY10S128/916, G01S15/8993, A61B8/14, A61B8/483, A61B8/0883
Clasificación europeaA61B8/08S, A61B8/48D, A61B8/14, G01S15/89D9
Eventos legales
FechaCódigoEventoDescripción
26 Jul 2010FPAYFee payment
Year of fee payment: 12
13 Jun 2006FPAYFee payment
Year of fee payment: 8
15 Ago 2002FPAYFee payment
Year of fee payment: 4
3 Sep 1998ASAssignment
Owner name: MAYO FOUNDATION FOR MEDICAL EDUCATION AND RESEARCH
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BELOHLAVEK, MAREK;REEL/FRAME:009431/0624
Effective date: 19980723