text:
Although the presence of macrophages in tumors has been correlated with poor prognosis, until now there was no direct observation of how macrophages are involved in hematogenous metastasis. In this study, we use multiphoton microscopy to show, for the first time, that tumor cell intravasation occurs in association with perivascular macrophages in mammary tumors. Furthermore, we show that perivascular macrophages of the mammary tumor are associated with tumor cell intravasation in the absence of local angiogenesis. These results show that the interaction between macrophages and tumor cells lying in close proximity defines a microenvironment that is directly involved in the intravasation of cancer cells in mammary tumors. [Cancer Res 2007;67(6):2649–56]

The tumor microenvironment plays a critical role in tumor growth and metastasis, and the stromal cells of the microenvironment are believed to directly affect the ability of tumor cells to metastasize (13). Macrophages in particular have been implicated in the contribution of chronic inflammation to malignancy (4), and the density of tumor-associated macrophages correlates with poor prognosis (5). It has been argued that macrophages play a direct role in the mobilization of tumor cells for metastasis (6). However, until recently, there was no direct evidence for how macrophages cause increased invasion and metastasis.

We have developed animal models that allow direct examination, by intravital multiphoton imaging, of the behavior of green fluorescent protein (GFP)-expressing carcinoma cells and stromal cells in live nondissected primary mammary tumors in vivo and the correlation of their behavior with metastatic potential (79). Intravital imaging of orthotopic rat mammary tumors has shown that increased carcinoma cell polarity and locomotion toward blood vessels correlates with increased blood burden of tumor cells and metastasis (7, 9). Further, using an in vivo invasion assay, involving the direct collection of invasive tumor cells into microneedles placed into the primary tumor, and multiphoton imaging, we have described a paracrine interaction between carcinoma cells and macrophages that functions in mammary tumors that is responsible for the migration of invasive tumor cells. This paracrine loop has been seen both in the orthotopic rat model and in transgenic mice with mammary tumors derived from the mammary epithelial–restricted expression of the polyoma middle T antigen (10). The paracrine loop signaling between macrophages and tumor cells is essential to the ability of tumor cells to invade within the primary tumor, involves epidermal growth factor (EGF) and colony-stimulating factor (CSF)-1 and their corresponding receptors (10), and is sufficient for invasion of collagen gels reconstituted with purified tumor cells and macrophages (11). This paracrine loop has been hypothesized to account for the involvement of macrophages in metastasis by mediating the migration of tumor cells to blood vessels, giving rise to increased intravasation (6, 10). However, the direct interaction of the invasive and migratory tumor cells with blood vessels has not been observed directly in live animals, and the involvement of macrophages, if any, has not been measured. In this study, we use multiphoton imaging of tumor cells during intravasation to determine if macrophages interact with tumor cells at the sites of intravasation in vivo.

Mice. All transgenic mice were crossed into a FVB-C3H/B6 mixed background and remained in a consistent background throughout breeding. Detailed origin, identification, and tumor staging of MMTV-PyMT and Csf1op/Csf1op/PyMT mice have been described previously (12, 13). Csf1op/Csf1op/PyMT mice have the same tumor growth rate but have delayed tumor progression compared with wild-type PyMT mice (12). WAP-Cre/CAG-CAT-EGFP/MMTV-PyMT (CAG-CAT-EGFP/MMTV-PyMT; ref. 14) and Lys-GFPKi and c-fms (CSF-1R)-GFP mice were described previously (15, 16). Lys-GFPKi and c-fms (CSF-1R)-GFP mice were crossed with the MMTV-PyMT mice to produce tumors with GFP-labeled macrophages. All genotyping was done by PCR. Tie2-GFP mice were described previously (17) and crossed with the MMTV-PyMT mice to produce tumors with GFP-labeled endothelial cells. Tumors, except where noted, were allowed to grow for 16 to 18 weeks before multiphoton imaging and blood withdrawal to ensure late-stage carcinomas and increased metastasis as described previously (12). Because the same mixed background was used for all controls and experiments, the background is not a variable.

Multiphoton imaging of macrophage populations and tumor cell migration. Multiphoton microscopy was done as described previously (9, 18). Animals were anesthetized with isoflurane, and a small incision was made in the skin to expose the tumor site without wounding the tumor or penetrating the peritoneum. The anesthetic was maintained while imaging. The tumor was imaged using a Bio-Rad (Carl Zeiss Micro Imaging Inc., Thornwood, NY) Radiance 2000 multiphoton microscope with an inverted Olympus (Olympus America Inc., Center Valley, PA) IX70 connected to a Spectra Physics Tsunami Ti:Sapphire laser. The animal was placed within a heated chamber maintained at 30°C so as to assure that both the core body temperature and imaging field temperature were maintained during imaging within the physiologic range of 34.3°C to 36.5°C. All images were collected using non-descanned detectors. The objectives used were a 20× Plan Apo 0.7NA (air) and a 60× LUMPlan/IR 0.9NA (water). The filters used were 480/30 nm and 515/30 nm (Chroma Technology Corp., Rockingham, VT). Primary tumors (CAG-CAT-EGFP/MMTV-PyMT, Tie2-GFP/MMTV-PyMT, MMTV-PyMT/c-fms-GFP, or MMTV-PyMT/lys-GFPKi generated) were placed on an inverted microscope and imaged at 880 nm for GFP fluorescence. CAG-CAT-EGFP/MMTV-PyMT–generated primary tumors were imaged as above, after an injection into the tail vein of 200 μL of 20 mg/mL 70,000-kDa Texas red-dextran in Dulbecco's PBS, to load macrophages by phagocytosis 2 h before imaging.

The motility of individual tumor cells was observed as described previously (9, 18, 19). In particular, cell motility was observed by time-lapse imaging over 30 min at 1-min intervals, where a z-series was collected for each frame. Then, z-series reconstructions were made using ImageJ software to delineate single tumor cells. The distance traveled and the velocity of motility were then calculated as μm/min as described previously (7).

Macrophage pixel intensity was determined by capturing z-series of CAG-CAT-EGFP/MMTV-PyMT–generated tumors labeled with Texas red-dextran, with a 20× Plan Apo 0.7NA (air) objective, in which the viewing field is 512 × 512 μm and reconstructing in ImageJ. For the 60× LUMPlan/IR 0.9NA objective, a field of view is 128 × 128 μm. Pixel intensity was measured by drawing equal size boxes on a 90° view of the z-stack and averaging the pixels for each slice. Motility of tumor cells was scored as net tumor cell centroid translocation of >20 μm over 30 min of time-lapse imaging. A tumor cell was scored as moving near a macrophage if the motility occurred within 20 μm of a macrophage. Intravasation was scored as number of events per 128 × 128 × 100 = 1.6 × 106 μm3 volume of tumor. All measurements were double blind scored.

Counts of perivascular macrophage clusters were done by injecting 200 μL of 20 mg/mL Texas red-dextran in Dulbecco's PBS into the tail vein of MMTV-PyMT and Csf1op/Csf1op/PyMT mice 2 h before imaging followed by a second injection of FITC-dextran, at the same concentration into the carotid artery to insure vessel labeling, immediately before imaging to label blood vessels. Mice were not under anesthesia for the tail vein injections but were for carotid artery injections done just before imaging. After multiphoton imaging of FITC-dextran–labeled vessels, the number of macrophages per 100 μm of vessel length in each field was counted using a double blind counter. One hundred vessels from each type of mouse were counted. Perivascular macrophage clusters were also observed in Tie2-GFP/MMTV-PyMT mice using similar methods.

Total numbers of macrophages were counted in whole tumor tissue using Texas red-dextran labeling and the counting method described by us previously (20).

Measuring the number of carcinoma cells in circulating blood. To measure the number of viable carcinoma cells in circulating blood from MMTV-PyMT and Csf1op/Csf1op/PyMT mice, animals were anesthetized with isoflurane and blood was drawn from the right ventricle of the heart using a heparin-coated 25-gauge needle and a 1-cm3 syringe. For these experiments, +/op used as “wild-type” control animals (12) were littermates of the Csf1op/Csf1op/PyMT mice. Blood was placed in a tissue culture dish containing DMEM with 10% fetal bovine serum (FBS) and incubated overnight. The next day, the dishes were rinsed with PBS and the DMEM/10% FBS was replaced. Colonies were counted after 7 days. Each colony was scored as one tumor cell from the blood. To test the effect of PD153035, 80 mg/kg PD153035 in 8% DMSO was injected i.p. (21) into MMTV-PyMT mice 1 h before blood collection. One hour after injection was chosen to have a circulating concentration of PD153035 high enough to optimally block tyrosine phosphorylation. It was shown previously that phosphorylation occurs after 3 h (21). As a control, 8% DMSO was injected into identical MMTV-PyMT mice. To test the effect of a monoclonal anti-mouse CSF-1 receptor function blocking antibody (courtesy of Dr. S. Nishikawa, Kyoto University Medical School, Kyoto, Japan; ref. 22), 2.5 μg in 150 μL PBS were injected i.p. 4 h before blood collection. As a control, the same concentration of nonimmune IgG was injected 4 h before blood collection. Experiments were done 4 h after injection because it was determined that 4 h is required for adequate equilibration of the antibody in the extracellular space and to provide a sufficient dose of circulating antibody to neutralize the CSF-1 receptor for a 2-day period (23).

Cell collection. Cell collection using the in vivo invasion assay was carried out as described previously (24, 25). For testing the chemotactic response of dextran-loaded macrophages, Texas red-dextran was injected via tail vein 2 h before cell collection in both CAG-CAT-EGFP/MMTV-PyMT and MMTV-PyMT/c-fms-GFP mice. To test the efficacy of the monoclonal anti-mouse CSF-1 receptor function blocking antibody (22), 2.5 μg in 150 μL PBS were injected i.p. 4 h before cell collection.

Isolating cells from primary tumors and fluorescence-activated cell sorting. To determine if the Texas red-dextran–labeled cells were macrophages, tumors were collected from MMTV-PyMT and MMTV-PyMT/c-fms-GFP mice and dual-label fluorescence-activated cell sorting (FACS) sorted in three different ways. To isolate the macrophages from a primary tumor, a small piece of tumor was minced and filtered twice through a nylon filter to obtain a single-cell suspension and washed with PBS. First, to determine macrophages by using macrophage markers, the cells were incubated with F4/80 primary antibody for 15 min at 37°C (26) followed by R-phycoerythrin–labeled anti-rat secondary antibody (PharMingen, San Diego, CA) 1:100 for 15 min at 37°C. FACS was done based on their GFP (c-fms-GFP) expression and coexpression of F4/80 expression in macrophages using a FACSVantage cell sorter (Becton Dickinson, San Jose, CA). For Texas red-dextran–labeled cells, mice were preinjected as described above 2 h before cell sorting. Cells from the MMTV-PyMT tumor were isolated as above and then incubated with F4/80 primary antibody for 15 min at 37°C followed by FITC-labeled anti-rat secondary antibody (1:100 for 15 min at 37°C). FACS was done based on Texas red fluorescence and coexpression of F4/80 as detected by the FITC-labeled antibody. Third, cells from a MMTV-PyMT/c-fms-GFP mouse, preinjected with Texas red-dextran, were FACS sorted based on Texas red fluorescence and on their GFP (c-fms-GFP) expression. The percentage of macrophages identified with F4/80 or c-fms-GFP that costained with Texas red-dextran was calculated as a gated population with (total cells − cells only labeled with Texas red-dextran) / total cells × 100 = 97%. To determine the degree of colocalization of the Texas red-dextran–loaded macrophages with those labeled with the F4/80 antibody, a Pearson's correlation coefficient was calculated, where each element X was a pixel value from one probe and Y was the corresponding pixel of the other probe at the same spatial location and N was the number of perimeter pixels in each annulus:

