public static void getTreeImage(DecisionTree rootNode,Integer fold){
        String file;
        file = rootNode.getDotFile();

        Formatter output;
        try {
            output = new Formatter("layoutFiles\\"+fold+"FoldTree.dot");
            output.format("%s", file);
            output.close();

            String command2 = "\"C:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe\" layoutFiles\\"+fold+"FoldTree.dot | "
                    + "\"C:\\Program Files (x86)\\Graphviz2.38\\bin\\gvpr.exe\" -c -f layoutFiles\\tree.gv | "
                    + "\"C:\\Program Files (x86)\\Graphviz2.38\\bin\\neato\" -n -Tpng -o layoutFiles\\"+fold+"FoldTree.png";                

            String[] command =
            {
                "cmd",
            };
            Process p = Runtime.getRuntime().exec(command);
            new Thread(new SyncPipe(p.getErrorStream(), System.err)).start();
            new Thread(new SyncPipe(p.getInputStream(), System.out)).start();
            PrintWriter stdin = new PrintWriter(p.getOutputStream());
            stdin.println(command2);
            // write any other commands you want here
            stdin.close();
            int returnCode = p.waitFor();
            //System.out.println("Return code = " + returnCode);                

//                String command ="cmd c/ dot layoutFiles\\"+fold+"FoldTree.dot | gvpr -c -f layoutFiles\\tree.gv | neato -n -Tpng -o layoutFiles\\"+fold+"FoldTree.png";
//                String[] commands = new String[]{"dot", "layoutFiles\\"+fold+"FoldTree.dot | gvpr -c -f layoutFiles\\tree.gv | neato -n -Tpng -o layoutFiles\\"+fold+"FoldTree.png"};
//                Process child = Runtime.getRuntime().exec(command);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(DTLearning.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(DTLearning.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InterruptedException ex) {
            Logger.getLogger(DTLearning.class.getName()).log(Level.SEVERE, null, ex);
        }
        //System.out.println(file);        
    }