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;
}
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;
}
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;
}
Aggregations