private void CopyAllFiles(String csvFilename) throws IOException, NoSuchAlgorithmException { ResultsTable table = ResultsTable.open(csvFilename); int size = table.getCounter(); for (int i = 0; i < size; i++) { String source = table.getStringValue("OriginaFile", i); String destination = table.getStringValue("WorkingFile", i); print(i + 1 + " Move from: " + source + " to ------> " + destination); // print("to ------> " + destination); // imp = new ImagePlus(source); // IJ.save(imp, destination); CopyFile(source, destination); StringBuffer sb1 = CheckSum(source); StringBuffer sb2 = CheckSum(destination); // CheckSum(source); // check SHA1 writeChecksum(sb1, sb2, table, i); } table.saveAs(csvFilename); }
public static void main(String[] args) { String mriImage = args[0]; String outImage = args[1]; String segArgs = args[2]; String outTable = args[3]; String pdxArgs = args[4]; System.out.println("Open: " + mriImage); IJ.open(mriImage); COPD_LungSegment tjPlug = new COPD_LungSegment(); ImagePlus cImage = IJ.getImage(); tjPlug.setup(segArgs, cImage); tjPlug.run(cImage.getProcessor()); IJ.save(cImage, outImage); COPD_PDxLAAx pdxPlug = new COPD_PDxLAAx(); pdxPlug.setup("", cImage); pdxPlug.run(cImage.getProcessor()); ResultsTable rt = Analyzer.getResultsTable(); try { rt.saveAs(outTable); } catch (IOException e) { e.printStackTrace(); } System.out.println("Results Table\n"); String prefix = "rtout, "; for (int i = 0; i < ResultsTable.MAX_COLUMNS; i++) { if (!rt.columnExists(i)) break; String tempOut = rt.getColumnHeading(i); for (double d : rt.getColumnAsDoubles(i)) { tempOut += ", " + d; } System.out.println(prefix + tempOut); } }