Search in sources :

Example 1 with FRAPDataPanel

use of cbit.vcell.microscopy.gui.FRAPDataPanel in project vcell by virtualcell.

the class DefineROI_Panel method getCenterPanel.

public FRAPDataPanel getCenterPanel() {
    if (centerPanel == null) {
        centerPanel = new FRAPDataPanel();
        centerPanel.addPropertyChangeListener(this);
    }
    return centerPanel;
}
Also used : FRAPDataPanel(cbit.vcell.microscopy.gui.FRAPDataPanel)

Example 2 with FRAPDataPanel

use of cbit.vcell.microscopy.gui.FRAPDataPanel in project vcell by virtualcell.

the class BatchRunDisplayPanel method getFRAPDataPanel.

public FRAPDataPanel getFRAPDataPanel() {
    if (frapDataPanel == null) {
        // the frap data panel in the main frame is not editable
        frapDataPanel = new FRAPDataPanel(false);
        // set display mode
        frapDataPanel.adjustComponents(VFrap_OverlayEditorPanelJAI.DISPLAY_WITH_ROIS);
        Hashtable<String, Cursor> cursorsForROIsHash = new Hashtable<String, Cursor>();
        cursorsForROIsHash.put(FRAPData.VFRAP_ROI_ENUM.ROI_CELL.name(), FRAPStudyPanel.ROI_CURSORS[FRAPStudyPanel.CURSOR_CELLROI]);
        cursorsForROIsHash.put(FRAPData.VFRAP_ROI_ENUM.ROI_BLEACHED.name(), FRAPStudyPanel.ROI_CURSORS[FRAPStudyPanel.CURSOR_BLEACHROI]);
        cursorsForROIsHash.put(FRAPData.VFRAP_ROI_ENUM.ROI_BACKGROUND.name(), FRAPStudyPanel.ROI_CURSORS[FRAPStudyPanel.CURSOR_BACKGROUNDROI]);
        frapDataPanel.getOverlayEditorPanelJAI().setCursorsForROIs(cursorsForROIsHash);
        VFrap_OverlayEditorPanelJAI.CustomROIImport importVFRAPROI = new VFrap_OverlayEditorPanelJAI.CustomROIImport() {

            public boolean importROI(File inputFile) throws Exception {
                try {
                    if (!VirtualFrapLoader.filter_vfrap.accept(inputFile)) {
                        return false;
                    }
                    String xmlString = XmlUtil.getXMLString(inputFile.getAbsolutePath());
                    MicroscopyXmlReader xmlReader = new MicroscopyXmlReader(true);
                    FRAPStudy importedFrapStudy = xmlReader.getFrapStudy(XmlUtil.stringToXML(xmlString, null).getRootElement(), null);
                    VirtualFrapMainFrame.updateProgress(0);
                    ROI roi = getBatchRunWorkspace().getWorkingSingleWorkspace().getWorkingFrapStudy().getFrapData().getCurrentlyDisplayedROI();
                    ROI[] importedROIs = importedFrapStudy.getFrapData().getRois();
                    if (importedFrapStudy.getFrapData() != null && importedROIs != null) {
                        if (!importedROIs[0].getISize().compareEqual(roi.getISize())) {
                            throw new Exception("Imported ROI mask size (" + importedROIs[0].getISize().getX() + "," + importedROIs[0].getISize().getY() + "," + importedROIs[0].getISize().getZ() + ")" + " does not match current Frap DataSet size (" + roi.getISize().getX() + "," + roi.getISize().getY() + "," + roi.getISize().getZ() + ")");
                        }
                        for (int i = 0; i < importedROIs.length; i++) {
                            getBatchRunWorkspace().getWorkingSingleWorkspace().getWorkingFrapStudy().getFrapData().addReplaceRoi(importedROIs[i]);
                        }
                    // undoableEditSupport.postEdit(FRAPStudyPanel.CLEAR_UNDOABLE_EDIT);
                    }
                    return true;
                } catch (Exception e1) {
                    throw new Exception("VFRAP ROI Import - " + e1.getMessage());
                }
            }
        };
        frapDataPanel.getOverlayEditorPanelJAI().setCustomROIImport(importVFRAPROI);
    }
    return frapDataPanel;
}
Also used : Hashtable(java.util.Hashtable) Cursor(java.awt.Cursor) ROI(cbit.vcell.VirtualMicroscopy.ROI) MicroscopyXmlReader(cbit.vcell.microscopy.MicroscopyXmlReader) FRAPDataPanel(cbit.vcell.microscopy.gui.FRAPDataPanel) VFrap_OverlayEditorPanelJAI(cbit.vcell.microscopy.gui.VFrap_OverlayEditorPanelJAI) FRAPStudy(cbit.vcell.microscopy.FRAPStudy) File(java.io.File)

Example 3 with FRAPDataPanel

use of cbit.vcell.microscopy.gui.FRAPDataPanel in project vcell by virtualcell.

the class BatchRunROIImgPanel method getCenterPanel.

public FRAPDataPanel getCenterPanel() {
    if (centerPanel == null) {
        centerPanel = new FRAPDataPanel();
        centerPanel.addPropertyChangeListener(this);
    }
    return centerPanel;
}
Also used : FRAPDataPanel(cbit.vcell.microscopy.gui.FRAPDataPanel)

Aggregations

FRAPDataPanel (cbit.vcell.microscopy.gui.FRAPDataPanel)3 ROI (cbit.vcell.VirtualMicroscopy.ROI)1 FRAPStudy (cbit.vcell.microscopy.FRAPStudy)1 MicroscopyXmlReader (cbit.vcell.microscopy.MicroscopyXmlReader)1 VFrap_OverlayEditorPanelJAI (cbit.vcell.microscopy.gui.VFrap_OverlayEditorPanelJAI)1 Cursor (java.awt.Cursor)1 File (java.io.File)1 Hashtable (java.util.Hashtable)1