/** Save the image as tab-delimited text using the specified path. */ public boolean saveAsText(String path) { DataOutputStream out = null; try { Calibration cal = imp.getCalibration(); int precision = Analyzer.getPrecision(); int measurements = Analyzer.getMeasurements(); boolean scientificNotation = (measurements&Measurements.SCIENTIFIC_NOTATION)!=0; if (scientificNotation) precision = -precision; TextEncoder file = new TextEncoder(imp.getProcessor(), cal, precision); out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path))); file.write(out); out.close(); } catch (IOException e) { showErrorMessage("saveAsText", path, e); return false; } finally { if (out!=null) try {out.close();} catch (IOException e) {} } return true; }
/** Save the image as tab-delimited text using the specified path. */ public boolean saveAsText(String path) { DataOutputStream out = null; try { Calibration cal = imp.getCalibration(); int precision = Analyzer.getPrecision(); int measurements = Analyzer.getMeasurements(); boolean scientificNotation = (measurements&Measurements.SCIENTIFIC_NOTATION)!=0; if (scientificNotation) precision = -precision; TextEncoder file = new TextEncoder(imp.getProcessor(), cal, precision); out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path))); file.write(out); out.close(); } catch (IOException e) { showErrorMessage("saveAsText", path, e); return false; } finally { if (out!=null) try {out.close();} catch (IOException e) {} } return true; }