DeveloperExample-Volume

From Whole Brain Catalog

Jump to: navigation, search

Contents

[edit] Developer Example, Volume Rendering

This document will describe the developer code example relating to volume rendering.

[edit] Volume Rendering Server

[edit] How to Install From Source

[edit] From Eclipse

Install and Download
Install eclipse and the Maven Plugin Instructions Here
Download source code
  1. Checkout a new project from SVN; http://wholebrain.googlecode.com/svn/wbc-volume/trunk/wbc-server/
    1. Window->Show View->Other...
    2. Choose SVN->SVN Repository
    3. Right click within the SVN Repository View that comes up and click New->Repository Location...
    4. put: https://wholebrain.googlecode.com/svn/ If asked about a digital certificate, Accept Permanently.
    5. Navigate down to, and right click on the wbc-server/ folder and choose Checkout...
      1. You will be prompted to check out the project. Choose "Check out as a project configured using the New Project Wizard".
      2. In the "New Project" window that pops up, select Java->Java Project and hit Next
      3. Do NOT install the code into a path with spaces (like Documents and Settings in Windows). It will cause problems compiling. You can check this by looking at the greyed out "Directory" text box in the "Contents" group just under the Project name at the top of the window. If any of the directories in the path contains a space, you'll need to cancel this Window, open File->Switch Workspace...->Other... and pick a workspace at a location without a space in the file name. Once you have done that, come back and redo this step.
      4. In the next window, pick a project name you like (for example, "VolumeServerExample")
      5. Click "Finish" and hit OK to any windows that popup
  2. Right-click on the project, and from the Maven submenu, click "enable dependency management"
  3. Right click on the project and look at Build path...->Java Build Path->Libraries tab. Click on the arrow to open up the JRE system library. Make sure this is pointing to a jdk 1.5 that is loaded on your machine. If it isn't, then press the Add Library... button and install a new JRE System library that does point to 1.5. On windows, its usually under C:\Program Files\Java. If you can't find a 1.5 JDK, you'll need to download it.
  4. Create a new run configuration
    1. Select Run > Run Configurations:
    2. Under "Maven", create a new run configuration. Name it "clean install". Make the workspace the root under your new project. In the box called "goals" type "clean install". Run this.
Data Location Set Up
Predefined const string DEFAULT_PATH in VolumeInfoManager.java needs to be configured accordingly.
Data needs to be copied to the server within the DEFAULT_PATH directory
Ask Han for more detail.
Firewall Set Up
This server program uses a port 8183. So firewall in your machine needs to be configured to allow TCP connection from port 8183.
[edit] How to Run

Run the main method FirstStepApplication.java, setting up a run configuration for that file.

Test
access the following URL with any browser to check the server is running correctly:
http://{server_name}:8183/volumes
http://{server_name}:8183/volumes/pur1_ch.0.xvf?x=0&y=0&z=0&c=-1&l=0
Both print out some message in XML.
[edit] How to Run

Run the main method JMESwingTest.java, setting up a run configuration for that file.


[edit] Volume Rendering Client

[edit] How to Install the Binary

  • Download the binary version from here
  • Unzip
  • execute run.bat on windows or run.sh on mac / linux


[edit] How to Install From Source

[edit] From eclipse

I. First, install and download eclipse and the Maven Plugin Instructions Here and the MavenNatives plugin General Information Plugin URL.