$r=\frac{{\Sigma}XY{-}\frac{{\Sigma}X{\Sigma}Y}{N}}{\sqrt{(}{\Sigma}X^{2}{-}\frac{({\Sigma}X)^{2}}{N})({\Sigma}Y^{2}{-}\frac{({\Sigma}Y)^{2}}{N})}.$

Real-time PCR. Quantitative reverse transcription-PCR (QRT-PCR) analysis was done to determine the change of expression of EGF in BAC1.2F5 cells cultured with or without 200 μg/mL Texas red-dextran (Invitrogen/Molecular Probes, Carlsbad, CA) for 2 h followed with or without 36 ng/mL CSF-1 (a gift from Chiron Corp., Emeryville, CA) for 4 h. PCR was done using the ABI 7900 (Applied Biosystems, Foster City, CA) with sequence-specific primer pairs for EGF as described before (11).

The identification of macrophages, tumor cells, and blood vessels. The mechanism by which the paracrine interaction between macrophages and carcinoma cells might contribute to intravasation in mammary tumors depends on the location of the two cell types relative to each other and to blood vessels (27). Tumor cells were identified by their expression of GFP from mammary epithelial–specific promoters as described previously (10). Macrophages were visualized using (a) i.v. injected Texas red-dextran, where tumor-associated macrophages are identified by their ability to phagocytose i.v. injected dextrans (Fig. 1A and C; Supplementary Fig. S1; ref. 28); (b) MMTV-PyMT/lys-GFPKi mice, in which the macrophages and neutrophils express GFP driven by the lys promoter (Fig. 1B,, top); and (c) c-fms (CSF-1R) promoter-driven GFP-expressing mice, in which monocytes and macrophages express GFP driven by the c-fms promoter (Fig. 1B , bottom; ref. 16, 17). FACS sorting of Texas red-dextran–loaded cells from primary tumors showed that >97% of dextran-loaded cells were positive for the macrophage-specific markers F4/80 and c-fms-GFP expression (Supplementary Fig. S2). Furthermore, correlation analysis of the FACS-sorted macrophages for F4/80 and Texas red-dextran gave a Pearson's coefficient of 0.87. FACS quantitation showed that almost all macrophages were labeled with Texas red-dextran, indicating that there is no significant population of macrophages that is not loaded with Texas red-dextran.

Figure 1.

Identification of tumor-associated macrophages in mammary tumors in live animals. A, multiphoton microscopy of Texas red-dextran–labeled macrophages (red) in living MMTV-PyMT/Tie2-GFP tumors (green endothelial cells) was done to observe the location of macrophages relative to blood vessels. Macrophages were observed in the stroma subluminal to endothelial cells lining the blood vessels in a cross-optical section. The collagen matrix (blue) is imaged by second harmonic generated polarized light. Bar, 25 μm. An en face section is shown in Supplementary Fig. S1. B, GFP-labeled macrophages (arrows) are seen in the subluminal wall of blood vessels (dashed lines define the vessel walls) present in either a Lys-GFP × MMTV-PyMT mouse (top) or a c-fms-GFP/MMTV-PyMT mouse (bottom), in which the macrophages are GFP positive and tumor cells are unlabeled and appear as black regions. Collagen matrix (blue) is imaged by second harmonic generated polarized light. C, lys-GFP–labeled macrophages that are in the subluminal stroma take up Texas red-dextran and are green and red, whereas monocytes in the blood do not and are only green. Macrophages (arrowhead) are seen outside dextran-labeled vessels (red, blood space), whereas monocytes (arrow) are seen in the blood vessel but do not take up dextran. Bottom paired insets, the same result was seen in c-fms-GFP mice. Left inset, all GFP-expressing cells (green channel only); right inset, same field (green and red channels) with a macrophage having taken up Texas red-dextran by phagocytosis 2 h after tail vein injection. The monocytes are not labeled with Texas red-dextran. Arrows, monocytes; arrowheads, macrophages. Top inset, high-magnification image of a macrophage loaded with Texas red-dextran subluminal to a vessel. Dashed lines, delineate blood vessel walls in both (C) and insets. D, dextran loading of macrophages does not affect EGF production by macrophages. QRT-PCR shows a 2-fold increase of mRNA production of EGF after CSF-1 stimulation whether the macrophages have been preloaded with dextran or not (there is no significant difference by standard t test between dextran-containing and nondextran-containing samples).

Figure 1.

Identification of tumor-associated macrophages in mammary tumors in live animals. A, multiphoton microscopy of Texas red-dextran–labeled macrophages (red) in living MMTV-PyMT/Tie2-GFP tumors (green endothelial cells) was done to observe the location of macrophages relative to blood vessels. Macrophages were observed in the stroma subluminal to endothelial cells lining the blood vessels in a cross-optical section. The collagen matrix (blue) is imaged by second harmonic generated polarized light. Bar, 25 μm. An en face section is shown in Supplementary Fig. S1. B, GFP-labeled macrophages (arrows) are seen in the subluminal wall of blood vessels (dashed lines define the vessel walls) present in either a Lys-GFP × MMTV-PyMT mouse (top) or a c-fms-GFP/MMTV-PyMT mouse (bottom), in which the macrophages are GFP positive and tumor cells are unlabeled and appear as black regions. Collagen matrix (blue) is imaged by second harmonic generated polarized light. C, lys-GFP–labeled macrophages that are in the subluminal stroma take up Texas red-dextran and are green and red, whereas monocytes in the blood do not and are only green. Macrophages (arrowhead) are seen outside dextran-labeled vessels (red, blood space), whereas monocytes (arrow) are seen in the blood vessel but do not take up dextran. Bottom paired insets, the same result was seen in c-fms-GFP mice. Left inset, all GFP-expressing cells (green channel only); right inset, same field (green and red channels) with a macrophage having taken up Texas red-dextran by phagocytosis 2 h after tail vein injection. The monocytes are not labeled with Texas red-dextran. Arrows, monocytes; arrowheads, macrophages. Top inset, high-magnification image of a macrophage loaded with Texas red-dextran subluminal to a vessel. Dashed lines, delineate blood vessel walls in both (C) and insets. D, dextran loading of macrophages does not affect EGF production by macrophages. QRT-PCR shows a 2-fold increase of mRNA production of EGF after CSF-1 stimulation whether the macrophages have been preloaded with dextran or not (there is no significant difference by standard t test between dextran-containing and nondextran-containing samples).

Close modal

In both lys-GFP and c-fms-GFP mice with MMTV/PyMT-derived tumors, cells in the blood flow within vessels were not labeled with dextran, whereas 100% of tumor stroma–associated cells were labeled with dextran (Fig. 1C). This is interesting because all GFP-expressing blood-borne cells in c-fms-GFP mice are of the monocytic lineage by staining with F4/80 antibodies (26). In lys-GFP mice, GFP-expressing blood-borne cells are monocytes and granulocytes (16). These results indicate that macrophages phagocytose dextran only when in the stroma of the primary tumor and not while flowing in the blood.

To determine if macrophages in the stroma of mammary tumors after dextran loading were still active in paracrine-mediated invasion (24), the in vivo invasion assay was used to collect invading tumor cells and macrophages from mice with MMTV-PyMT/c-fms-GFP tumors 30 min after i.v. injection of Texas red-dextran. Under these conditions, 100% of the invading macrophages accompanying tumor cells were loaded with Texas red-dextran and collected in the same numbers as from control tumors in animals not preinjected with Texas red-dextran. This indicates that the EGF/CSF-1 paracrine loop remains functional after phagocytosis of Texas red-dextran by macrophages and that macrophages throughout the volume of the primary tumor were Texas red-dextran labeled. This result was consistent with the ability of macrophages to produce EGF after CSF-1 stimulation even when dextran loaded (Fig. 1D).

To investigate the relative locations of tumor cells and macrophages to blood vessels, multiphoton microscopy of CAG-CAT-EGFP/MMTV-PyMT mice (mice with GFP-expressing tumor cells) was done as described previously (10, 14). Macrophages were identified by Texas red-dextran loading. Blood vessels were unequivocally identified using (a) i.v. injected fluorescent dextrans to label the blood space immediately before imaging (Fig. 1C), (b) light scattering from erythrocytes in blood vessels in the absence of dextrans, and (c) multiphoton imaging of mice with MMTV-PyMT/Tie2-GFP tumors in which endothelial cells express GFP from the tie2 promoter (Fig. 1A,; Supplementary Fig. S1; ref. 17). Multiphoton microscopy of mice with MMTV-PyMT/Tie2-GFP tumors in which endothelial cells express GFP from the tie2 promoter, and of macrophages labeled by their ability to phagocytose i.v. injected Texas red-dextran (28), shows that the perivascular macrophages are located adluminal within the stroma of the tumor and not luminal within the blood space of the vessel (Fig. 1A; Supplementary Fig. S1).

Interactions between macrophages, tumor cells, and blood vessels leading to intravasation in mammary tumors. Using the methods to unequivocally label all macrophages in living tumors described above, multiphoton microscopy showed that macrophages are present in large numbers at the margin of the tumor and then decreasingly throughout the stroma as one imaged deeper inside the tumor (Fig. 2A). In the center of the tumor where most of the blood vessels are located, many macrophages were found in association with blood vessels. The same distribution of macrophages was seen in histologic sections of primary tumors from identical mice, although the tumor volume was collapsed due to dehydration (Fig. 2B). The density of macrophages per unit volume of tissue decreased from the tumor margin to the deeper regions of the tumor where many perivascular macrophages were seen (Fig. 2C,, bottom). This decrease in macrophage density was not due to loss of fluorescence detection efficiency because tumors with GFP-expressing tumor cells showed excellent fluorescence intensity to the same depth of imaging as that used for macrophages (Fig. 2C). Perivascular macrophages were best imaged by multiphoton microscopy and not by conventional confocal microscopy in undissected tumors because most perivascular macrophages reside deep within the tumor beyond the depth of imaging of pinhole confocal microscopy. This same distribution pattern of macrophages was seen in tumors using all three methods described above for visualizing macrophages (Lys-GFPKi, c-fms-GFP, and fluorescent dextran phagocytosis), consistent with the results described above that all three methods detected macrophages equally well. Furthermore, the density of tumor-associated macrophages seen with Texas red-dextran labeling was the same as observed using anti-F4/80 immunohistochemistry (20).

