@@ -0,0 +1,1720 @@
+/*%0D%0A * Image/J Plugins%0D%0A * Copyright (C) 2002-2010 Jarek Sacha%0D%0A * Author's email: jsacha at users dot sourceforge dot net%0D%0A *%0D%0A * This library is free software; you can redistribute it and/or%0D%0A * modify it under the terms of the GNU Lesser General Public%0D%0A * License as published by the Free Software Foundation; either%0D%0A * version 2.1 of the License, or (at your option) any later version.%0D%0A *%0D%0A * This library is distributed in the hope that it will be useful,%0D%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0D%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0D%0A * Lesser General Public License for more details.%0D%0A *%0D%0A * You should have received a copy of the GNU Lesser General Public%0D%0A * License along with this library; if not, write to the Free Software%0D%0A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA%0D%0A *%0D%0A * Latest release available at http://sourceforge.net/projects/ij-plugins/%0D%0A */%0D%0A%0D%0Apackage net.sf.ij_plugins.util;%0D%0A%0D%0Aimport ij.gui.Roi;%0D%0Aimport ij.plugin.frame.RoiManager;%0D%0A%0D%0Aimport java.util.Collection;%0D%0A%0D%0A%0D%0A/**%0D%0A * @author Jarek Sacha%0D%0A * @since Feb 15, 2010 10:25:09 PM%0D%0A */%0D%0Apublic final class IJUtils %7B%0D%0A%0D%0A    private IJUtils() %7B%0D%0A%0D%0A    %7D%0D%0A%0D%0A%0D%0A    /**%0D%0A     * Add result ROIs to ROI Manager, replacing current content. If ROI Manager is not visible it will be opened.%0D%0A     *%0D%0A     * @param rois ROI's to be added.%0D%0A     */%0D%0A    public static void addToROIManager(final Collection%3CRoi%3E rois) %7B%0D%0A%0D%0A        final RoiManager roiManager = new RoiManager();%0D%0A%0D%0A        // Clear current content%0D%0A        roiManager.runCommand(%22Reset%22);%0D%0A%0D%0A        for (final Roi roi : rois) %7B%0D%0A            roiManager.addRoi(roi);%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A%0D%0A%7D%0D%0A

Add helper method addToROIManager().