jist:DevTutorial
From NITRC Wiki
Note: This page is currently under construction.
Contents |
Installing the Software
- Before installing, see the JIST Prerequisites.
Downloading Development Programs
Java Preferences and MIPAV
- BEFORE YOU START: See the JIST Tutorial on MIPAV installation / Getting Started: JIST Prerequisites
- In particular, the prerequisites include:
- Uninstall any previous versions.
- Prepare your Java Preferences to make sure that you're using Java 1.6 or higher.
- Even if you already have MIPAV already installed, make sure that you have the version of MIPAV that is most compatible with JIST.
Download and Install Eclipse
- Go to the Eclipse web site: [http://www.eclipse.org]
- Click [Download Eclipse].
- Choose [Eclipse IDE for Java Developers].
- Click the download button or choose a mirror site.
- For a Mac, it just downloads the archived file.
- Unzipping this archived file creates a new folder named [eclipse].
- You can move the [eclipse] folder to the [Applications] folder
- Run the installer and follow the on-screen instructions for installation
- Workspace Launcher: Set the folder wherever you'd like the Workspace to be
- For example: /Documents/workspace
Creating Accounts
Create a NITRC Account
- Notes: NITRC = The Neuroimaging Informatics Tools and Resources Clearinghouse
- NITRC website: http://www.nitrc.org/
- Under [Participate], click on [Register as a NITRC user]
- NITRC will send you a verification email.
- To further access your NITRC account: http://www.nitrc.org/account/login.php Select the appropriate timezone.
- Once you're logged in, you can see your account on the main toolbar, by clicking [My NITRC]
Create a JIST Account
- Notes: JIST = Java Image Science Toolkit
- JIST website: http://www.nitrc.org/projects/jist/
- Under [Member Info], click on [Request to Join Development Team]
- List whether you're willing to "be a reference."
- Under [Associations], click on [JIST Resources for Algorithm Development]: http://www.nitrc.org/projects/jhumipavplugins/
- Under [Member Info], click on [Request to Join Development Team]
- Wait for requests to be validated.
Adding the Code
Preparing Software Environment
Set Up Paths for CVS Repositories
- Open Eclipse. Eclipse will ask you which folder to store your work in; the default for this is under "Documents/workspace." If you ever need to clear over, check out the repositories again, etc, then you can just create a new folder (e.g., "Workspace2"), and you can start from scratch.
- Our first task is to tell eclipse where the CVS repositories are located. Eclipse has a window dedicated to managing CVS repositories, but it may not appear. To show this window follow these steps:
- Click "Window -> Show View -> Other" as shown below. (Figure P-1)
- Choose the CVS folder, highlight CVS Repositories and click Ok. (Figure P-2)
- Now the CVS Repositories Window should be open.
Figure P-1: Window -> Show View -> Other
Figure P-2: CVS Repositories
Add the CVS Repositories
- Now we will add the repositories containing the JIST plugin code and supporting JIST infrastructure code.
- First we will add the JIST infrastructure code.
- Right click in the "CVS Repository" window and select New -> Repository location. (Figure P-3)
- This brings up the "Add new CVS Repository" window. We will be adding several repositories to run JIST. (Figure P-4)
Figure P-3: New -> Repository Location
- Enter the following information:
- Host: www.nitrc.org
- Repostitory Path: /cvsroot/jist
- User: <Your Nitrc User name>
- Password: <Nothing - you will be prompted> or <Your Nitrc Password>
- Connection type: extssh
- Alternatively if you do not have a Nitrc user name, you can download the code anonymously using the following username / password
- User: jhuuser
- Password: jhuuser
- Click "Finish." You should see that a repository has been added in Eclipse.
Figure P-4: Add New CVS Repository Window
- Other CVS trees:
- There's one other CVS tree that you should have access to. This JHU MIPAV Plugins code is also on Nitrc and contains algorithm and plugin code that has been released as open source. The information for this repository is:
- Host: www.nitrc.org
- Repostitory Path: /cvsroot/jhumipavplugins
- User: <Your Nitrc User name>
- Password: <Nothing - you will be prompted> or <Your Nitrc Password>
- Connection type: extssh
Figure P-5: Alternate Window for JHUMipavPlugins
Download the Code and Create Java Projects
Now that we have the repositories, we can download the source code for JIST and the algorithms built using its infrastructure. In eclipse, this is done by creating a "Java Project" from the CVS repository with the following steps:
- Choose the repository location you want to download code from, and navigate to the appropriate folder. Right click on the folder and choose "Check out as."
- For the JIST repository (www.nitrc.org:/cvsroot/jist), check out from "HEAD/JIST"
Figure D-1: Check Out As...
- For the NITRC plugins repository (www.nitrc.org:/cvsroot/jhumipavplugins), check out from "HEAD/JIST-CVS/"
Figure D-2: Alternate Check Out As... for JHUMipavPlugins
- Choose "Check out as a project configured using the New Project Wizard" and click Next.
Figure D-3: Check Out As Project using New Project Wizard
- Choose the Head tag from the list of directories. Click "Finish".
Figure D-4: Choose Head Tag
- Select "Java Project" from the menu. Click "Next." (Figure D-4)
Figure D-5: Select Java Project
- Name your project according to the name of the repository (e.g., "JIST" or "JIST Base Code" for the base code associated with /jist, and maybe "JHUMipavPlugins" or "JIST Plugins" for the NITRC plugins associated with /jhumipavplugins).
- Be sure that "JavaSE-1.6" is selected as the "Execution Environment".
- Also choose "Create Separate Folders for Source and Class Files" if it is not selected
- Click "Finish" when you are done
Figure D-6: Name Project and Configure Project Settings
- Wait for the code to download... You can click "Run in Background" if you wish.
Figure D-7: Check Out Progress Window
- You now have a new Java Project! After adding both repositories, you'll be able to see these projects in the "Package Explorer" Window.
Figure D-3: Created Projects
Specify Dependencies and Add Libraries
After the above steps, all of the JIST and algorithm source code should be in your workspace. However, these will have compilation errors, since they depend on third-party libraries as well as each other. So, the next step is to specify these dependencies for each project.
The JIST infrastructure code, which correlates with "/cvsroot/jist", is at the "top" of the hierarchy, so we'll deal with this first.
- To edit the Project's Build Path, click on the project in the workspace on the left, then select Build Path -> Configure Build Path.
Figure L-1: Configure Build Path...
- The first thing that we need to add is the MIPAV class folder. Click "Add Class Folder."
Figure L-2: Add Class Folder
- Click "Create New Folder."
Figure L-3: Create New Folder
- Select "Advanced." Check "Link to folder in the file system." Type in or browse to the directory where MIPAV is installed. Click "OK"
Figure L-4: Add MIPAV Directory
- The "MIPAV" folder will now show up in the "Add Class Folder" window. Click "OK" to return to the build path window.
Figure L-5: Add MIPAV Class Folder
- Next, we add the MIPAV libraries. From the Build Path Screen click "Add JARs".
Figure L-6: Click Add JARs
- Navigate to the MIPAV folder which was just created under the JIST project. Select all the jars in the "mipav/lib" folder, and click "OK" to add them to the Build Path.
- (Note: You can select a subset of the jars, click "OK", then repeat the process to add more JARs.)
Figure L-7: Add JARs from mipav/lib
- Finally, we need to add other third-party libraries. These can be added to the classpath in the same way we added the MIPAV JARs.
- From the Build Path Screen click "Add JARs".
- Navigate to the root of the JIST project folder, and find the lib directory.
- Select all the jars in this "jist/lib" folder, and click "OK" to add them to the Build Path.
Figure L-8: Add JARs from JIST/lib
- Click "OK" in the Build Path Screen to apply changes to the Build Path.
Figure L-9: Apply Build Path Settings
- FOR WINDOWS/LINUX:
- First highlight the JRE System Library in the build path list. Click Edit.
- This brings up a new window. Select Alternate JRE. Click Installed JREs to add the MIPAV JRE to the list of JRE's that Eclipse will use.
- A new window appears with a list of the JREs Eclipse can use. Click Add.
- Next, type in a name for this JRE (ex. "mipav") and type in or browse to the JRE home directory in mipav. (this is usually ../mipav/jre). Click Finish.
- Click "Ok" to get back to the JRE window. Check the box next to the new MIPAV JRE. Click Ok to get back to the JRE System Library window. Change the Alternate JRE to be "mipav" instead of "jre6".
- Click "Finish".
- In Preferences, ensure that compiler under "Java Compiler" has the "Compliance Level" value set to 6.0.
- FOR MAC:
- On Mac, the Java Runtime Environment is controlled by Apple and does not need to be adjusted
- In Preferences, ensure that compiler under "Java Compiler" has the "Compliance Level" value set to 6.0.
The second level of the hierarchy deals with "/cvsroot/jhumipavplugins". It's Build Path must be configured as follows:
- Set a Source Folder for the Project.
- Expand the project until you see JIST folders.
- Right click on "src" and select Build Path -> Use as Source Folder.
Figure L-10: Use as Source Folder
- To edit this Project's Build Path, click on the project in the workspace on the left, then select Build Path -> Configure Build Path.
Figure L-11: Configure Build Path...
- The following Class Folders are required: JIST/bin and JIST/mipav. Click "Add Class Folder"
Figure L-12: Add Class Folder
- Select JIST/bin and JIST/mipav from the Base Code Directory. Click "OK"
Figure L-13: Add JIST/bin and JIST/mipav
- Import all JARS from jhumipavplugins/JIST/lib and mipav/lib and JIST/lib. Click "Add JARs"
Figure L-14: Click Add JARs
- Select the JARs in JIST/lib from the Plugins Directory. Click "OK"
Figure L-15: Add JARs from JIST/lib in Plugins Directory
- Select the JARs in JIST/lib from the Base Code Directory. Click "OK"
Figure L-16: Add JARS from JIST/lib in Base Code Directory
- Select the JARs in JIST/mipav/lib from the Base Code Directory. Click "OK"
Figure L-17: Add JARs from JIST/mipav/lib in Base Code Directory
- Click "OK" to apply changes to the Build Path.
Figure L-18: Apply Build Path Changes
Editing Modules
More information coming soon!







