Figurze 2.

Tumor-associated macrophages are found in the tumor margin and as a perivascular population deep within mammary tumors. A, in living undissected tumors, GFP-labeled macrophages are seen in the tumor margin (i.e., the connective tissue surrounding the tumor) and as perivascular macrophages (arrows) associated with the microvasculature (red) deep within the tumor as seen in a Lys-GFP × MMTV-PyMT mouse, in which the tumor cells are unlabeled and appear as black regions. The stroma of the tumor margin is filled with collagen fibers (light blue) as imaged by second harmonic generated polarized light by the multiphoton microscope and appears as a bright layer around the tumor (double arrowhead points to the interface between the tumor and the tumor margin). Arrowheads, macrophages found in the tumor margin are associated with this collagen layer. Bar, 25 μm. B, the same tumor morphology and macrophage density is seen in histologic section (although collapsed due to fixation and dehydration) of a late-stage carcinoma in a MMTV-PyMT/c-fms-GFP mouse. Macrophages (green) are seen at the tumor margin (arrowheads) and as perivascular macrophages (arrows). The tumor is stained with 4′,6-diamidino-2-phenylindole (blue) and the vessels are filled with Texas red-dextran (red). Asterisk, the outside edge of the tumor margin. C, macrophage density per unit area falls off rapidly from the tumor margin toward the center of the tumor. This is not due to loss of imaging efficiency because pixel intensity from the GFP-labeled tumor cells remains above 85% through the same 300 μm distance. Pixel intensities from thirty 10-μm-thick z-sections, as illustrated as a stack of images in the x-z projection at the bottom of the figure, were quantified to show differences in macrophage density. Bottom, x-z projection of thirty 10-μm-thick optical sections with the first section starting at the tumor margin (arrow, Tumor margin) and extending 300 μm deep into the undissected tumor (arrow, 300 μm deep). Single spots (asterisk) in the x-z projection are the perivascular macrophages. Bar, 100 μm. Points, mean (n = 20); bars, SE. D, perivascular macrophages (green) are seen crawling at the surface of a blood vessel (delineated by white line in left) and along matrix fibers (purple) in the stroma around the vessel in a living tumor in a MMTV-PyMT/lys-GFP mouse. Time-lapse images taken 5 min apart show the movement of macrophages (left, arrows). Right, lines, track distance traveled by macrophages over 30 min. Bar, 25 μm.

Figurze 2.

Tumor-associated macrophages are found in the tumor margin and as a perivascular population deep within mammary tumors. A, in living undissected tumors, GFP-labeled macrophages are seen in the tumor margin (i.e., the connective tissue surrounding the tumor) and as perivascular macrophages (arrows) associated with the microvasculature (red) deep within the tumor as seen in a Lys-GFP × MMTV-PyMT mouse, in which the tumor cells are unlabeled and appear as black regions. The stroma of the tumor margin is filled with collagen fibers (light blue) as imaged by second harmonic generated polarized light by the multiphoton microscope and appears as a bright layer around the tumor (double arrowhead points to the interface between the tumor and the tumor margin). Arrowheads, macrophages found in the tumor margin are associated with this collagen layer. Bar, 25 μm. B, the same tumor morphology and macrophage density is seen in histologic section (although collapsed due to fixation and dehydration) of a late-stage carcinoma in a MMTV-PyMT/c-fms-GFP mouse. Macrophages (green) are seen at the tumor margin (arrowheads) and as perivascular macrophages (arrows). The tumor is stained with 4′,6-diamidino-2-phenylindole (blue) and the vessels are filled with Texas red-dextran (red). Asterisk, the outside edge of the tumor margin. C, macrophage density per unit area falls off rapidly from the tumor margin toward the center of the tumor. This is not due to loss of imaging efficiency because pixel intensity from the GFP-labeled tumor cells remains above 85% through the same 300 μm distance. Pixel intensities from thirty 10-μm-thick z-sections, as illustrated as a stack of images in the x-z projection at the bottom of the figure, were quantified to show differences in macrophage density. Bottom, x-z projection of thirty 10-μm-thick optical sections with the first section starting at the tumor margin (arrow, Tumor margin) and extending 300 μm deep into the undissected tumor (arrow, 300 μm deep). Single spots (asterisk) in the x-z projection are the perivascular macrophages. Bar, 100 μm. Points, mean (n = 20); bars, SE. D, perivascular macrophages (green) are seen crawling at the surface of a blood vessel (delineated by white line in left) and along matrix fibers (purple) in the stroma around the vessel in a living tumor in a MMTV-PyMT/lys-GFP mouse. Time-lapse images taken 5 min apart show the movement of macrophages (left, arrows). Right, lines, track distance traveled by macrophages over 30 min. Bar, 25 μm.

Close modal

High-resolution imaging of perivascular macrophages showed that they are associated with vessels both as single motile macrophages (Fig. 2D) and as clusters (Figs. 3C and 4A). Macrophage clusters have been described previously in invasive regions of human tumors (29, 30). To determine the average number of macrophages in each perivascular cluster seen in the animal models used here, z-series images were projected in stereo (data not shown) to count the number of macrophages in each perivascular-associated GFP-positive or Texas red-dextran–positive region. The results indicate that perivascular macrophages can be found as individual cells and as clusters, where each cluster contains an average of 3 ± 0.5 macrophages (SE; n = 40).

Figure 3.

Tumor cell motility occurs most frequently in association with perivascular macrophages. A, tumor cells were seen to move most frequently in association with macrophages in both the tumor margin and the perivascular region. Tumor cell movement was scored to be in association with a macrophage when it occurred within 20 μm (one cell diameter) of a macrophage. Movements of tumor cells in both the tumor margin and perivascular regions = all tumor cells. Movement in association with perivascular macrophages = tumor cells in perivascular region. Columns, mean (n = 12 animals, 28 z-series); bars, SE. *, P = 0.0036; **, P = 0.0002, comparing near and not near. B, although the absolute number of tumor cells moving at the tumor margin was greater, as shown in left, a higher frequency of tumor cell movement was observed in association with perivascular macrophages when movement was normalized to the number of macrophages per unit area (right). Numbers were obtained by counting cell movements and the number of macrophages for volumes in the tumor margin of 512 × 512 × 60 μm and for identical volumes in the region of tumor containing the microvasculature. *, P = 0.0018; **, P = 0.0064, comparing tumor margin and perivascular. C, images from a 30-min time-lapse sequence, taken at 6-min intervals, of four GFP-labeled tumor cells (green) in a PyMT-generated mammary tumor CAG-CAT-EGFP/MMTV-PyMT in a living animal moving in association with a macrophage cluster containing two macrophages (red) near a vessel. The tumor cells move at a rate of 4.2 μm/min over the course of the 30-min time-lapse. Tumor cell motility is defined in Materials and Methods. Bottom drawing, outline of the tumor cells (white outlines) as they move toward the macrophages (filled). Bar, 25 μm.

Figure 3.

Tumor cell motility occurs most frequently in association with perivascular macrophages. A, tumor cells were seen to move most frequently in association with macrophages in both the tumor margin and the perivascular region. Tumor cell movement was scored to be in association with a macrophage when it occurred within 20 μm (one cell diameter) of a macrophage. Movements of tumor cells in both the tumor margin and perivascular regions = all tumor cells. Movement in association with perivascular macrophages = tumor cells in perivascular region. Columns, mean (n = 12 animals, 28 z-series); bars, SE. *, P = 0.0036; **, P = 0.0002, comparing near and not near. B, although the absolute number of tumor cells moving at the tumor margin was greater, as shown in left, a higher frequency of tumor cell movement was observed in association with perivascular macrophages when movement was normalized to the number of macrophages per unit area (right). Numbers were obtained by counting cell movements and the number of macrophages for volumes in the tumor margin of 512 × 512 × 60 μm and for identical volumes in the region of tumor containing the microvasculature. *, P = 0.0018; **, P = 0.0064, comparing tumor margin and perivascular. C, images from a 30-min time-lapse sequence, taken at 6-min intervals, of four GFP-labeled tumor cells (green) in a PyMT-generated mammary tumor CAG-CAT-EGFP/MMTV-PyMT in a living animal moving in association with a macrophage cluster containing two macrophages (red) near a vessel. The tumor cells move at a rate of 4.2 μm/min over the course of the 30-min time-lapse. Tumor cell motility is defined in Materials and Methods. Bottom drawing, outline of the tumor cells (white outlines) as they move toward the macrophages (filled). Bar, 25 μm.

Close modal
Figure 4.

Perivascular macrophages are sites of EGF-dependent and CSF-1–dependent intravasation in PyMT mammary tumors. A, image from a z-series time-lapse sequence taken at 8-min intervals of a cell entering a vessel in association with a macrophage. Left, subluminal macrophage (ϕ) in the first frame of the time-lapse movie 10 μm below the plane of focus of the other panels; middle left, a different plane of focus at the same time frame as the left. Middle left, middle right, and right, same plane of focus and the movement of tumor cells into the vessel. Line, vessel wall; arrow, point of intravasation of tumor cells. ϕ, position of the macrophage in the first frame. By the last frame, the macrophage (ϕ), which started out 10 μm below the plane of focus, has moved into the same plane as the intravasating tumor cells. This indicates that both tumor cells and macrophages are motile at the vessel surface. Bar, 25 μm. B, more perivascular macrophages are seen along blood vessels in +/op wild-type (WT)-like PyMT mouse mammary tumors than in Csf1op/Csf1op × PyMT mammary tumors. Macrophages were labeled by injection of Texas red-dextran and then counted along vessels. Macrophage density was >6-fold higher in +/op/PyMT mouse mammary tumors than in Csf1op/Csf1op × PyMT mammary tumors. *, P = 0.0003. C, a and b, the number of viable tumor cells in the blood exiting the primary tumor (blood burden) is greatly reduced in Csf1op/Csf1op × PyMT tumor-bearing mice (b) compared with +/op/PyMT mice (a). *, P = 0.0002 (n = 8). c and d, in addition, the blood burden is greatly reduced 1 h after the injection of 80 mg/kg PD153035 in wild-type mice (d), which inhibits the activity of the EGF receptor (n = 8). c, control mice injected with 8% DMSO. **, P = 0.0005. e and f, the blood burden also is greatly reduced 4 h after the injection of anti-CSF-1 receptor function blocking antibody (2.5 mg/mL) in wild-type mice (f; n = 6). e, wild-type mice i.p. injected with nonimmune IgG. ***, P = 0.0002. D, on normalizing the numbers of cells collected from the blood to the vascular density of late-stage carcinoma tumors from +/op/PyMT mice compared with Csf1op/Csf1op × PyMT mice, there is a 4-fold difference in the number of cells collected. *, P = 0.002.

