void showResults() {
   int count = rt.getCounter();
   // if (count==0) return;
   boolean lastSlice = !processStack || slice == imp.getStackSize();
   if ((showChoice == OVERLAY_OUTLINES || showChoice == OVERLAY_MASKS) && slice == 1 && count > 0)
     imp.setOverlay(overlay);
   else if (outlines != null && lastSlice) {
     String title = imp != null ? imp.getTitle() : "Outlines";
     String prefix;
     if (showChoice == MASKS) prefix = "Mask of ";
     else if (showChoice == ROI_MASKS) prefix = "Count Masks of ";
     else prefix = "Drawing of ";
     outlines.update(drawIP);
     outputImage = new ImagePlus(prefix + title, outlines);
     if (inSituShow) {
       if (imp.getStackSize() == 1) Undo.setup(Undo.TRANSFORM, imp);
       imp.setStack(null, outputImage.getStack());
     } else if (!hideOutputImage) outputImage.show();
   }
   if (showResults && !processStack) {
     TextPanel tp = IJ.getTextPanel();
     if (beginningCount > 0 && tp != null && tp.getLineCount() != count) rt.show("Results");
     Analyzer.firstParticle = beginningCount;
     Analyzer.lastParticle = Analyzer.getCounter() - 1;
   } else Analyzer.firstParticle = Analyzer.lastParticle = 0;
 }
 public void run(String arg) {
   GenericDialog gd = new GenericDialog("Options");
   gd.addCheckbox("Add_Titles", true);
   gd.addCheckbox("Close Original", false);
   gd.showDialog();
   if (gd.wasCanceled()) {
     return;
   }
   boolean addtitles = gd.getNextBoolean();
   boolean closeorig = gd.getNextBoolean();
   // first get the table window
   Frame[] niframes = WindowManager.getNonImageWindows();
   boolean first = true;
   TextWindow tw2 = null;
   int ncols = 0;
   String[] col_labels = null;
   for (int i = 0; i < niframes.length; i++) {
     if (niframes[i] instanceof TextWindow && !niframes[i].getTitle().equals("Log")) {
       TextWindow tw = (TextWindow) niframes[i];
       TextPanel tp = tw.getTextPanel();
       List<List<String>> listtable = table_tools.table2listtable(tp);
       if (listtable.size() == 0) {
         col_labels = table_tools.getcollabels(tp);
         ncols = col_labels.length;
         ArrayList<String> temp = new ArrayList<String>();
         for (int j = 0; j < ncols; j++) temp.add("");
         listtable.add(temp);
       }
       if (first) {
         col_labels = table_tools.getcollabels(tp);
         ncols = col_labels.length;
         String headings = tp.getColumnHeadings();
         if (addtitles) {
           String[] titles = repeated(tw.getTitle(), listtable.size());
           table_tools.add_listtable_column(listtable, titles, 0);
           headings = "name\t" + headings;
         }
         tw2 =
             new TextWindow(
                 "Combined Table", headings, table_tools.print_listtable(listtable), 400, 200);
         first = false;
       } else {
         if (addtitles) {
           String[] titles = repeated(tw.getTitle(), listtable.size());
           table_tools.add_listtable_column(listtable, titles, 0);
         }
         tw2.append(table_tools.print_listtable(listtable));
       }
       if (closeorig) tw.close();
     }
   }
 }