The mavennatives plugin can be installed by using a standard way of installing plugins, go to Help->Install New Sowftware. Add a new site http://mavennatives.googlecode.com/svn/eclipse-update/ and download M2eclipse Natives_Feature.
You may see the message "There are no categorized items", in this case uncheck "Group items by category".
  1. Checkout a new project from SVN; http://wholebrain.googlecode.com/svn/wbc-volume/trunk/wbc-client/
    1. Window->Show View->Other...
    2. Choose SVN->SVN Repository
    3. Right click within the SVN Repository View that comes up and click New->Repository Location...
    4. put: https://wholebrain.googlecode.com/svn/ If asked about a digital certificate, Accept Permanently.
    5. Navigate down to, and right click on the wbc-client/ folder and choose Checkout...
      1. You will be prompted to check out the project. Choose "Check out as a project configured using the New Project Wizard".
      2. In the "New Project" window that pops up, select Java->Java Project and hit Next
      3. Do NOT install the code into a path with spaces (like Documents and Settings in Windows). It will cause problems compiling. You can check this by looking at the greyed out "Directory" text box in the "Contents" group just under the Project name at the top of the window. If any of the directories in the path contains a space, you'll need to cancel this Window, open File->Switch Workspace...->Other... and pick a workspace at a location without a space in the file name. Once you have done that, come back and redo this step.
      4. In the next window, pick a project name you like (for example, "VolumeExample")
      5. Click "Finish" and hit OK to any windows that popup
  2. Right-click on the project, and from the Maven submenu, click "enable dependency management"
  3. Right click on the project and look at Build path...->Java Build Path->Libraries tab. Click on the arrow to open up the JRE system library. Make sure this is pointing to a jdk 1.5 that is loaded on your machine. If it isn't, then press the Add Library... button and install a new JRE System library that does point to 1.5. On windows, its usually under C:\Program Files\Java. If you can't find a 1.5 JDK, you'll need to download it.
  4. Create a new run configuration
    1. Select Run > Run Configurations:
    2. Under "Maven", create a new run configuration. Name it "clean install". Make the workspace the root under your new project. In the box called "goals" type "clean install". Run this.

[edit] From a command line

We use Maven to build our code. The first thing to know about Maven is provides the "single command" ability to build an entire code base. With SVN and Maven installed you can issue the following commands to download and build the entire source of the Developer cloud example:

svn co http://wholebrain.googlecode.com/svn/wbc-volume/trunk/wbc-client/ volumeExample
cd volumeExample
mvn clean install

The one caveat to this is that you need to place a single configuration file called settings.xml in your maven directory. Your maven directory is located at ~/.m2 on linux/mac, C:\Users\[username]\.m2 on Vista, and C:\Documents and settings\[username]\.m2 in Windows XP. You can download our copy of the settings.xml file here. This will point your copy of Maven at our proxy maven repository, which contains many of the third party dependencies necessary for the Whole Brain Catalog.

This last process (mvn clean install) will take a long time because it does a lot of magic things for you. First of all it downloads all the jar files that this example depends on to your local machine, under your maven home directory, which is about 60MB. It will also download Maven specific jar files that are used to build the code, run tests, create java docs, do deployment, and so on. Once all these jars are downloaded, it will go step-by-step through the wbc modules, compile them, run their test cases, and package them into jars.

[edit] How to run

[edit] Using

  • Use the keys (W,A,S,D,Q,Z) for movement.
  • You will notice a box rotating in the far distance and a volume loaded over time. Navigating towards them changes the volume to a higher resolution.


[edit] Notes About The Example

The JMESiwngTest.java class has a main() method which does the following:

  1. Initializes the JME engine ('the view')
  2. Connects to the server to get a list of volume available. (for now, only one volume is located at the server)
  3. From the list of information downloaded from the server, initializes a volume node for each volume.
  4. The volume nodes is a subclass of JME Node class so it can be easily integrated with other JME Scene Graph Nodes.

Server is not running

  1. The volume rendering server is set to one of our development machine, which will be replaced to a more stable server, so in the meantime, it may be accidentally not running. In this case, contact hskim at ucsd dot edu to relaunch the server.

Native Library

  1. All the rendering process is done by native library, which can also be downloaded from http://wholebrain.googlecode.com/svn/wbc-volume/trunk/wbc-native-client/
  2. Precompiled shared library for Linux, Linux64, Mac OS X, and Windows are included in the wbc-client project under {$project_home/src/main/resources}. If you'd like to change and test the native library, you may configure your system to load libraries under resources directory or contact Han Kim.
Personal tools