Figure 4.

Perivascular macrophages are sites of EGF-dependent and CSF-1–dependent intravasation in PyMT mammary tumors. A, image from a z-series time-lapse sequence taken at 8-min intervals of a cell entering a vessel in association with a macrophage. Left, subluminal macrophage (ϕ) in the first frame of the time-lapse movie 10 μm below the plane of focus of the other panels; middle left, a different plane of focus at the same time frame as the left. Middle left, middle right, and right, same plane of focus and the movement of tumor cells into the vessel. Line, vessel wall; arrow, point of intravasation of tumor cells. ϕ, position of the macrophage in the first frame. By the last frame, the macrophage (ϕ), which started out 10 μm below the plane of focus, has moved into the same plane as the intravasating tumor cells. This indicates that both tumor cells and macrophages are motile at the vessel surface. Bar, 25 μm. B, more perivascular macrophages are seen along blood vessels in +/op wild-type (WT)-like PyMT mouse mammary tumors than in Csf1op/Csf1op × PyMT mammary tumors. Macrophages were labeled by injection of Texas red-dextran and then counted along vessels. Macrophage density was >6-fold higher in +/op/PyMT mouse mammary tumors than in Csf1op/Csf1op × PyMT mammary tumors. *, P = 0.0003. C, a and b, the number of viable tumor cells in the blood exiting the primary tumor (blood burden) is greatly reduced in Csf1op/Csf1op × PyMT tumor-bearing mice (b) compared with +/op/PyMT mice (a). *, P = 0.0002 (n = 8). c and d, in addition, the blood burden is greatly reduced 1 h after the injection of 80 mg/kg PD153035 in wild-type mice (d), which inhibits the activity of the EGF receptor (n = 8). c, control mice injected with 8% DMSO. **, P = 0.0005. e and f, the blood burden also is greatly reduced 4 h after the injection of anti-CSF-1 receptor function blocking antibody (2.5 mg/mL) in wild-type mice (f; n = 6). e, wild-type mice i.p. injected with nonimmune IgG. ***, P = 0.0002. D, on normalizing the numbers of cells collected from the blood to the vascular density of late-stage carcinoma tumors from +/op/PyMT mice compared with Csf1op/Csf1op × PyMT mice, there is a 4-fold difference in the number of cells collected. *, P = 0.002.

Close modal

In the PyMT tumors, the motility of individual tumor cells was imaged as described previously (18, 19). Using these methods in PyMT tumors, the motility of tumor cells was observed to occur >80% of the time near macrophages, at the tumor margin, deep within the primary tumor and in association with perivascular macrophages (Fig. 3A), consistent with the paracrine interaction between the two cell types reported previously to induce cell motility (10). The absolute number of tumor cell motility events observed per hour is greater at the tumor margin compared with the perivascular region, but when the frequency of tumor cell motility is normalized to macrophage density, tumor cell motility is much more frequent adjacent to perivascular macrophages (Fig. 3B). Tumor cells were seen migrating directly toward macrophages (Fig. 3C,, bottom; Supplementary Movie 1). Tumor cell speed during motility associated with perivascular macrophages was 3.9 ± 0.28 μm/min (SE; n = 20 cells from eight different animals). The migration of tumor cells directly toward macrophages is an interesting observation because, although tumor cell motility at the tumor margin is believed to be related to invasion of the primary tumor mass into normal tissue, tumor cell motility associated with perivascular macrophages is correlated with intravasation (Figs. 3C and 4).

To determine if perivascular macrophages are the sites of intravasation of tumor cells in PyMT tumors, mice with GFP-expressing tumor cells were i.v. injected with Texas red-dextran to label macrophages and then time-lapse imaged to observe if the intravasation of GFP-expressing tumor cells is either near or distant from the perivascular macrophages. A 1.6 × 106–μm3 volume of tumor containing a blood vessel and at least one macrophage was selected at random and time-lapse imaged for 30 min to score intravasation. Time-lapse imaging showed that tumor cells migrate toward the vessel-associated macrophages and become closely associated with the vessel surface (Fig. 3C; Supplementary Movie 1). In addition, tumor cells were seen to intravasate only where perivascular macrophages were present (Supplementary Fig. S3 and Fig. 4A; Supplementary Movies 2 and 3). The intravasation events scored live by time-lapse imaging (18 events in 96 volumes in 19 animals) always occurred within 20 μm of a macrophage (Supplementary Movie 4 shows the intravasation and disappearance of tumor cells as they are swept away in the blood flow). z-series analysis of the site of intravasation confirmed the presence of a macrophage above or below the plane of imaging even if not seen in the same plane of focus as the tumor cell, indicating that in all cases a macrophage was within one cell diameter of the intravasating tumor cell.

To determine if intravasation efficiency is related to the density of perivascular macrophages, Csf1op/Csf1op/PyMT mice defective in CSF-1 production were used. These mice show tumor growth like wild-type and +/op animals but slower tumor progression and decreased invasion and metastasis consistent with the requirement for CSF-1 signaling for invasion and metastasis and the observed lower densities of tumor-associated macrophages in Csf1op/Csf1op/PyMT mammary tumors (20, 31). Therefore, we investigated the relative number of perivascular macrophages in +/op MMTV-PyMT and Csf1op/Csf1op/PyMT tumors in animals from the same litter and found that the +/op/PyMT tumors had more than six times as many perivascular macrophages per 100 μm length of blood vessel (Fig. 4B). To determine if intravasation efficiency is correlated with the number of perivascular macrophages, the number of viable tumor cells circulating in the blood was determined by drawing blood from the right ventricle of the heart directly downstream from the mammary tumor, thereby avoiding intervening capillary beds that might trap tumor cells. The results show that +/op/PyMT mice with 6-fold more perivascular macrophages had 16-fold more viable tumor cells per mL of blood than Csf1op/Csf1op/PyMT mice with few perivascular macrophages (Fig. 4B, and C, columns a and b). To compensate for differences in vascular density between the +/op/PyMT and Csf1op/Csf1op/PyMT mice, the numbers of cells collected from the blood were normalized to the vessel density of primary tumors from wild-type and Csf1op/Csf1op mice (Fig. 4D; ref. 20). The number of tumor cells in the blood of Csf1op/Csf1op animals remained significantly reduced compared with that in +/op animals when the data were normalized to vessel density (Fig. 4D). These results indicate that it is the number of perivascular macrophages and not the number of blood vessels that correlates with intravasation.

In previous studies using an in vivo invasion assay, a paracrine loop was identified between carcinoma cells and macrophages, where tumor cell EGF receptors and macrophage CSF-1 receptors are signaled by macrophage-produced EGF and tumor cell–produced CSF-1, respectively, leading to chemotaxis-mediated comigration and invasion of both cell types (10). To test the hypothesis that this paracrine signaling loop, involving EGF and CSF-1 receptors, is involved during the intravasation of carcinoma cells at perivascular macrophage clusters, EGF receptor activity was inhibited by i.p. injection of 80 mg/kg PD153035, an erbB1 and erbB2 receptor tyrosine kinase inhibitor. This concentration of PD153035 correlates to 15 μmol/L in the blood plasma after 1 h (21). One hour after injection of PD153035, the number of tumor cells exiting the primary tumor in the blood dropped by 5-fold in MMTV-PyMT mice treated with PD153035 compared with controls mock injected with buffer (Fig. 4C , columns c and d).

To determine if the CSF-1 receptor activity is also essential for intravasation, we injected i.p. 2.5 mg/mL of monoclonal antibody that is function blocking for CSF-1 receptor activity (22). Four hours after i.p. injection, the time of peak inhibition of receptor activity (23), the number of tumor cells found in the blood was 6-fold less than MMTV-PYMT mice injected with nonimmune IgG (Fig. 4C , columns e and f).

To confirm that the antibody blocked the paracrine loop described previously (10), the in vivo invasion assay was done 4 h after i.p. injection into 18-week-old PyMT × c-fms-GFP tumor-bearing mice. The number of collected cells per needle (tumor cells plus macrophages) from needles containing 25 nmol/L EGF was ∼1,000 total cells on average (75% tumor cells and 25% macrophages) from mice with control antibodies but reduced to 127 ± 48 total cells (3% macrophages) from mice injected with CSF-1 receptor function blocking antibody. These numbers are very similar to what was seen when the same antibody was placed in the needle during the invasion assay (10), showing the inhibition of CSF-1-receptor activity in the tumor following i.p. injection of the function blocking antibody as used in the current study.

In total, these experiments show that intravasation follows the same pattern of dependence on macrophages (Fig. 4B), and EGF and CFS-1 signaling (Fig. 4C and D), as does the paracrine loop-dependent collection of invasive tumor cells in the in vivo invasion assay (10). These results are consistent with previous work showing a correlation between the accumulation of polarized (chemotactic) tumor cells around blood vessels, intravasation and metastasis (7), and the loss of metastatic potential in the absence of tumor-associated macrophages (12).

The role of cell-cell interactions in defining the microenvironment for tumor progression and metastasis has been studied extensively (32). In this regard, macrophages have been hypothesized to play roles in both tumor rejection and increased malignancy (6, 27, 3335). Part of the reason for this apparent paradox is the lack of direct observations about the behavior and interactions of macrophages with tumor cells in vivo that can lead to a mechanistic understanding of the macrophage contribution to malignancy. The new insight resulting from the direct observation of macrophages and their interactions with tumor cells in vivo described here is that almost all tumor cell migration and intravasation occur in association with macrophages.

Tumor-associated macrophages have been shown to form clusters in the intratumoral region, and these macrophage dense “hotspots” are correlated with angiogenesis and found to have increased levels of vascular endothelial growth factor (29, 30). However, other groups have reported that the accumulation of macrophages invading carcinomas does not correlate with microvessel density, suggesting that the association of macrophages with blood vessels may contribute to malignancy independently of angiogenesis (36). Here, we describe for the first time that perivascular macrophages of the mammary tumor are associated with tumor cell intravasation in the absence of local angiogenesis.

Previous studies have identified macrophages as a source of EGF, which is chemotactic for tumor cells in mammary tumors in vivo (10, 24) and in vitro (11, 37). The fact that macrophages are a source of EGF probably explains why tumor cells are polarized toward blood vessels in mammary tumors (9) because these vessels have perivascular macrophages as shown in this study. The involvement of chemotaxis in macrophage-associated tumor cell migration and intravasation is consistent with the gene expression patterns of the invasive population of tumor cells (the invasion signature) collected from mammary tumors as they comigrate with macrophages (38). The “invasion signature” implicates signaling pathways involved in chemotaxis of carcinoma cells (37, 39, 40), consistent with the chemotactic behavior of tumor cells adjacent to macrophages observed in vivo in this study and previously in vitro (11).

Our results show that the perivascular macrophages of mammary tumors are specifically involved in intravasation. An understanding of how the perivascular macrophage population arises, its relationship to the general population of tissue associated macrophages, and how the interaction of perivascular macrophages with endothelial cells affects vessel integrity and transendothelial migration of tumor cells will be essential in targeting intravasation selectively.

