Browsing DICOM images and Building and compiling plug-in programs: Difference between pages
(Difference between pages)
Jump to navigation
Jump to search
m (1 revision imported) |
MIPAV>Angelfish100 (Created page with 'To build a new plug-in program for MIPAV, you must first install a build environment, alter the path environment variable, and compile the plug-in files.<br /> ==== Installing a...') |
||
Line 1: | Line 1: | ||
To build a new plug-in program for MIPAV, you must first install a build environment, alter the path environment variable, and compile the plug-in files.<br /> | |||
==== Installing a build environment ==== | |||
=== | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 Download and install <span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000">[http://java.sun.com Java SE Development Kit (JDK), version 1.6 (JDK 6u2) ]</font></u></span><span style="font-style: normal; text-transform: none; vertical-align: baseline"><u>'''<font color="#0023a9"><http://java.sun.com/javase/downloads/index.jsp></font>'''</u></span>. <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 Download and install<span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#0023a9"> </font></u></span><span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#0023a9">[http://ant.apache.org ][http://ant.apache.org Apache Ant 1.7]</font></u></span><span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#0023a9">.0 <http://ant.apache.org/></font></u></span>.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
|+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 13. Download pages for Java SE Development Kit (JDK) and Apache Ant 1.7.0<br /></font>'''</div> | ||
|- | |- | ||
| | | | ||
[[Image: | [[Image:MIPAVPluginsDownloadPages.jpg]] | ||
|} | |} | ||
==== Configuring the environment ==== | |||
<div style="font-style: normal; font-weight: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> To configure your environment, you need to add two new variables-<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">JAVA_HOME</font></span> and <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ANT_HOME</font></span>-and update the path variable in your system.<br /></font></div> | |||
===== On Windows workstations ===== | |||
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 Click Start > Control Panel. The Control Panel window opens.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 Double-click the System icon. The System Properties dialog box opens. <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 3 Click Advanced. The Advanced page of the System Properties dialog box appears.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 4 Click Environment Variables. The Environment Variables dialog box opens.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 5 Decide whether to add and edit variables in the User variables box or the System variables box based on which users should have access to the Java SDK and Ant.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 6 Add the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">JAVA_HOME</font></span> variable to your environment:<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> a Click New. The New User Variable dialog box or the New System Variable dialog box opens.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> b Type <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">JAVA_HOME</font></span> in Variable name.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> c Type the path for the Java SDK on your computer (e.g., <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">C:\Program Files\Java\jdk1.6.0_02</font></span>) in Variable value.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> d Click OK. The<span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000"> </font>''</span><span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">JAVA_HOME</font></span> variable appears in either the User variables box or System variables box as appropriate.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 7 Add the <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">ANT_HOME</font>'''</span> variable to your environment by doing the following:<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> a Click New under either the User variables box or the System variables box. The New User Variable dialog box or the New System Variables dialog box opens as appropriate.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> b Type <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">ANT_HOME</font>'''</span> in Variable name.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> c Type the path for the Ant on your computer (e.g., <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">C:\Program Files\Ant\apache-ant-1.7.0</font></span>) in Variable value.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> d Click OK. The <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ANT_HOME</font></span> variable appears in either the User variables box or System variables box as appropriate.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 8 Update either the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">PATH</font></span> variable in the User variables box or the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">Path</font></span> variable in the System variables box by doing the following:<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> a Select the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">PATH</font></span> variable in the User variables box, or select the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">Path</font></span> variable in the System variables box.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> b Click Edit under the User variables box, or click Edit under the System variables box. Either the Edit User Variable dialog box or the Edit System Variable dialog box opens.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> c Type <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"><nowiki>;%JAVA_HOME%\bin;%ANT_HOME%\bin</nowiki></font></span><span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"> </font></span>to the end of the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">PATH </font></span>variable or to the end of the Path variable.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> d Click OK. The edited variable appears either in the User variables box or the System variables box. See also Figure 14.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 9 Open a new terminal for the change to take effect by doing the following:<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> a Click Start > Run. The Run dialog box opens.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> b Type <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">cmd</font>'''</span> in Open, and click OK. A terminal window opens. <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 10 Retrieve the<span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000"> sample Ant build file (build.xml)</font></u></span> from the MIPAV web site and place it in the same directory as the plug-in<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">.java</font></span> files you want to compile.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 11 Alter the <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">dir.mipav</font>''</span> and <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">dir.jdk</font>''</span> properties within the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">build.xml</font></span> to point to the directory where MIPAV and the SDK are installed, respectively.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> | |||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
|+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 14. Configuring system variables for MS Windows<br /></font>'''</div> | ||
|- | |- | ||
| | | | ||
[[Image:EnvironmentVariables.jpg]] | |||
[[Image: | |||
|} | |} | ||
<br /> | <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 5pt; margin-left: 0pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Note:</font>'''</span> Add and edit the variables in the User variables box if you want to limit the build environment to just yourself and no other users. Add and edit the variables in the Systems variables box to make the environment accessible to anyone who uses the workstation.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Recommendation:</font>'''</span> Although it is possible to update the path variable in either the User variables box or System variables box, you should add the statement to the same box in which you added the <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">JAVA_HOME</font>''</span> and <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">ANT_HOME</font>''</span> variables. <br /></font></div> | ||
<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">See also:</font>'''</span> | |||
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -12pt; text-transform: none; vertical-align: baseline"><font color="#000000"> "Installing Ant" on <<span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000">[http://ant.apache.org/manual/index.html http://ant.apache.org/manual/index.html>]</font></u></span>.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -12pt; text-transform: none; vertical-align: baseline"><font color="#000000"> [http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html "JavaTM SE 6 Release Notes-Microsoft Windows Installation (32-bit)" on <]<span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000">http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html></font></u></span>.<br /></font></div> | |||
===== On Linux or UNIX workstations ===== | |||
Bash users should do the following: | |||
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 Edit the file <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">$HOME/.bash_profile</font></span> and add lines similar to following:<br /></font></div><div style="font-style: normal; margin-bottom: 2pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> <br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000"> ANT_HOME=/path/to/apache-ant-1.6.3<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000"> JAVA_HOME=/path/to/j2sdk1.4.2_08<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000"> PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000"> export ANT_HOME<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000"> export JAVA_HOME<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000"> export PATH<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> where <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ANT_HOME</font></span> and <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">JAVA_HOME</font></span><span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000"> </font>''</span>are the paths where each application was installed.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 [http://mipav.cit.nih.gov/documentation/presentations/plugins/build.xml Retrieve the ]<span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000">sample Ant build file</font></u></span> from the MIPAV web site, and place it in the same directory where the plug-in <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">.java</font></span> files you want to compile are located.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 3 Alter the <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">dir.mipav</font>''</span> and <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">dir.jdk</font>''</span> properties within <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">build.xml</font></span> to point to the directory where MIPAV and the SDK are installed, respectively.<br /></font></div> | |||
== | ==== Build.xml ==== | ||
<br /> | <div style="font-style: normal; font-weight: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">Figure 15 below displays the content of the <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">build.xml</font>'''</span> file. build.xml is also available on the MIPAV web site <span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000">[http://mipav.cit.nih.gov/documentation/presentations/plugins/build.xml <http://mipav.cit.nih.gov/documentation/presentations/plugins/build.xml>]</font></u></span><span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
|+ '''Figure | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 15. The contents of the build.xml file <br /></font>'''</div> | ||
|- | |- | ||
| | | | ||
<div style="font-style: normal; margin-bottom: 6pt; margin-left: 6pt; margin-right: 6pt; margin-top: 6pt; text-align: center; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> build.xml<br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 <!-- build file for MIPAV plugin class --><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 3 <project basedir="." default="compile" name="mipav_plugin"><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 4 <property name="dir.mipav" value="c:\\Program Files\\mipav\\"/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 5 <property name="dir.jdk" value="c:\\Program Files\\Java\\jdk1.6.0_02"/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 6 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 7 <target name="init"><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 8 <tstamp/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 9 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 10 <path id="build.classpath"><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 11 <pathelement path="${dir.mipav}"/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 12 <pathelement location="${dir.mipav}/InsightToolkit/lib/InsightToolkit/InsightToolkit.jar"/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 13 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 14 <fileset dir="${dir.mipav}"><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 15 <filename name="*.jar"/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 16 </fileset><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 17 </path><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 18 <property name="build.cp" refid="build.classpath"/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 19 </target><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 20 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 21 <target name="compile" depends="init"><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 22 <echo>classpath: ${build.cp}</echo><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 23 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 24 <javac debug="true" deprecation="true" description="Builds MIPAV" verbose="no" listfiles="yes" nowarn="no" fork="true" memoryInitialSize="220M" memoryMaximumSize="1000M" id="mipav build" source="1.4" target="1.4" destdir="." srcdir="." compiler="modern"><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 25 <classpath refid="build.classpath"/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 26 </javac><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 27 </target><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 28 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 29 <target name="clean" depends="init"><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 30 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 31 <delete><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 32 -<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 33 <fileset dir="."><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 34 <include name="**/*.class"/><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 35 </fileset><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 36 </delete><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 37 </target><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 38 </project><br /></font></div> | |||
|} | |} | ||
==== Compiling the plug-in files ==== | |||
<div style="font-style: normal; font-weight: normal; margin-bottom: 5pt; margin-left: 0pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Note:</font>'''</span> You should keep back-up copies of the source and compiled files in case you need to update or change the plug-in.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 Type <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ant compile</font></span> on your workstation (e.g., <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">cmd ant compile</font></span><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000"> </font>'''</span>on Windows or <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">xterm</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ant compile</font></span> on UNIX platforms). The BUILD SUCCESSFUL message should appear at the end of the Ant output.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 Copy the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">.class</font></span> files that Ant produced into MIPAV's plug-in directory.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -12pt; text-transform: none; vertical-align: baseline"><font color="#000000"> On Windows platforms:<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 4pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">C:\Documents and Settings\username\mipav\plugins</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -12pt; text-transform: none; vertical-align: baseline"><font color="#000000"> On UNIX platforms:<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 36pt; margin-right: 0pt; margin-top: 4pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">/home/username/mipav/plugins</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> where <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">username</font></span> is the name of your account on the system.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 3 Install the plug-in file. Select PlugIns > Install Plugin in the main MIPAV window. In the Install PlugIn dialog box, use the Browse buton to navigate to the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">\plugins</font></span> directory . Select the plug-in and Press OK.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> | |||
1 | |||
2 | |||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
|+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 16. Installing a MIPAV plug-in.<br /></font>'''</div> | ||
|- | |- | ||
| | | | ||
[[Image: | [[Image:MIPAV_installPlugIn.jpg]] | ||
|} | |} | ||
<br /> | <br /> | ||
[[Creating a self-contained plug-in frame]] | |||
[[ | |||
Revision as of 15:52, 22 February 2012
To build a new plug-in program for MIPAV, you must first install a build environment, alter the path environment variable, and compile the plug-in files.
Installing a build environment
1 Download and install Java SE Development Kit (JDK), version 1.6 (JDK 6u2) <http://java.sun.com/javase/downloads/index.jsp>.
Configuring the environment
To configure your environment, you need to add two new variables-JAVA_HOME and ANT_HOME-and update the path variable in your system.
On Windows workstations
1 Click Start > Control Panel. The Control Panel window opens.
2 Double-click the System icon. The System Properties dialog box opens.
3 Click Advanced. The Advanced page of the System Properties dialog box appears.
4 Click Environment Variables. The Environment Variables dialog box opens.
5 Decide whether to add and edit variables in the User variables box or the System variables box based on which users should have access to the Java SDK and Ant.
6 Add the JAVA_HOME variable to your environment:
a Click New. The New User Variable dialog box or the New System Variable dialog box opens.
b Type JAVA_HOME in Variable name.
c Type the path for the Java SDK on your computer (e.g., C:\Program Files\Java\jdk1.6.0_02) in Variable value.
d Click OK. The JAVA_HOME variable appears in either the User variables box or System variables box as appropriate.
7 Add the ANT_HOME variable to your environment by doing the following:
a Click New under either the User variables box or the System variables box. The New User Variable dialog box or the New System Variables dialog box opens as appropriate.
b Type ANT_HOME in Variable name.
c Type the path for the Ant on your computer (e.g., C:\Program Files\Ant\apache-ant-1.7.0) in Variable value.
d Click OK. The ANT_HOME variable appears in either the User variables box or System variables box as appropriate.
8 Update either the PATH variable in the User variables box or the Path variable in the System variables box by doing the following:
a Select the PATH variable in the User variables box, or select the Path variable in the System variables box.
b Click Edit under the User variables box, or click Edit under the System variables box. Either the Edit User Variable dialog box or the Edit System Variable dialog box opens.
c Type ;%JAVA_HOME%\bin;%ANT_HOME%\bin to the end of the PATH variable or to the end of the Path variable.
d Click OK. The edited variable appears either in the User variables box or the System variables box. See also Figure 14.
9 Open a new terminal for the change to take effect by doing the following:
a Click Start > Run. The Run dialog box opens.
b Type cmd in Open, and click OK. A terminal window opens.
10 Retrieve the sample Ant build file (build.xml) from the MIPAV web site and place it in the same directory as the plug-in.java files you want to compile.
11 Alter the dir.mipav and dir.jdk properties within the build.xml to point to the directory where MIPAV and the SDK are installed, respectively.
Note: Add and edit the variables in the User variables box if you want to limit the build environment to just yourself and no other users. Add and edit the variables in the Systems variables box to make the environment accessible to anyone who uses the workstation.
Recommendation: Although it is possible to update the path variable in either the User variables box or System variables box, you should add the statement to the same box in which you added the JAVA_HOME and ANT_HOME variables.
See also:
"Installing Ant" on <http://ant.apache.org/manual/index.html>.
"JavaTM SE 6 Release Notes-Microsoft Windows Installation (32-bit)" on <http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html>.
On Linux or UNIX workstations
Bash users should do the following:
1 Edit the file $HOME/.bash_profile and add lines similar to following:
ANT_HOME=/path/to/apache-ant-1.6.3
JAVA_HOME=/path/to/j2sdk1.4.2_08
PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin
export ANT_HOME
export JAVA_HOME
export PATH
where ANT_HOME and JAVA_HOME are the paths where each application was installed.
2 Retrieve the sample Ant build file from the MIPAV web site, and place it in the same directory where the plug-in .java files you want to compile are located.
3 Alter the dir.mipav and dir.jdk properties within build.xml to point to the directory where MIPAV and the SDK are installed, respectively.
Build.xml
Figure 15 below displays the content of the build.xml file. build.xml is also available on the MIPAV web site <http://mipav.cit.nih.gov/documentation/presentations/plugins/build.xml>.
build.xml 1 <!-- build file for MIPAV plugin class --> 2 - 3 <project basedir="." default="compile" name="mipav_plugin"> 4 <property name="dir.mipav" value="c:\\Program Files\\mipav\\"/> 5 <property name="dir.jdk" value="c:\\Program Files\\Java\\jdk1.6.0_02"/> 6 - 7 <target name="init"> 8 <tstamp/> 9 - 10 <path id="build.classpath"> 11 <pathelement path="${dir.mipav}"/> 12 <pathelement location="${dir.mipav}/InsightToolkit/lib/InsightToolkit/InsightToolkit.jar"/> 13 - 14 <fileset dir="${dir.mipav}"> 15 <filename name="*.jar"/> 16 </fileset> 17 </path> 18 <property name="build.cp" refid="build.classpath"/> 19 </target> 20 - 21 <target name="compile" depends="init"> 22 <echo>classpath: ${build.cp}</echo> 23 - 24 <javac debug="true" deprecation="true" description="Builds MIPAV" verbose="no" listfiles="yes" nowarn="no" fork="true" memoryInitialSize="220M" memoryMaximumSize="1000M" id="mipav build" source="1.4" target="1.4" destdir="." srcdir="." compiler="modern"> 25 <classpath refid="build.classpath"/> 26 </javac> 27 </target> 28 - 29 <target name="clean" depends="init"> 30 - 31 <delete> 32 - 33 <fileset dir="."> 34 <include name="**/*.class"/> 35 </fileset> 36 </delete> 37 </target> 38 </project>
|
Compiling the plug-in files
Note: You should keep back-up copies of the source and compiled files in case you need to update or change the plug-in.
1 Type ant compile on your workstation (e.g., cmd ant compile on Windows or xterm ant compile on UNIX platforms). The BUILD SUCCESSFUL message should appear at the end of the Ant output.
2 Copy the .class files that Ant produced into MIPAV's plug-in directory.
On Windows platforms:
C:\Documents and Settings\username\mipav\plugins
On UNIX platforms:
/home/username/mipav/plugins
where username is the name of your account on the system.
3 Install the plug-in file. Select PlugIns > Install Plugin in the main MIPAV window. In the Install PlugIn dialog box, use the Browse buton to navigate to the \plugins directory . Select the plug-in and Press OK.