diff --git a/NeuGen/build.xml b/NeuGen/build.xml index 7fd2d86..ad7098c 100755 --- a/NeuGen/build.xml +++ b/NeuGen/build.xml @@ -18,6 +18,7 @@ + @@ -64,7 +65,14 @@ test-report: JUnit report generation --> - + + + + + + + + @@ -105,7 +113,7 @@ classname="com.oracle.appbundler.AppBundlerTask" classpath="libs/appbundler-1.0.jar" /> - + diff --git a/NeuGen/src/org/neugen/backend/NGBackend.java b/NeuGen/src/org/neugen/backend/NGBackend.java index 105c361..6b71708 100644 --- a/NeuGen/src/org/neugen/backend/NGBackend.java +++ b/NeuGen/src/org/neugen/backend/NGBackend.java @@ -454,8 +454,9 @@ public void save_and_close_project(Map paramTrees, String pro * * @param type * @param file + * @param withCellType */ - public void export_network(String type, String file) { + public void export_network(String type, String file, boolean withCellType) { Net net = ngLib.getNet(); if ("NGX".equalsIgnoreCase(type)) { logger.info("Exporting NGX data to... " + file); @@ -466,7 +467,7 @@ public void export_network(String type, String file) { TXTWriter txtWriter = new TXTWriter(net, new File(file)); txtWriter.setCompressed(false); txtWriter.setUncompressed(true); - txtWriter.setWithCellType(true); + txtWriter.setWithCellType(withCellType); txtWriter.exportNetToTXT(); } else { logger.info("Unsupported exporter chosen."); @@ -778,7 +779,7 @@ public static void main(String... args) { Map params = back.create_and_open_project("foo24", NeuGenConstants.NEOCORTEX_PROJECT, true, false); back.modifyNPartsDensity(params, "foo24/Neocortex", 0.1); back.generate_network(NeuGenConstants.NEOCORTEX_PROJECT); - back.export_network("NGX", "foo24.ngx"); + back.export_network("NGX", "foo24.ngx", false); back.save_and_close_project(params, "foo26"); } catch (Exception e) { logger.fatal("Make sure you selected a valid project directory: " + e); diff --git a/NeuGen/src/org/neugen/backend/main/SimpleCLI.java b/NeuGen/src/org/neugen/backend/main/SimpleCLI.java index d405de3..b5a939a 100644 --- a/NeuGen/src/org/neugen/backend/main/SimpleCLI.java +++ b/NeuGen/src/org/neugen/backend/main/SimpleCLI.java @@ -75,6 +75,7 @@ public static void main(String... args) { /// flags boolean open_only = false; boolean force = false; + boolean with_cell_type = false; if (args.length == 5) { if ("OPEN".equalsIgnoreCase(args[4])) { open_only = true; } } @@ -83,6 +84,12 @@ public static void main(String... args) { if ("FORCE".equalsIgnoreCase(args[5]) || ! args[5].isEmpty()) { force = true; } } + if (args.length == 7) { + if ("TRUE".equalsIgnoreCase(args[6])) { + with_cell_type = true; + } + } + try { final NGBackend backend = new NGBackend(); backend.create_and_open_project(project_base_dir, NeuGenConstants.NEOCORTEX_PROJECT, force, open_only); @@ -93,7 +100,7 @@ public static void main(String... args) { } backend.generate_network(project_type); - backend.export_network(export_format, output_name); + backend.export_network(export_format, output_name, with_cell_type); } catch (Exception e) { logger.fatal(e); e.printStackTrace(); @@ -105,9 +112,15 @@ public static void main(String... args) { * @brief prints usage for the simple CLI */ private static void usage() { - System.out.println("Usage: SimpleCLI PROJECT_BASE_DIR PROJECT_TYPE EXPORT_FORMAT OUTPUT_NAME [OPEN_OR_CREATE] [FORCE]"); - System.out.println("Project type either Neocortex or Hippocampus"); - System.out.println("Export format: TXT, HOC or NGX"); - System.out.println("Note: Only the first four parameters are mandatory."); + System.out.println("Usage: SimpleCLI PROJECT_BASE_DIR PROJECT_TYPE EXPORT_FORMAT OUTPUT_NAME [OPEN_OR_CREATE] [FORCE] [WITH_CELL_TYPE]"); + System.out.println("\tProject base dir on your FS where the project is located"); + System.out.println("\tProject type either Neocortex or Hippocampus"); + System.out.println("\tExport format: TXT, HOC or NGX"); + System.out.println("\tOutput name on your FS for the exported network given your format"); + System.out.println("\tOpen or create: Depending on your choise you can start with a new project or a existing project (specifeid by project base dir). Default OPEN."); + System.out.println("\tForce: If CREATE was chosen previously, specify also FORCE to override if you specify an existing project location. Default. FALSE"); + System.out.println("\tWith cell type: True or False, depending if we want the cell type to be encoded"); + System.out.println("\tNote: Only the first four parameters are mandatory."); + System.out.println("In case of any questions contact: stephan.grein@gcsc.uni-frankfurt.de"); } }