Note: Supplementary data for this article are available at Cancer Research Online (http://cancerres.aacrjournals.org/).

Grant support: CA100324.

The costs of publication of this article were defrayed in part by the payment of page charges. This article must therefore be hereby marked advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate this fact.

We thank the laboratory members and the members of the Gruss Lipper Center for Biophotonics for their contributions to the work discussed in this article.

1
Hendrix MJ, Seftor EA, Kirschmann DA, Seftor RE. Molecular biology of breast cancer metastasis. Molecular expression of vascular markers by aggressive breast cancer cells.
Breast Cancer Res
2000
;
2
:
417
–22.
2
Liotta LA, Kohn EC. The microenvironment of the tumour-host interface.
Nature
2001
;
411
:
375
–9.
3
Radisky D, Hagios C, Bissell MJ. Tumors are unique organs defined by abnormal signaling and context.
Semin Cancer Biol
2001
;
11
:
87
–95.
4
Balkwill F, Charles KA, Mantovani A. Smoldering and polarized inflammation in the initiation and promotion of malignant disease.
Cancer Cell
2005
;
7
:
211
–7.
5
Bingle L, Brown NJ, Lewis CE. The role of tumour-associated macrophages in tumour progression: implications for new anticancer therapies.
J Pathol
2002
;
196
:
254
–65.
6
Condeelis J, Pollard JW. Macrophages: obligate partners for tumor cell migration, invasion, and metastasis.
Cell
2006
;
124
:
263
–6.
7
Wyckoff JB, Jones JG, Condeelis JS, Segall JE. A critical step in metastasis: in vivo analysis of intravasation at the primary tumor.
Cancer Res
2000
;
60
:
2504
–11.
8
Farina KL, Wyckoff JB, Rivera J, et al. Cell motility of tumor cells visualized in living intact primary tumors using green fluorescent protein.
Cancer Res
1998
;
58
:
2528
–32.
9
Wang W, Wyckoff JB, Frohlich VC, et al. Single cell behavior in metastatic primary mammary tumors correlated with gene expression patterns revealed by molecular profiling.
Cancer Res
2002
;
62
:
6278
–88.
10
Wyckoff J, Wang W, Lin E, et al. A paracrine loop between tumor cells and macrophages is required for tumor cell migration in mammary tumors.
Cancer Res
2004
;
64
:
7022
–9.
11
Goswami S, Sahai E, Wyckoff J, et al. Macrophages promote the invasion of carcinoma cells in vitro via a paracrine loop.
Cancer Res
2005
;
65
:
5278
–83.
12
Lin EY, Nguyen AV, Russell RG, Pollard JW. Colony-stimulating factor 1 promotes progression of mammary tumors to malignancy.
J Exp Med
2001
;
193
:
727
–40.
13
Guy CT, Cardiff RD, Muller WJ. Induction of mammary tumors by expression of polyomavirus middle T oncogene: a transgenic mouse model for metastatic disease.
Mol Cell Biol
1992
;
12
:
954
–61.
14
Ahmed F, Wyckoff J, Lin EY, et al. GFP expression in the mammary gland for imaging of mammary tumor cells in transgenic mice.
Cancer Res
2002
;
62
:
7166
–9.
15
Faust N, Varas F, Kelly LM, Heck S, Graf T. Insertion of enhanced green fluorescent protein into the lysozyme gene creates mice with green fluorescent granulocytes and macrophages.
Blood
2000
;
96
:
719
–26.
16
Sasmono RT, Oceandy D, Pollard JW, et al. A macrophage colony-stimulating factor receptor-green fluorescent protein transgene is expressed throughout the mononuclear phagocyte system of the mouse.
Blood
2003
;
101
:
1155
–63.
17
Motoike T, Loughna S, Perens E, et al. Universal GFP reporter for the study of vascular development.
Genesis
2000
;
28
:
75
–81.
18
Wyckoff J, Segall J, Condeelis J. Single cell imaging in animal tumors in vivo. In: Goldman RD, editor. Live cell imaging: a laboratory manual. Cold Spring Harbor (NY): CSHL Press; 2004. p. 409–31.
19
Condeelis J, Segall JE. Intravital imaging of cell movement in tumours.
Nat Rev Cancer
2003
;
3
:
921
–30.
20
Lin EY, Li J, Gnatovskiy L, et al. Macrophages regulate the angiogenic switch in a mouse model of breast cancer.
Cancer Res
2006
;
66
:
11238
–46.
21
Kunkel MW, Hook KE, Howard CT, et al. Inhibition of the epidermal growth factor receptor tyrosine kinase by PD153035 in human A431 tumors in athymic nude mice.
Invest New Drugs
1996
;
13
:
295
–302.
22
Sudo T, Nishikawa S, Ogawa M, et al. Functional hierarchy of c-kit and c-fms in intramarrow production of CFU-M.
Oncogene
1995
;
11
:
2469
–76.
23
Murayama T, Yokode M, Kataoka H, et al. Intraperitoneal administration of anti-c-fms monoclonal antibody prevents initial events of atherogenesis but does not reduce the size of advanced lesions in apolipoprotein E-deficient mice.
Circulation
1999
;
99
:
1740
–6.
24
Wyckoff JB, Segall JE, Condeelis JS. The collection of the motile population of cells from a living tumor.
Cancer Res
2000
;
60
:
5401
–4.
25
Wang W, Wyckoff JB, Wang Y, Bottinger EP, Segall JE, Condeelis JS. Gene expression analysis on small numbers of invasive cells collected by chemotaxis from primary mammary tumors of the mouse.
BMC Biotechnol
2003
;
3
:
13
–25.
26
Austyn JM, Gordon S. F4/80, a monoclonal antibody directed specifically against the mouse macrophage.
Eur J Immunol
1981
;
11
:
805
–15.
27
Leek RD, Harris AL. Tumor-associated macrophages in breast cancer.
J Mammary Gland Biol Neoplasia
2002
;
7
:
177
–89.
28
Dilov P, Dzhurov A. [Histochemical tracing of the iron in the body of piglets injected with an iron-dextran preparation].
Vet Med Nauki
1975
;
12
:
70
–7.
29
Goede V, Brogelli L, Ziche M, Augustin HG. Induction of inflammatory angiogenesis by monocyte chemoattractant protein-1.
Int J Cancer
1999
;
82
:
765
–70.
30
Salvesen HB, Akslen LA. Significance of tumour-associated macrophages, vascular endothelial growth factor and thrombospondin-1 expression for tumour angiogenesis and prognosis in endometrial carcinomas.
Int J Cancer
1999
;
84
:
538
–43.
31
Lin EY, Gouon-Evans V, Nguyen AV, Pollard JW. The macrophage growth factor CSF-1 in mammary gland development and tumor progression.
J Mammary Gland Biol Neoplasia
2002
;
7
:
147
–62.
32
Chung LW, Baseman A, Assikis V, Zhau HE. Molecular insights into prostate cancer progression: the missing link of tumor microenvironment.
J Urol
2005
;
173
:
10
–20.
33
O'Sullivan C, Lewis CE, Harris AL, McGee JO. Secretion of epidermal growth factor by macrophages associated with breast carcinoma.
Lancet
1993
;
342
:
148
–9.
34
Balkwill F, Mantovani A. Inflammation and cancer: back to Virchow?
Lancet
2001
;
357
:
539
–45.
35
Lin EY, Jones JG, Li P, et al. Progression to malignancy in the polyoma middle T oncoprotein mouse breast cancer model provides a reliable model for human diseases.
Am J Pathol
2003
;
163
:
2113
–26.
36
Davidson B, Goldberg I, Gotlieb WH, et al. Macrophage infiltration and angiogenesis in cervical squamous cell carcinoma—clinicopathologic correlation.
Acta Obstet Gynecol Scand
1999
;
78
:
240
–4.
37
Mouneimne G, Soon L, DesMarais V, et al. Phospholipase C and cofilin are required for carcinoma cell directionality in response to EGF stimulation.
J Cell Biol
2004
;
166
:
697
–708.
38
Wang W, Goswami S, Sahai E, Wyckoff J, Segall J, Condeelis J. Tumor cells caught in the act of invading: how they revealed their strategy for enhanced cell motility.
Trends Cell Biol
2005
;
15
:
138
–45.
39
Ghosh M, Song X, Mouneimne G, Sidani M, Lawrence DS, Condeelis JS. Cofilin promotes actin polymerization and defines the direction of cell motility.
Science
2004
;
304
:
743
–6.
40
Wang W, Goswami S, Lapidus K, et al. Identification and testing of a gene expression signature of invasive carcinoma cells within primary mammary tumors.
Cancer Res
2004
;
64
:
8585
–94.


text:
<meta http-equiv="refresh" content="1; url=/nojavascript/"> Square Roots and Irrational Numbers ( Read ) | Algebra | CK-12 Foundation
You are viewing an older version of this Concept. Go to the latest version.

# Square Roots and Irrational Numbers

%
Best Score
Practice Square Roots and Irrational Numbers
Best Score
%

# Square Roots and Irrational Numbers

Suppose an elementary school has a square playground with an area of 3000 square feet. Could you find the width of the playground? Would the width be a rational or irrational number? In this Concept, you'll learn how to take the square root of a number and decide whether the result is rational or irrational so that you can answer questions such as these.

### Guidance

Human chess is a variation of chess, often played at Renaissance fairs, in which people take on the roles of the various pieces on a chessboard. The chessboard is played on a square plot of land that measures 324 square meters with the chess squares marked on the grass. How long is each side of the chessboard?

To answer this question, you will need to know how to find the square root of a number.

The square root of a number $n$ is any number $s$ such that $s^2 = n$ .

Every positive number has two square roots, the positive and the negative. The symbol used to represent the square root is $\sqrt{x}$ . It is assumed that this is the positive square root of $x$ . To show both the positive and negative values, you can use the symbol $\pm$ , read “plus or minus.”

For example:

$\sqrt{81}=9$ means the positive square root of 81.

$-\sqrt{81}= -9$ means the negative square root of 81.

$\pm \sqrt{81} = \pm 9$ means the positive or negative square root of 81.

#### Example A

The human chessboard measures 324 square meters. How long is one side of the square?

Solution: The area of a square is $s^2 = Area$ . The value of Area can be replaced with 324.

$s^2=324$

The value of $s$ represents the square root of 324.

$s= \sqrt{324}=18$

The chessboard is 18 meters long by 18 meters wide.

Approximating Square Roots

When the square root of a number is a whole number, this number is called a perfect square. 9 is a perfect square because $\sqrt{9}=3$ .

Not all square roots are whole numbers. Many square roots are irrational numbers, meaning there is no rational number equivalent. For example, 2 is the square root of 4 because $2 \times 2 = 4$ . The number 7 is the square root of 49 because $7 \times 7 = 49$ . What is the square root of 5?

There is no whole number multiplied by itself that equals five, so $\sqrt{5}$ is not a whole number. To find the value of $\sqrt{5}$ , we can use estimation.

To estimate the square root of a number, look for the perfect integers less than and greater than the value, and then estimate the decimal.

#### Example B

Estimate $\sqrt{5}$ .

Solution: The perfect square below 5 is 4 and the perfect square above 5 is 9. Therefore, $4<5<9$ . Therefore, $\sqrt{5}$ is between $\sqrt{4}$ and $\sqrt{9}$ , or $2< \sqrt{5}<3$ . Because 5 is closer to 4 than 9, the decimal is a low value: $\sqrt{5} \approx 2.2$ .

Identifying Irrational Numbers

Recall the number hierarchy from a previous Concept. Real numbers have two categories: rational and irrational. If a value is not a perfect square, then it is considered an irrational number. These numbers cannot be written as a fraction because the decimal does not end (non-terminating) and does not repeat a pattern (non-repeating) . Although irrational square roots cannot be written as fractions, we can still write them exactly , without typing the value into a calculator.

For example, suppose you do not have a calculator and you need to find $\sqrt{18}$ . You know there is no whole number squared that equals 18, so $\sqrt{18}$ is an irrational number. The value is between $\sqrt{16}=4$ and $\sqrt{25}=5$ . However, we need to find the exact value of $\sqrt{18}$ .

Begin by writing the prime factorization of $\sqrt{18}$ . $\sqrt{18} = \sqrt{9 \times 2}= \sqrt{9} \times \sqrt{2}$ . $\sqrt{9} = 3$ but $\sqrt{2}$ does not have a whole number value. Therefore, the exact value of $\sqrt{18}$ is $3 \sqrt{2}$ .

You can check your answer on a calculator by finding the decimal approximation for each square root.

#### Example C

Find the exact value of $\sqrt{75}$ .

Solution:

$\sqrt{75} = \sqrt{25 \times 3} = \sqrt{25} \times \sqrt{3} = 5 \sqrt{3}$

### Guided Practice

The area of a square is 50 square feet. What are the lengths of its sides?

Solution:

We know that the formula for the area of a square is $a=s^2.$ Using this formula:

$& a=s^2\\&50=s^2\\&\sqrt{50}=\sqrt{s^2}\\&\sqrt{50}=s$

Now we will simplify:

$\sqrt{50}=\sqrt{25\cdot 2}=5\sqrt{2}.$

The length of each side of the square is $5\sqrt{2}$ feet.

### Practice

Find the following square roots exactly without using a calculator . Give your answer in the simplest form.

1. $\sqrt{25}$
2. $\sqrt{24}$
3. $\sqrt{20}$
4. $\sqrt{200}$
5. $\sqrt{2000}$
6. $\sqrt{\frac{1}{4}}$
7. $\sqrt{\frac{9}{4}}$
8. $\sqrt{0.16}$
9. $\sqrt{0.1}$
10. $\sqrt{0.01}$

Use a calculator to find the following square roots. Round to two decimal places.

1. $\sqrt{13}$
2. $\sqrt{99}$
3. $\sqrt{123}$
4. $\sqrt{2}$
5. $\sqrt{2000}$
6. $\sqrt{0.25}$
7. $\sqrt{1.35}$
8. $\sqrt{0.37}$
9. $\sqrt{0.7}$
10. $\sqrt{0.01}$

format: plain


text:
When and why is bwa aln better then bwa mem?
1
14
Entering edit mode
7.8 years ago

Hi- As the post title says: When and why one should prefer bwa aln over bwa mem?

The bwa docs say that bwa mem is preferable for longer reads ( > 70 bp). But what is the disadvantage of using bwa mem for shorter reads?

Part of the reason I'm asking is that I have a variety of libraries of read lengths from ~40-70 bp to 150 bp, after quality and adapter trimming, mostly paired-end. I'd rather use one tool for all the read lengths to keep things consistent and bwa mem seems the best choice, unless there is some good reason to avoid it for reads between ~40 and 70 bp.

I have the impression (not tested) that bwa mem is much slower than bwa aln on shorter reads, but that's not an issue for me.

Thanks
Dario

aln comparison bwa mem • 39k views
0
Entering edit mode

Hi, I am facing a similar problem.

I have 38bp paired-end ChIP-seq data. Should I use bwa aln or bwa mem?

Thanks,
Ming

1
Entering edit mode

answer my own question. I tested using teaser http://teaser.cibiv.univie.ac.at/reports/8dc974f7ce99f6958012619c052e5597/index.html#section4 and bwa aln seems to be a little better than bwa mem for 36bp short single end reads.

21
Entering edit mode
7.8 years ago

There is the paper that you should read: http://arxiv.org/abs/1303.3997

But beyond that here is a more practical comparison

We are running a test in a lecture that focuses on alignment performance. For that we have generated 20,000 reads from the Ebola genome with pretty high (10%) sequencing error rates. Then ran bowtie2, bwa aln and bwa mem and attempted to align the reads back to the genome. The mapping rates were:

• bowtie2: 30%
• bwa aln: 25%
• bwa mem: 85%

Of course each of these mapping rates are for default settings that can be changed (see comments down) - but that's where we always start. From those it looks like bwa mem goes a step further and will find alignments where other methods have already given up.

2
Entering edit mode

Hi Istvan, thanks for reply. However I think you misunderstood my question... From the bwa mem paper, the documentation, and your benchmark it appears that bwa mem is always preferable to bwa aln, especially for longer reads. What I'm asking is: When is bwa aln a better choice over bwa mem? Can we forget about bwa aln altogether and just use bwa mem?

4
Entering edit mode

the way I see it my test shows is that bwa mem is far more robust to errors than any other aligner. Length of the reads don't factor into this. Come to think of it these were on the short side 70bp - what wgsim generated by default.

There might be reasons to use aln but I look at it as a prior step that was necessary to get to the new method but in general little reason to keep using it.

In fact the problems caused by misalignment are far more insidious than simply losing some data. Ok so you only get 50% rather than 80% - but no! the reality is far more troubling than that and probably warrants a separate post itself.

An aligner's failure to map a read is not random! What this means is that there is a bias to certain type of errors occurring in certain parts of the genome/reads. SNP calling on the default alignment with bowtie2 generates a large number of seemingly reliably called snps that do are not actully true (since we know what the wgsim simulated genome is). There is a bias towards certain types of errors which makes them look like real signal.

To me this was eye opening - the inability to align is not just data loss - we need to realize that - it may also introduce substantial biases that are then impossible to correct later.

0
Entering edit mode

"Length of the reads don't factor into this" That's what I thought as well... The way the mem docs are written suggested to me that <70bp are not recommendable for bwa mem, hence my post.

0
Entering edit mode

Did you try local alignment with bowtie2 (just add --very-sensitive-local)? That's usually the cause of big differences between bwa mem and bowtie2 like you found, though I think bwa mem generally does local alignment better than bowtie2 anyway.

0
Entering edit mode

Making bowtie2 work better for this particular case was a homework due this week and worth 10 extra bonus points. I have not corrected these so I do not know the answer yet :-)

