Abstract
Hanger, Christopher C., Robert G. Presson, Jr., Osamu Okada, Steven J. Janke, John J. Watkins, Wiltz W. Wagner, Jr., and Ronald L. Capen. Computer determination of perfusion patterns in pulmonary capillary networks. J. Appl. Physiol.82(4): 1283–1289, 1997.—Individual pulmonary capillaries are not steadily perfused. By using in vivo microscopy, it can readily be demonstrated that perfusion continually switches between capillary segments and between portions of the network within a single alveolar wall. These changes in capillary perfusion occur even when upstream pressure and flow are constant. Flow switching between capillary segments in the absence of hemodynamic changes in large upstream vessels suggests that capillary perfusion patterns could be random. To calculate the probability that perfusion patterns could occur by chance, it is necessary to know the total number of possible perfusion patterns in a given capillary network. We developed a computer program that can determine every possible perfusion pattern for any given capillary network, and from that information we can calculate whether perfusion of individual segments in the network is random. With the results of the computer program, we have obtained statistical evidence that some capillary segments in a network are nonrandomly perfused.
 pulmonary circulation
 capillary perfusion stability
 capillary recruitment
 random perfusion
 computer modeling
 Monte Carlo probability
 probability
 dogs
the mental image of the pulmonary capillary bed that one assembles from light, electron, and scanningelectron micrographs is static. Red blood cells are motionless. Often, injected material distends every capillary segment. When the pulmonary microcirculation is viewed in real time, however, red blood cells stream through networks of capillaries forming complex patterns. Velocities of red blood cells vary between capillaries and within individual capillary segments from moment to moment. Hematocrit in single capillaries changes rapidly. Red blood cell perfusion switches between segments. The switching and other perfusion variations are not surprising, because the highly flexible red blood cells progressively impact on a long series of junctions as they traverse the network. This series of options for each red blood cell could cause a portion of capillary blood flow to move randomly through the network. On the other hand, some capillary segments are likely to have low resistances because of relatively large diameters and therefore to be frequently perfused. The dynamic character of capillary network perfusion, however, has largely eluded quantification. Although various aspects of the switching of red blood cell perfusion between segments have been described (5, 6, 11), it has not been possible to determine whether switching or steady perfusion of a segment occurs more or less often than by chance. Determining that probability is confounded because conventional statistics cannot be used. Statistical tests require independence of observations, such as separate flips of a coin, whereas the perfusion of a capillary segment is not an independent event. Rather, it depends on a perfused segment to feed it and another perfused segment to drain it. Within a network, the feeders and drainers in turn depend on the perfusion of numerous other segments. Therefore, to determine whether a capillary segment is being perfused randomly, it is necessary to regard its perfusion as part of the whole network in which it resides. An entire capillary network has many potential combinations of perfused and unperfused segments. Each combination comprises a unique perfusion pattern.
Our aim is to calculate the probability that a particular segment is perfused randomly or whether it is perfused more often than expected by chance. To make that calculation, the number of patterns in which a given segment is perfused has to be divided by the total number of possible patterns. By analogy, the probability that the number 3 will appear when a sixsided die is thrown is one in six. A crucial part of the probability calculation lies in knowing the denominator. In the case of the die, it is essential to know how many sides it has; in the case of an alveolar capillary network, the total number of possible perfusion patterns must be known. Until that information is obtained, the existence of persistently perfused segments that in turn may link to form preferential pathways or the presence of randomly perfused segments remains no more than hypothetical possibility. In this report, we present the details of a computerbased method designed to determine all possible perfusion patterns in individual alveolar capillary networks.
METHODS
Observations of pulmonary capillary perfusion were made by using videomicroscopy of subpleural alveolar capillary networks in isolated canine lung lobes. The details of the isolated lobe preparation have been published previously (8). Briefly, adult mongrel dogs were anesthetized by intravenous injection of pentobarbital sodium (30 mg/kg). The left lower lobe artery and a cuff of left atrium were cannulated; the left lower lobe was removed from the animal, placed on a microscope stand, and ventilated. Autologous blood was pumped into the lobar artery through a blood filter, bubble trap, and heat exchanger. A 1.3cm^{2} area on the upper surface of the lobe was held stationary against a transparent window by a vacuum ring around the window. The surface of the lobe was observed with a Leitz Ultropak surfaceilluminating microscope connected to a chargecoupled device television camera and a video recorder.
Pressure and flow were adjusted until it was judged, based on previous experience with the preparation, that approximately onehalf the capillaries in the observed alveoli were recruited. This midrange of recruitment permitted either derecruitment or further recruitment. To determine the repeatability of capillary segmental perfusion in the observed network, the pump was turned off (≤30 s) and the venous line was drained, which caused the red blood cells to empty from the capillaries. The pump was then restarted, baseline arterial and venous pressures were reestablished, and a 1min video recording was made. We assumed that by stopping perfusion and allowing the networks to drain, each possible perfusion pattern would have a chance of occurring when flow was reinitiated. In this way, each observation period would be independent from the others. The cycle of perfusion interruption and resumption followed by video recording was repeated five times, for a total of six cycles over a period of ∼25 min. Because unperfused capillaries were not visible in our microscopy system, pump flow was doubled at the end of the study, and the venous reservoir was raised ∼20 cm above the lobe to ensure that all capillaries in the network were perfused. Perfusion in this fully recruited network was recorded for 1 min. Later, each recording was replayed, and any capillary segment through which at least one red blood cell passed during the 1min recording period was traced onto a sheet of clear acetate placed over the video monitor. Capillaries were readily identified as vessels that passed only a singlefile stream of red blood cells. A capillary segment was defined as a length of capillary between junctions with other capillaries or between a junction and the edge of the alveolar wall (6).
Every possible perfusion pattern for the capillary networks studied was determined by a computer program consisting of three parts: network structure input, perfusion pattern generation, and perfusion pattern screening. The programming language was Turbo Pascal 6.0 (Borland, Scotts Valley, CA) run on an IBMcompatible microcomputer with a 486DX 50MHz central processing unit.
Network structure input.
An acetate tracing was made of the alveolar wall and of all the perfused capillary segments within the wall recorded on videotape during elevated pressure and flow. The acetate tracing was placed on a digitizing pad (Houston Instrument True Grid model 1017) connected to the computer and retraced with the digitizing pad mouse. As the capillary segments were traced with the mouse, the computer assigned a number to each segment and to each junction by which it was connected to other segments and then stored the numbers in a data file. The alveolar wall perimeter was also traced and designated as the boundary of the network.
Perfusionpattern generation.
The strategy of the computer program was to generate every mathematical combination of perfused segments in the network and then to eliminate those patterns that could not exist physically. Because there are two perfusion states for each capillary segment, perfused or unperfused, there are 2^{n} mathematical combinations of perfused and unperfused segments in a capillary network, where n is the number of segments in that network. For example, if there are three capillary segments in a network, there are 2^{3} = 8 mathematically possible perfusion patterns. The computer generated these perfusion patterns by counting in binary up through 2^{n}. Table1 shows how the binary numbers 0 through 7 can represent eight mathematical patterns of unperfused (0) and perfused (1) capillary segments.
Perfusionpattern screening.
A consequence of using binary counting for generating perfusion patterns is that many patterns resulted that could not exist in real capillary networks. Impossible patterns occurred because the 2^{n} calculation included cases in which the perfusion of an isolated segment could occur even if it was not supplied and drained by other segments. To find only the physically possible perfusion patterns among all the patterns generated by binary counting, the computer screened the patterns with a series of three subroutines that acted as filters to remove physically impossible patterns.
One kind of impossible pattern has only a single perfused segment at the edge of a network (segment 1, Fig.1 A). This single capillary cannot both feed and drain the network, because blood cannot flow simultaneously in opposite directions in a capillary. The first computer subroutine ( filter 1) eliminated perfusion patterns that did not have at least two perfused segments at the edge of a network, such assegments 1 and9 in Fig.1 B. Also, each perfused segment in a network must be connected to another perfused segment to act as a source and a second perfused segment to act as a sink for blood flow.Filter 2 discarded patterns with perfused segments not connected to at least one other perfused segment at each end, except at the edge of the network, as shown bysegment 6 in Fig.1 B.
Finally, filter 3 eliminated the remaining types of impossible perfusion patterns. Becausefilter 3 was the most complicated subroutine, it was applied last so that it would have to check the smallest number of patterns, many patterns having been deleted byfilters 1 and2. Applying the filters in this order saved computer processing time. Filter 3 checked for perfusion loops that either were not connected to the rest of the network (Fig.1 C) or were connected by only a single perfused capillary segment (Fig.1 D), requiring that segment to have simultaneous bidirectional flow, an impossibility. To eliminate these impossible loops, an arbitrary junction between perfused segments was chosen. The computer then searched for a path along perfused segments to the edge of the network, temporarily marking the junctions where it started and passed along the way. If a path could not be found from the chosen junction to the network edge without going through a marked junction, then the junction failed the test of filter 3 and the pattern was discarded.
The junctions in the isolated loop formed by segments 2, 5, and7 in Fig.1 C failed to passfilter 3. On the other hand, the junction at the arrow in Fig. 1 D would pass filter 3 if the computer began its search along segment 8. However, if segment 5 were entered first, no path to the alveolar perimeter would exist that did not go through the initial junction again. The same is true if segment 7 were entered first. This explains why the computer had to begin its search in successive tries with every perfused segment connected to the junction being tested. If a junction passedfilter 3, the temporarily marked junctions were unmarked, and another junction was tested. Every perfused junction in a pattern had to pass filter 3 for the pattern to be retained.
Network cutting.
Because of the complexity of the pattern screening filters, especiallyfilter 3, considerable computing time was needed to screen all the generated perfusion patterns for a network. If a network were increased in size by only one segment, the computing time doubled because twice as many combinations of perfused and unperfused segments had to be generated and screened for physical legitimacy. The result was that networks of 35 or more segments required days of computing time. To reduce computing time to practical lengths, networks were divided into two approximately equalsized pieces by cutting centrally located segments (Fig.2, A andB). During the process of finding all legitimate patterns for each half network, the cut segments were temporarily considered to be boundary segments. The computer generated and screened all the patterns for each resulting half network and then combined all the allowable halfnetwork patterns into wholenetwork patterns (Fig. 2 C). Some allowable halfnetwork patterns, when combined with other halfnetwork patterns, produced wholenetwork patterns that were not allowable (Fig.2 D).
Despite having to rescreen the combined wholenetwork patterns, cutting large networks into two pieces resulted in substantial savings in computing time for two reasons. First, the number of patterns in two half networks was much smaller than the number of patterns in a whole network. For example, in two networks of 15 segments, there are 2^{15} + 2^{15} ≈ 6 × 10^{4} mathematically possible patterns, whereas in one network of 30 segments, there are 2^{30} ≈ 10^{9} possibilities. Second, many physically impossible half patterns were eliminated before combining them into whole patterns. This meant that many fewer than 10^{9} whole patterns resulted from combining half patterns. In one 30segment network after screening the half patterns, there were 10^{6}whole patterns that resulted from combining the remaining allowable half patterns, a savings of 10^{3}achieved by using the networkcutting strategy.
Monte Carlo sampling.
Some of the observed capillary networks had so many segments that, even after using the networkcutting strategy, the computing time required to determine all perfusion patterns was still impractical. For instance, a 37segment network required ∼16 h of computing time, and a 42segment network required ∼30 days. To deal with these large networks, we developed a Monte Carlo method (9) that, instead of determining all possible perfusion patterns, determined the number of times each segment was perfused among multiple random samples of the possible perfusion patterns. First, 10,000 allowable patterns were determined randomly; randomness of sampling was enhanced by modifying the random number generator in Turbo Pascal to reduce sequential correlations (7). Then the computer calculated the frequency that each segment was perfused among these sampled patterns. After randomly determining another 10,000 patterns, the computer recalculated the perfusion frequencies for each segment based on the cumulative number of patterns, i.e., 20,000 after two rounds of sampling. The change in frequencies between rounds of pattern determination was used as a criterion for stopping further sampling. If the change in frequency for each segment in the network was less than a certain amount, typically 0.01%, the sampling was stopped. Otherwise, rounds of 10,000 samples continued.
We checked the accuracy of the Monte Carlo sampling procedure by comparing its segmental perfusion frequencies with the frequencies found by exactly determining all possible perfusion patterns for the same capillary networks. The Monte Carlodetermined perfusion frequencies always converged on the true segmental perfusion frequencies, a result expected from other work (9).
Data analysis.
The key result of the computer method described here is the determination of the probability of perfusion of the individual segments in a randomly perfused capillary network. This was accomplished by either determining all possible perfusion patterns for a network or by the Monte Carlo method. These segmental probabilities can then be used in many possible ways to analyze the perfusion variability of alveolar capillary networks. Two of them that have been employed previously (8) are described below.
First, during repeated microscopic observations of the same alveolar wall, some segments were perfused during all observations and others were not perfused during any observation. The computer program found the number of times this group of always and neverperfused segments occurred among all perfusion patterns for the whole network. The frequency of patterns that contained this subset of always and neverperfused segments represented the probability that the group (p _{g}) would occur in a randomly perfused network. Because the repeated observations of perfusion were independent of each other, perfusion having been stopped between observations, the probability that the group perfusion pattern would occur by chance in all ofN observations was (p _{g})^{N}. A calculated probability of <0.05 was statistical evidence that the group perfusion pattern occurred nonrandomly.
A second way of using the computer perfusionpattern results that we have previously employed (8) was with individual segments rather than groups of segments. To determine whether nonrandom perfusion in individual segments was occurring in a network, the computer recorded which segments were perfused in each allowable perfusion pattern. Accordingly, after all possible perfusion patterns had been determined, the number of times each individual segment was perfused among all patterns was known. This number divided by the total number of patterns gave the frequency of perfusion of a given segment among all the possible ways that network could be perfused. This frequency also represented the probability that a given segment would be perfused in a randomly selected perfusion pattern, i.e., if perfusion of a network were random. For example, suppose the total number of perfusion patterns for a particular capillary network was 30,000 and thatsegment i was perfused in 18,000 of these patterns. Then the frequency of perfusion ofsegment i among all possible patterns was 18,000/30,000 = 0.6.
Because we were interested in the stability of perfusion patterns over time, we made repeated microscopic observations. It was necessary, therefore, to calculate the probability that a segment would be perfused by chance a specific number of times over the course of a series of observation periods. For example,segment i may have been perfused during two of six observations. To calculate the probability that this could happen by chance, it was necessary to calculate how many ways this outcome could occur. One way would be ifsegment i was perfused during the first two observations but not during the last four. If the probability that segment i was perfused during a single observation was 0.6, the probability that it would not be perfused would be 1 − 0.6 = 0.4, and the probability that it would be perfused during the first two of six observations would be (0.6)(0.6)(0.4)(0.4)(0.4)(0.4) = (0.6)^{2}(0.4)^{4}= 0.009. There are other ways this segment could be perfused only two times, such as during the last two observations. Each of these ways also has a probability of 0.009 of occurring. The total number of ways of being perfused in two out of six observations is given by 6!/[2!(6 − 2)!] = 15. Therefore, the probability ofsegment i being perfused by chance two out of six times is (15)(0.009) = 0.135. In general, the probability that a segmenti would be perfused by chance k times [P_{i}
(k)] out of N observations is in the form of a binomial random variable (4)
RESULTS
Figure 3 shows simulated results based on six microscopic observations after six interruptions of perfusion in a single alveolar wall. The computer found a total of 60,957 different patterns of perfusion in this 24segment network. For 5 of the 24 segments (segments 2, 6, 12, 16, and 22), the calculated probability (Eq.1
) that they would have been perfused by chance the number of times they were actually observed perfused was <0.05. For example, segment 6 was perfused in two of the six observations. From the computer program results, the frequency of perfusion of segment 6 among all possible patterns was 0.731. This frequency is equivalent to the probability that the segment would be perfused in a randomly perfused network. Therefore, by Eq.1
, the probability thatsegment 6 would be perfused by chance in two of six observations is
There was one segment (segment 2) that was never perfused during any of the six observations, and there were two segments (segments 3 and8) that were perfused during all six observations. This group of never and alwaysperfused segments occurred in 11,180 of the total 60,957 perfusion patterns, a frequency of 0.183. This frequency is equivalent to the probability that the group would occur in a randomly perfused network. The probability that this group would occur by chance in all of the six observations is (0.183)^{6} = 0.000038. Therefore, the pattern of perfusion and nonperfusion among this group of three segments is clearly nonrandom.
The calculated probabilities for the other 17 segments not mentioned above were >0.05, and therefore their frequency of perfusion could not be distinguished from what would be expected by chance.
DISCUSSION
To investigate whether the variability of perfusion in pulmonary capillary networks could be due to chance, we developed a computer program that determined every possible pattern in which a given capillary network could be perfused. Because we have observed pulmonary capillary flow to frequently switch among segments, even when there were no changes in pressure or flow in large upstream vessels, it seemed that flow switching could have been random. Conventional statistics could not be used to analyze whether flow changes in individual segments were random, however, because the segments in a network are not perfused independently of each other. To calculate whether a particular segment could be perfused by chance, it is necessary to know how many different perfusion patterns are possible for the network containing the segment and in how many of these patterns this segment is perfused. Only after obtaining these numbers can the probability that the segment would be perfused by chance be calculated.
The computer algorithm, which counted in binary to find all mathematically possible patterns, had the advantage of generating each pattern only once. This obviated the need to store all the patterns to check for duplications, an important savings in computational time and memory. Counting in binary also prevented missing any pattern. A disadvantage of this approach was that many physically impossible perfusion patterns were generated and had to be eliminated. The screening process to eliminate the impossible patterns required considerable computing time. Another problem with the algorithm was that computing time doubled with each additional segment in a network, which put practical limits on the size of networks that could be analyzed. Computing time was reduced significantly by dividing the networks into two pieces for networks of 20–37 segments and by a Monte Carlo sampling process for networks >37 segments.
We made accuracy checks on various aspects of the program. Two checks were made on the accuracy of the total number of possible perfusion patterns. First, we drew by hand every possible perfusion pattern for the ninesegment network, as shown in Fig. 1, a network small enough to make this approach feasible. There were exactly 41 patterns (Fig. 4), not including the pattern in which no segments were perfused. This network was used extensively in developing the computer filters, because we knew the exact number of patterns independently of the computer. Also, this network required the use of all the filters to screen out impossible patterns. In its final form, the computer program also found 41 patterns for this network.
In a second check, we used a 15segment network with treelike branching (Fig. 5). There were no collateral connections between segments, which was atypical of pulmonary capillary networks. This treelike branching, however, made it possible to develop a mathematical theorem based on Fibonacci numbers to find the total number of perfusion patterns (10). This theorem predicted, and the computer found, a total of 1,597 patterns for the network. From these two checks, we concluded that the computer program was accurate in its ability to determine the number of perfusion patterns.
The accuracy of the network cutting procedure was determined by solving five different networks with <20 segments with and without cutting. Additionally, the networks were cut in different ways. The same number of patterns was always found whether the network was divided in different ways or left whole. To test the accuracy of the Monte Carlo method, we made the exact calculation of the frequency with which each segment of a 35segment network was perfused. These true frequencies were compared with the frequencies determined by the Monte Carlo method on the same network. The Monte Carlo results were obtained by using tolerances of 10, 1, 0.1, 0.01, and 0.001% for the maximum allowable difference in segmentalperfusion frequencies between rounds of 10,000 samples. At a tolerance of 10%, the average percent difference in segmentalperfusion frequency between the Monte Carlo and exact solutions was ∼1%. At a tolerance level of 0.001%, the average difference reduced to 0.05%; however, the computing time was 1,400 times greater (∼7 h). A tolerance of 0.01% produced a compromise between accuracy (0.09% average difference in segmentalperfusion frequency between the Monte Carlo and exact solutions) and computing time (∼45 min).
This work is a first attempt to quantitate the likelihood that observed variations in capillary network perfusion over time could be caused by random switching of perfusion among capillary segments. In our analysis, we assumed that random perfusion meant that all possible perfusion patterns were equally likely. This is almost certainly not the case, but in the absence of any information about how to assign probabilities to different perfusion patterns, the assumption of equal probabilities seemed justified. As an example, because we set the level of perfusion of the isolated lobe so that about onehalf the capillary segments were perfused, perfusion patterns with all, or nearly all, of the segments perfused or, conversely, with very few segments perfused would seem unlikely. In the developmental stages of this work, we programmed the ability to set lower and upper limits to the number of perfused segments in allowable perfusion patterns. Thus we could eliminate from consideration those apparently unlikely patterns with either very few or with nearly all segments perfused. Although the general concept of limiting the number of perfused segments in allowable patterns appeared reasonable, any particular limit was arbitrary. Furthermore, even though pressure and flow in the isolated lobe were held within narrow limits, the number of perfused segments varied a great deal from observation to observation (8). On average, about onehalf of the segments were perfused, but there were times when practically none of the segments was perfused and other times when all of the segments were perfused.
To resolve the issue of whether the number of perfused segments in allowable perfusion patterns should be limited, the following test was performed. First, we analyzed several alveoli by limiting the number of perfused segments in allowable patterns to a range of ±2 SD of the average number of perfused segments among all observations. Then we repeated the analysis but with no restrictions on the number of perfused segments. The result with no restrictions had two fewer nonrandom segments in the total 410 segments analyzed (0.4%) than when restrictions were used. The reason that the change was small comes from the probability calculation: the number of patterns in which a particular segment is perfused divided by the total number of possible patterns for the entire network. When the number of possible patterns was limited to contain a specific range of perfused segments, not only did the denominator of this fraction decrease but the numerator also decreased. Thus the probability of perfusion for each segment among the allowable perfusion patterns changed little as the number of possible patterns was constrained. Because constraints made such a small difference and because any particular limit seemed arbitrary, we decided against setting limits on the number of perfused segments in allowable patterns. Similarly, we did not eliminate possible patterns on the basis of the direction of blood flow in individual segments. We saw so many segments reverse their direction of flow that we thought it was possible for any segment to reverse flow if we looked long enough. Therefore, we decided not to exclude patterns based on the direction of flow in each segment.
Although the determination of segmentalperfusion probabilities in randomly perfused networks was the goal of developing this computer program, these probabilities can be used in a variety of ways to investigate the role of chance in the perfusion variability of complex capillary networks. We have described two possible ways these probabilities can be used: to investigate subgroups of segments within the network and to investigate segments individually.
In summary, some aspects of pulmonary microcirculatory flow patterns are orderly even during casual observation. For example, blood moves in an obvious way from arterioles toward venules. On the other hand, flow through the capillary network itself appears to the observer to be unfathomably chaotic because blood cells stream through apparently endless combinations of pathways. However, systematic observations have shown that capillary perfusion patterns are not entirely chaotic, because perfusion or nonperfusion of some capillary segments is stable over time (5, 6). The computer program described here has permitted quantitative determination of whether the observed capillaryperfusion patterns are accounted for by chance. There was clear evidence that some segments were not perfused randomly and thus were likely subjected to pressures that were either substantially above or below their opening pressures. In some instances, the stably perfused segments connected to form preferential paths across the alveolar wall. Other segments had perfusion fluctuations that were indistinguishable from random perfusion by this analysis. Perhaps these segments had opening pressures near the average perfusion pressure. Subtle hemodynamic variations occurring within the network itself could cause pressure fluctuations to just exceed and then fall below their critical opening pressure and may even have some order to them. These possibilities require further investigation.
Acknowledgments
We thank Drs. H. G. Bohlen, S. C. Hillier, T. C. Lloyd, Jr., A. C. Short, R. MaassMoreno, and C. F. Rothe for helpful criticism of the manuscript.
Footnotes

Address for reprint requests: W. W. Wagner, Jr., MS 374, Dept. of Physiology and Biophysics, Indiana Univ. School of Medicine, 635 Barnhill Dr., Indianapolis, IN 462025120.

This work was supported by Howard Hughes Medical Institute Grant 71108–503101 and by National Heart, Lung, and Blood Institute Grants HL36033 and HL47343.
 Copyright © 1997 the American Physiological Society