Index: branches/eam_branches/ipp-20101205/psphot/src/psphotStackReadout.c
===================================================================
--- branches/eam_branches/ipp-20101205/psphot/src/psphotStackReadout.c	(revision 30175)
+++ branches/eam_branches/ipp-20101205/psphot/src/psphotStackReadout.c	(revision 30176)
@@ -13,5 +13,10 @@
 bool psphotStackVisualFilerule(pmConfig *config, const pmFPAview *view, const char *filerule) {
 
+    bool status = false;
+
     int num = psphotFileruleCount(config, filerule);
+
+    // select the appropriate recipe information
+    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
 
     // loop over the available readouts
@@ -25,6 +30,12 @@
         psAssert (readout, "missing readout?");
 
-	psphotVisualShowImage (readout);
-	psphotVisualShowResidualImage (readout);
+        pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
+        psAssert (detections, "missing detections?");
+
+        psArray *sources = detections->allSources;
+        psAssert (sources, "missing sources?");
+
+	psphotVisualShowResidualImage (readout, true);
+	psphotVisualShowObjectRegions (readout, recipe, sources);
     }
     return true;
@@ -211,6 +222,7 @@
     psphotMagnitudes(config, view, STACK_SRC);
 
-    // copy the detections from SRC to OUT (for radial aperture photometry) 
-    if (!psphotSourceChildren (config, view, STACK_OUT, STACK_SRC)) {
+    // create source children for the OUT filerule (for radial aperture photometry) 
+    psArray *objectsRadial = psphotSourceChildrenByObject (config, view, STACK_OUT, objects);
+    if (!objectsRadial) {
 	psFree(objects);
 	psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
@@ -221,8 +233,5 @@
     for (int nMatchedPSF = 0; smoothAgain; nMatchedPSF++) {
 
-	// XXX we probably can drop this if we redefine the pixels in CopySources
-	// psphotRedefinePixels (config, view, STACK_OUT);
-
-	// re-measure the PSF for the smoothed image  
+	// re-measure the PSF for the smoothed image (using entries in 'allSources')
 	psphotChoosePSF (config, view, STACK_OUT, false);
 
@@ -234,5 +243,5 @@
 
 	// measure circular, radial apertures (objects sorted by S/N)
-	psphotRadialAperturesByObject (config, objects, view, STACK_OUT, nMatchedPSF); 
+	psphotRadialAperturesByObject (config, objectsRadial, view, STACK_OUT, nMatchedPSF); 
 
 	// replace the flux in the image so it is returned to its original state
@@ -265,4 +274,5 @@
 
     psFree (objects);
+    psFree (objectsRadial);
 
     // create the exported-metadata and free local data