Myself I tried --very-sensitive and that only partially improved to 63% I just ran --very-sensitive-local and that too has about the same 63% much better than the original but still well below bwa mem.

5
Entering edit mode

I have been educated with my students homework. Relaxing the seed mismatches to -N 1 has a substantial effect in this case. Combining that with the parameters that represent the --very-sensitive-local option leads to a bowtie2 mapping rate of 91% Best performing parameter settings:

-D 20 -R 3 -N 1 -L 20

0
Entering edit mode

Those are the same settings needed to make bison, which uses bowtie2 internally, perform the same as bwa-meth, which uses bwa mem internally, on an untrimmed dataset, so that makes sense.


text:
# How do you determine the order of the matrix [(-3, 7, 15, 0), (0, 0, 3, 3), (1, 1, 6, 7)]?

$3 \times 4$
Order of the matrix = (No. of rows)$\times$(No. of columns) = $3 \times 4$


text:
# The Wolfram atom¶

Here we show how we get to the converged ground state of the Wolfram atom (Z=74). It is the open-shell system with four unpaired electrons in the 5d shell:

W: [Xe] 4f(14) 5d(4) 6s(2)

In the following tutorial, for simplicity, we use the two-component Hamiltonian (.X2C) and the smallest available basis set by K.Dyall, v2z. Due to the covnergence problem of the standalone AMFI atomic SCF code we keep the +4 charge (.AMFICH) of W for mean-field orbitals.

## Starting with $$W^{4+}$$¶

Based on experience with d open-shell systems, the first step is to obtain converged state of the (closest) closed-shell cation, $$W^{4+}$$. We do not lean on the program’s auto-occupation scheme, rather we ensure proper spinors occupation of two fermion irreducible representations:

$PAM --noarch --mw=300 --mol=W.dyall_v2z.lsym.mol --inp=W_4+.x2c.scf_30_40.2fs.inp --get "DFCOEF=DFCOEF.W_4+" (Related files to download are W.dyall_v2z.lsym.mol and W_4+.x2c.scf_30_40.2fs.inp ) The total SCF energy of this cation is -16146.075957236933 a.u., and, as a sign of correctness of the SCF calculation, there are properly degenerated p, d etc eigenvalues, visible in the analysis output (see the full output file W_4+.x2c.scf_30_40.2fs_W.dyall_v2z.lsym.out). In the case of ill SCF process, though converged, atomic shells are not degenerated as they should be. ## The W atom from $$W^{4+}$$¶ In the next step we reuse saved molecular spinors from file DFCOEF.W_4+ and keep the overlap selection $PAM --noarch --mw=300 --mol=W.dyall_v2z.lsym.mol --inp=W.x2c.scf_ovlsel.2fs.inp --put "DFCOEF.W_4+=DFCOEF"

One has to take the dynamic overlap selection as the mere $$M_{J}$$ selection does not work (you can try it for yourself with the input file W.x2c.scf_Mjsel.inp).

For the W atom, we get the total SCF energy of -16149.950403420618 a.u. and, for example, correct occupation of the 5d shell, which lies above the 6s doubly occupied level

                           1/2   3/2  5/2
open shell #1 (f=0.4000):    2    2    1

This can be easily verified as the $$d_{3/2}$$ shell gives values of $$M_{J}=\frac{1}{2},\frac{3}{2}$$ and the $$d_{5/2}$$ spans values of $$M_{J}=\frac{1}{2},\frac{3}{2},\frac{5}{2}$$, what makes the 5d open-shell occupation, 2 2 1, as shown above. See also the complete output file, W.x2c.scf_ovlsel.2fs_W.dyall_v2z.lsym.out

## How about lower symmetry ?¶

We descend to the $$C_{2v}$$ symmetry, having 1 fermion irreducible representation. Again, we start from the closed shell cation, $$W^{4+}$$, and use its DFCOEF for the next run. First, we discover that the $$W^{4+}$$ system does not have proper degeneracy of (l>0) spinors in the $$C_{2v}$$ symmetry, though the $$W^{4+}$$ system is converging. For the subsequent, spinors reordering run, one has to place restrictions on the order of MO and get its DFCOEF saved.

