Package fr.soleil.comete.swing.image.ijviewer

Examples of fr.soleil.comete.swing.image.ijviewer.IJRoiManager


    public void addRoi(String name, int shape, int lineWidth, int x, int y, int height, int width,
            Color color) {

        ImageViewer viewer = (ImageViewer) getComponent();
        IJRoiManager imagePlus = viewer.getRoiManager();

        if (imagePlus == null || name == null || name.isEmpty()) {
            return;
        }

        Roi.setColor(color);

        Roi roi = null;
        Roi roi1 = null;
        Roi roi2 = null;
        String name1 = name + "_H";
        String name2 = name + "_V";

        if (roiMap.containsKey(name)) {
            roi = roiMap.get(name);
            imagePlus.deleteRoi(roi);
            roiMap.remove(name);
            roi = null;
        }

        // In case of cross
        if (roiMap.containsKey(name1)) {
            roi1 = roiMap.get(name1);
            imagePlus.deleteRoi(roi1);
            roiMap.remove(name1);
            roi1 = null;
        }

        // In case of cross
        if (roiMap.containsKey(name2)) {
            roi2 = roiMap.get(name2);
            imagePlus.deleteRoi(roi2);
            roiMap.remove(name2);
            roi2 = null;
        }

        switch (shape) {
View Full Code Here


    }

    public void setRoi(Roi roi, String keyName, String name, Color color, int lineWidth) {

        ImageViewer viewer = (ImageViewer) getComponent();
        IJRoiManager imagePlus = viewer.getRoiManager();

        if (imagePlus != null && roi != null && keyName != null && !keyName.isEmpty()
                && keyName != null) {
            roiMap.put(keyName, roi);
            imagePlus.addRoi(roi);
            roi.setStrokeColor(color);
            roi.setName(keyName);
            roi.setStrokeWidth(lineWidth);
        }
    }
View Full Code Here

        }
    }

    public void deleteRoi(Roi roiToDelete) {
        ImageViewer viewer = (ImageViewer) getComponent();
        IJRoiManager imagePlus = viewer.getRoiManager();
        imagePlus.deleteRoi(roiToDelete);
    }
View Full Code Here

TOP

Related Classes of fr.soleil.comete.swing.image.ijviewer.IJRoiManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.