https://github.com/miho/vswc
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/miho/vswc
- Owner: miho
- License: bsd-2-clause
- Created: 2017-07-12T08:42:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-12T09:03:48.000Z (over 8 years ago)
- Last Synced: 2025-02-15T21:19:52.479Z (11 months ago)
- Language: Java
- Size: 59.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VSWC
[  ](https://bintray.com/miho/VRL-NeuroBox/vswc/_latestVersion)
Reads and writes SWC files.
## How to Use VSWC (Sample Code)
```java
// SWC sample
String swcContent = ""
+ "# ********************************************* \n"
+ "# SCALE 1.0 1.0 1.0 \n"
+ "1 1 2.3 1.73 -0.12 12.61 -1\n"
+ "2 1 2.3 14.34 -0.13 12.62 1\n"
+ "3 2 62.3 -10.87 -0.14 12.63 1";
System.out.println("----------------------------------------------------------");
System.out.println("> original SWC data:");
System.out.println("----------------------------------------------------------");
System.out.println(swcContent);
// read segments
List segments = SWCSegment.fromString(swcContent);
// TODO do something with the swc data
// output segments
System.out.println("----------------------------------------------------------");
System.out.println("> segment data:");
System.out.println("----------------------------------------------------------");
segments.forEach(s -> System.out.println(s));
// output segments in SWC format
System.out.println("----------------------------------------------------------");
System.out.println("> SWC data:");
System.out.println("----------------------------------------------------------");
String swcContent2 = SWCSegment.toSWCString(segments);
System.out.println(swcContent2);
```
## How to Build VSWC
### Requirements
- Java >= 1.8
- Internet connection (dependencies are downloaded automatically)
- IDE: [Gradle](http://www.gradle.org/) Plugin (not necessary for command line usage)
### IDE
Open the `VSWC` [Gradle](http://www.gradle.org/) project in your favourite IDE (tested with NetBeans 8.2) and build it
by calling the `assemble` task.
### Command Line
Navigate to the [Gradle](http://www.gradle.org/) project (e.g., `path/to/VSWC`) and enter the following command
#### Bash (Linux/OS X/Cygwin/other Unix-like shell)
bash gradlew assemble
#### Windows (CMD)
gradlew assemble