Unfortunately, subsequent calculations in the C2v symmetry do not lead to properly ordered and proprely degenerated orbitals of $$W^{4+}$$, therefore (at least we assume), no success can be achieved with the neutral W atom. Maybe some more test with various pre-SCF reordering of starting $$W^{4+}$$ spinors would fix this issue ?

(Input files to download for investigating the $$C_{2v}$$ symmetry are W.dyall_v2z.C2v.mol, W_4+.x2c.scf.1fs.inp, W.x2c.scf_ovlsel.1fs.inp, W_4+.x2c.scf_reorder_ovlsel.1fs.inp)


text:
cora

Calculates correlation metric between CAE and Test Data signals in the form of time history. Includes both corridor and cross correlation, which are calculated independently and then combined to give a comprehensive error. The error calculation can be biased towards either the measured time history(Test) or the computed (CAE) time history, with the former being most common.

Syntax

cora(inputstruct,refcurve,compcurves)

cora(inputstruct,refcurve,[compcurve1, compcurve2, compcurve3,...])

cora(inputstruct,[refcurve1,refcurve2,refcurve3,...],compcurves)

cora(inputstruct,[refcurve1,refcurve2,refcurve3,...],[compcurve1, compcurve2, compcurve3,...])

out1 = cora(...)

[out1,out2] = cora(...)

Inputs

inputstruct
Struct with method parameters, if different from the default values. Only the parameters whose values are different from default need to be declared. If all default values should be used, an empty struct should be given in this argument.
a_thres
Threshold to set the start of the interval of evaluation. Varies between 0 and 1. Default: 0.03
Type: double
Dimension: scalar
b_thres
Threshold to set the end of the interval of evaluation. Varies between 0 and 1. Default: 0.075
Type: double
Dimension: scalar
a_eval
Automatically calculated interval of evaluation. Varies between 0 and 1. Default: 0.01
Type: double
Dimension: scalar
b_delta_end
Shortens the end of the interval of evaluation if it is calculated automatically. Varies between 0 and 1. Default: 0.2
Type: double
Dimension: scalar
t_min
Defines the starting time of the evaluation interval. Default: 'automatic'
Type: char | double
Dimension: scalar | string
t_max
Defines the ending time of the evaluation interval. Default: 'automatic'
Type: char | double
Dimension: scalar | string
K
Exponent factor (progression) for the calculation of the corridor rating. Default: 2
Type: double
Dimension: scalar
g_1
Weighting factor of the corridor rating. Default: 0.5
Type: double
Dimension: scalar
a_0
Width of the inner and outer corridor. Default: 0.05
Type: double
Dimension: scalar
b_0
Width of the outer and outer corridor. Default: 0.5
Type: double
Dimension: scalar
a_sigma
Factors of the standard deviation to widen the inner corridor. Default: 0
Type: double
Dimension: scalar
b_sigma
Factors of the standard deviation to widen the outer corridor. Default: 0
Type: double
Dimension: scalar
d_min
Calculates the interval of evaluation. Varies between 0 and 1. Default: 0.01
Type: double
Dimension: scalar
d_max
Calculates the interval of evaluation. Varies between 0 and 1. Default: 0.12
Type: double
Dimension: scalar
int_min
Minimum overlap of the interval. Varies between 0 and 1. Default: 0.8
Type: double
Dimension: scalar
k_v
Exponent factor (progression) of the calculation of the progression rating, V. Default: 10
Type: double
Dimension: scalar
k_g
Exponent factor (progression) of the calculation of the size rating, G. Default: 1
Type: double
Dimension: scalar
k_p
Exponent factor (progression) of the calculation of the phase shift rating, P. Default: 1
Type: double
Dimension: scalar
g_v
Weighting factors of the progression rating. Default: 0.5
Type: double
Dimension: scalar
g_g
Weighting factors of the size rating. Default: 0.25
Type: double
Dimension: scalar
g_p
Weighting factors of the phase shift rating. Default: 0.25
Type: double
Dimension: scalar
g_2
Weighting factors of the cross-correlation method. Default: 0.5
Type: double
Dimension: scalar
y_norm
Type of calculation of Y_NORM; options include 'extremum' or value. Default: 'extremum'
Type: char | double
Dimension: scalar | string
wf_norm
Normalization of the weighting factors; options include 'yes or 'no'. Default: 'yes'
Type: double
Dimension: scalar
min_norm
The limit to start special treatment of secondary axis. Varies between 0 and 1. Default: 0
Type: double
Dimension: scalar
Type: struct
refcurve
Reference curve(s). Minimum required input needs to be a 2-column matrix with X and Y reference data. Multiple pairs of curves can be given and every 2 columns will be considered as a different reference dataset.
If multiple reference curves are given, they are averaged to generate a single one that will be used in the calculation.
Type: double
Dimension: vector
compcurve
Comparison curve(s). Minimum required input needs to be a 2-column matrix with X and Y comparison data. Multiple pairs of curves can be given and every 2 columns will be considered as a different comparison dataset.
Type: double
Dimension: vector

Outputs

out1
nx6 output. The n rows correspond to different correlation curves. The 6 columns correspond to CORA rating, corridor rating, total cross correlation, phase rating, progression rating and size rating
Type: double
Dimension: matrix
out2
nx16 output. The n rows correspond to different correlation curves. The 16 columns correspond to inner correlation, outer correlation, Y norm, T min, T max, Gv, Gg, Gp, G1, G2, a0, b0, asigma, bsigma, min delta and max delta
Type: double
Dimension: matrix

Example

Usage of cora with 1 reference curve and 3 comparison curves, using default parameter values.

refcurve1 = [1:20; 1:20']';
compcurve1 = [1:20; 31:50]';
compcurve2 = [1:20; 41:60]';
compcurve3 = [1:20; 51:70]';
inputstruct = struct();
[out1,out2] = cora(inputstruct,refcurve1,[compcurve1, compcurve2, compcurve3])
out1 = [Matrix] 3 x 6
0.18878  0.00000  0.37756  0.00000  0.70687  0.09651
0.17546  0.00000  0.35092  0.00000  0.67095  0.06175
0.16719  0.00000  0.33438  0.00000  0.64733  0.04285
out2 = [Matrix] 3 x 16 Rows[1:3] Columns[1:11]
1.00000  10.00000  20.00000  1.00000  16.19000  0.50000  0.25000  0.25000  0.50000  0.50000  0.05000
1.00000  10.00000  20.00000  1.00000  16.19000  0.50000  0.25000  0.25000  0.50000  0.50000  0.05000
1.00000  10.00000  20.00000  1.00000  16.19000  0.50000  0.25000  0.25000  0.50000  0.50000  0.05000

out2 = [Matrix] 3 x 16 Rows[1:3] Columns[12:16]
0.50000  0.00000  0.00000  0.15190  1.82280
0.50000  0.00000  0.00000  0.15190  1.82280
0.50000  0.00000  0.00000  0.15190  1.82280

Usage of cora with 3 reference curves and 1 comparison curve, setting the value of a_thres parameter.

refcurve1 = [1:20; 1:20']';
refcurve2 = [1:20; 11:30]';
refcurve3 = [1:20; 21:40]';
compcurve1 = [1:20; 31:50]';
inputstruct.a_thres = 0.1;
[out1,out2] = cora(inputstruct,[refcurve1,refcurve2,refcurve3],compcurve1)
out1 = [Matrix] 1 x 6
0.31246  0.04938  0.57553  0.00000  0.96782  0.36647
out2 = [Matrix] 1 x 16 Row[1] Columns[1:11]
2.50000  25.00000  50.00000  1.00000  20.00000  0.50000  0.25000  0.25000  0.50000  0.50000  0.05000

Row[1] Columns[12:16]
0.50000  0.00000  0.00000  0.19000  2.28000


text:
# Source code for photutils.isophote.geometry

# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides a container class to store parameters for the
geometry of an ellipse.
"""

import math

from astropy import log
import numpy as np

__all__ = ['EllipseGeometry']

[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
]

[1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1],
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1],
[1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1],
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1],
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1],
[1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
]

def _area(sma, eps, phi, r):
"""
Compute elliptical sector area.
"""
aux = r * math.cos(phi) / sma
signal = aux / abs(aux)
if abs(aux) >= 1.:
aux = signal
return abs(sma**2 * (1.-eps) / 2. * math.acos(aux))

[docs]class EllipseGeometry:
r"""
Container class to store parameters for the geometry of an ellipse.

Parameters that describe the relationship of a given ellipse with
other associated ellipses are also encapsulated in this container.
These associated ellipses may include, e.g., the two (inner and
outer) bounding ellipses that are used to build sectors along the
elliptical path. These sectors are used as areas for integrating
pixel values, when the area integration mode (mean or median) is
used.

This class also keeps track of where in the ellipse we are when
performing an 'extract' operation. This is mostly relevant when
using an area integration mode (as opposed to a pixel integration
mode)

Parameters
----------
x0, y0 : float
The center pixel coordinate of the ellipse.
sma : float
The semimajor axis of the ellipse in pixels.
eps : ellipticity
The ellipticity of the ellipse.
pa : float
The position angle (in radians) of the semimajor axis in
relation to the positive x axis of the image array (rotating
towards the positive y axis). Position angles are defined in the
range :math:0 < PA <= \pi. Avoid using as starting position
angle of 0., since the fit algorithm may not work properly.
When the ellipses are such that position angles are near either
extreme of the range, noise can make the solution jump back and
forth between successive isophotes, by amounts close to 180
degrees.
astep : float, optional
The step value for growing/shrinking the semimajor axis. It can
be expressed either in pixels (when linear_growth=True) or
as a relative value (when linear_growth=False).  The default
is 0.1.
linear_growth : bool, optional
The semimajor axis growing/shrinking mode. The default is
False.
fix_center : bool, optional
Keep center of ellipse fixed during fit? The default is False.
fix_pa : bool, optional
Keep position angle of semi-major axis of ellipse fixed during fit?
The default is False.
fix_eps : bool, optional
Keep ellipticity of ellipse fixed during fit? The default is False.
"""

def __init__(self, x0, y0, sma, eps, pa, astep=0.1, linear_growth=False,
fix_center=False, fix_pa=False, fix_eps=False):
self.x0 = x0
self.y0 = y0
self.sma = sma
self.eps = eps
self.pa = pa

self.astep = astep
self.linear_growth = linear_growth

# Fixed parameters are flagged in here. Note that the
# ordering must follow the same ordering used in the
# fitter._CORRECTORS list.
self.fix = np.array([fix_center, fix_center, fix_pa, fix_eps])

# limits for sector angular width
self._phi_min = 0.05
self._phi_max = 0.2

# variables used in the calculation of the sector angular width
sma1, sma2 = self.bounding_ellipses()
inner_sma = min((sma2 - sma1), 3.)
self._area_factor = (sma2 - sma1) * inner_sma

# sma can eventually be zero!
if self.sma > 0.:
self.sector_angular_width = max(min((inner_sma / self.sma),
self._phi_max), self._phi_min)
self.initial_polar_angle = self.sector_angular_width / 2.

[docs]    def find_center(self, image, threshold=0.1, verbose=True):
"""
Find the center of a galaxy.

If the algorithm is successful the (x, y) coordinates in this
~photutils.isophote.EllipseGeometry (i.e., the x0 and
y0 attributes) instance will be modified.

The isophote fit algorithm requires an initial guess for the
galaxy center (x, y) coordinates and these coordinates must be
close to the actual galaxy center for the isophote fit to work.
This method provides can provide an initial guess for the galaxy
center coordinates.  See the **Notes** section below for more
details.

Parameters
----------
image : 2D ~numpy.ndarray
The image array.  Masked arrays are not recognized here. This
assumes that centering should always be done on valid pixels.

threshold : float, optional
The centerer threshold.  To turn off the centerer, set this
to a large value (i.e., >> 1).  The default is 0.1.

verbose : bool, optional
Whether to print object centering information.  The default is
True.

Notes
-----
The centerer function scans a 10x10 window centered on the (x,
y) coordinates in the ~photutils.isophote.EllipseGeometry
instance passed to the constructor of the
~photutils.isophote.Ellipse class.  If any of the
~photutils.isophote.EllipseGeometry (x, y) coordinates are
None, the center of the input image frame is used.  If the
center acquisition is successful, the
~photutils.isophote.EllipseGeometry instance is modified in
place to reflect the solution of the object centerer algorithm.

In some cases the object centerer algorithm may fail even though
there is enough signal-to-noise to start a fit (e.g., objects
with very high ellipticity). In those cases the sensitivity
of the algorithm can be decreased by decreasing the value of
the object centerer threshold parameter. The centerer works by
looking where a quantity akin to a signal-to-noise ratio is
maximized within the 10x10 window. The centerer can thus be shut
off entirely by setting the threshold to a large value (i.e.,
>> 1; meaning no location inside the search window will achieve
that signal-to-noise ratio).
"""
self.centerer_threshold = threshold

# number of pixels in each mask

# Check if center coordinates point to somewhere inside the frame.
# If not, set then to frame center.
shape = image.shape
_x0 = self.x0
_y0 = self.y0
if (_x0 is None or _x0 < 0 or _x0 >= shape[1] or _y0 is None or
_y0 < 0 or _y0 >= shape[0]):
_x0 = shape[1] / 2
_y0 = shape[0] / 2

max_fom = 0.
max_i = 0
max_j = 0

# scan all positions inside window
window_half_size = 5
for i in range(int(_x0 - window_half_size),
int(_x0 + window_half_size) + 1):
for j in range(int(_y0 - window_half_size),
int(_y0 + window_half_size) + 1):

# ensure that it stays inside image frame
i1 = int(max(0, i - self._centerer_mask_half_size))
j1 = int(max(0, j - self._centerer_mask_half_size))
i2 = int(min(shape[1] - 1, i + self._centerer_mask_half_size))
j2 = int(min(shape[0] - 1, j + self._centerer_mask_half_size))

window = image[j1:j2, i1:i2]

# averages in inner and outer regions.

# standard deviation and figure of merit
inner_std = np.std(inner)
outer_std = np.std(outer)
stddev = np.sqrt(inner_std**2 + outer_std**2)

fom = (inner_avg - outer_avg) / stddev

if fom > max_fom:
max_fom = fom
max_i = i
max_j = j

# figure of merit > threshold: update geometry with new coordinates.
if max_fom > threshold:
self.x0 = float(max_i)
self.y0 = float(max_j)

if verbose:
log.info(f'Found center at x0 = {self.x0:5.1f}, '
f'y0 = {self.y0:5.1f}')
else:
if verbose:
log.info('Result is below the threshold -- keeping the '
'original coordinates.')

"""
Calculate the polar radius for a given polar angle.

Parameters
----------
angle : float

Returns
-------
"""
return (self.sma * (1. - self.eps) /
np.sqrt(((1. - self.eps) * np.cos(angle))**2 +
(np.sin(angle))**2))

[docs]    def initialize_sector_geometry(self, phi):
"""
Initialize geometry attributes associated with an elliptical
sector at the given polar angle phi.

This function computes:

* the four vertices that define the elliptical sector on the
pixel array.
* the sector area (saved in the sector_area attribute)
* the sector angular width (saved in sector_angular_width
attribute)

Parameters
----------
phi : float
The polar angle (radians) where the sector is located.

Returns
-------
x, y : 1D ~numpy.ndarray
The x and y coordinates of each vertex as 1D arrays.
"""
# These polar radii bound the region between the inner
# and outer ellipses that define the sector.
sma1, sma2 = self.bounding_ellipses()
eps_ = 1. - self.eps

# polar vector at one side of the elliptical sector
self._phi1 = phi - self.sector_angular_width / 2.
r1 = (sma1 * eps_ / math.sqrt((eps_ * math.cos(self._phi1))**2
+ (math.sin(self._phi1))**2))
r2 = (sma2 * eps_ / math.sqrt((eps_ * math.cos(self._phi1))**2
+ (math.sin(self._phi1))**2))

# polar vector at the other side of the elliptical sector
self._phi2 = phi + self.sector_angular_width / 2.
r3 = (sma2 * eps_ / math.sqrt((eps_ * math.cos(self._phi2))**2
+ (math.sin(self._phi2))**2))

r4 = (sma1 * eps_ / math.sqrt((eps_ * math.cos(self._phi2))**2
+ (math.sin(self._phi2))**2))

# sector area
sa1 = _area(sma1, self.eps, self._phi1, r1)
sa2 = _area(sma2, self.eps, self._phi1, r2)
sa3 = _area(sma2, self.eps, self._phi2, r3)
sa4 = _area(sma1, self.eps, self._phi2, r4)
self.sector_area = abs((sa3 - sa2) - (sa4 - sa1))

# angular width of sector. It is calculated such that the sectors
# come out with roughly constant area along the ellipse.
self.sector_angular_width = max(min((self._area_factor / (r3 - r4) /
r4), self._phi_max),
self._phi_min)

# compute the 4 vertices that define the elliptical sector.
vertex_x = np.zeros(shape=4, dtype=float)
vertex_y = np.zeros(shape=4, dtype=float)

# vertices are labelled in counterclockwise sequence
vertex_x[0:2] = np.array([r1, r2]) * math.cos(self._phi1 + self.pa)
vertex_x[2:4] = np.array([r4, r3]) * math.cos(self._phi2 + self.pa)
vertex_y[0:2] = np.array([r1, r2]) * math.sin(self._phi1 + self.pa)
vertex_y[2:4] = np.array([r4, r3]) * math.sin(self._phi2 + self.pa)
vertex_x += self.x0
vertex_y += self.y0

return vertex_x, vertex_y

[docs]    def bounding_ellipses(self):
"""
Compute the semimajor axis of the two ellipses that bound the
annulus where integrations take place.

Returns
-------
sma1, sma2 : float
The smaller and larger values of semimajor axis length that
define the annulus bounding ellipses.
"""
if self.linear_growth:
a1 = self.sma - self.astep / 2.
a2 = self.sma + self.astep / 2.
else:
a1 = self.sma * (1. - self.astep / 2.)
a2 = self.sma * (1. + self.astep / 2.)

return a1, a2

[docs]    def polar_angle_sector_limits(self):
"""
Return the two polar angles that bound the sector.

The two bounding polar angles become available only after
calling the
:meth:~photutils.isophote.EllipseGeometry.initialize_sector_geometry
method.

Returns
-------
phi1, phi2 : float
The smaller and larger values of polar angle that bound the
current sector.
"""
return self._phi1, self._phi2

[docs]    def to_polar(self, x, y):
r"""
Return the radius and polar angle in the ellipse coordinate
system given (x, y) pixel image coordinates.

This function takes care of the different definitions for
position angle (PA) and polar angle (phi):

.. math::
-\pi < PA < \pi

0 < phi < 2 \pi

Note that radius can be anything.  The solution is not tied to
the semimajor axis length, but to the center position and tilt
angle.

Parameters
----------
x, y : float
The (x, y) image coordinates.

Returns
-------
The ellipse radius and polar angle.
"""
# We split in between a scalar version and a
# vectorized version. This is necessary for
# now so we don't pay a heavy speed penalty
# that is incurred when using vectorized code.

# The split in two separate functions helps in
# the profiling analysis: most of the time is
# spent in the scalar function.

if isinstance(x, (int, float)):
return self._to_polar_scalar(x, y)
else:
return self._to_polar_vectorized(x, y)

def _to_polar_scalar(self, x, y):
x1 = x - self.x0
y1 = y - self.y0

else:
angle = 1.

if x1 >= 0. and y1 < 0.:
angle = 2*np.pi - angle
elif x1 < 0. and y1 >= 0.:
angle = np.pi - angle
elif x1 < 0. and y1 < 0.:
angle = np.pi + angle

pa1 = self.pa
if self.pa < 0.:
pa1 = self.pa + 2*np.pi
angle = angle - pa1
if angle < 0.:
angle = angle + 2*np.pi

def _to_polar_vectorized(self, x, y):
x1 = np.atleast_2d(x) - self.x0
y1 = np.atleast_2d(y) - self.y0

idx = (x1 >= 0.) & (y1 < 0)
angle[idx] = 2*np.pi - angle[idx]
idx = (x1 < 0.) & (y1 >= 0.)
angle[idx] = np.pi - angle[idx]
idx = (x1 < 0.) & (y1 < 0.)
angle[idx] = np.pi + angle[idx]

pa1 = self.pa
if self.pa < 0.:
pa1 = self.pa + 2*np.pi
angle = angle - pa1
angle[angle < 0] += 2*np.pi

[docs]    def update_sma(self, step):
"""
Calculate an updated value for the semimajor axis, given the
current value and the step value.

The step value must be managed by the caller to support both
modes: grow outwards and shrink inwards.

Parameters
----------
step : float
The step value.

Returns
-------
sma : float
The new semimajor axis length.
"""
if self.linear_growth:
sma = self.sma + step
else:
sma = self.sma * (1. + step)
return sma

[docs]    def reset_sma(self, step):
"""
Change the direction of semimajor axis growth, from outwards to
inwards.

Parameters
----------
step : float
The current step value.

Returns
-------
sma, new_step : float
The new semimajor axis length and the new step value to
initiate the shrinking of the semimajor axis length. This is
the step value that should be used when calling the
:meth:~photutils.isophote.EllipseGeometry.update_sma
method.
"""
if self.linear_growth:
sma = self.sma - step
step = -step
else:
aux = 1. / (1. + step)
sma = self.sma * aux
step = aux - 1.

return sma, step