Developing plug-in programs and Generating graphs: Difference between pages

From MIPAV
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
MIPAV>Angelfish100
 
Line 1: Line 1:
MIPAV provides the following classes for developing plug-in programs:
MIPAV allows you to generate intensity profiles, or contour VOI graphs, for VOI contours. For delineated VOIs, you can generate 2D, 3D, or 4D intensity graphs. You can also generate a 3D intensity graph at a specific point across all slices in a dataset. For information on how to contour a VOI, refer to Chapter 1, "Segmenting Images Using Contours and Masks,"<br />
PlugInAlgorithm.class<br />
PlugInFile.class<br />
PlugInView.class<br />


Plug-in programs are developed in the same way as the other Java programs are. The high-level steps of creating plug-ins follow.<br />
=== Generating contour VOI graphs ===
1 '''Determining the type of plug-in program''' -Before you begin to write the code for the plug-in, determine the plug-in type: algorithm, file, or view. Refer to "Determining the type of plug-in program".<br />
Contour VOI graphs display the intensity values of the selected contour's boundary in the Contour VOI Graph window (Figure 10). You can generate either 2D or 3D contour VOI graphs. <br />
2 '''Determining which version of Java to use''' -Detailed instructions appear in "Determining which version of Java to use" and Figure 5.<br />
3 '''Writing the source code''' -Some lines of code must appear in the source code so that the plug-in program interfaces correctly with MIPAV. Refer to "Writing the source code".<br />
4 '''Building and compiling plug-in programs''' -You should keep back-up copies of the source and compiled files in case you need to update or change plug-in programs. See "Building and compiling plug-in programs".<br />
5 '''Creating a self-contained plug-in frame<''' -A self-contained plug-in is a Java application that does not rely on the default MIPAV user-interface, but, instead, hides MIPAV and display its own image(s) with action/algorithm handling specific to its frame. See "Creating a self-contained plug-in frame".<br />
6 '''Installing plug-in programs''' -This section explains how to install plug-in programs. Refer to "Installing plug-in programs".<br />
7 '''Sample plug-in programs''' -This section provides a couple of examples of MIPAV plug-ins. Refer to "Examples of MIPAV plug-ins".<br />
'''Note:''' This section does not explain how to write a Java program; however, it explains what must be incorporated in the plug-in program so that it correctly interfaces with the MIPAV application.<br />


=== Determining the type of plug-in program ===
'''To generate 2D contour VOI graphs'''<br />
1 Open an image.<br />
2 Delineate a 2D VOI on the image using one of the 2D icons in the MIPAV window.<br />


The first step of creating a plug-in program is to determine the type you want to create, which depends on its purpose. As mentioned earlier, MIPAV plug-in programs can be of the algorithm, file, or view type. However, most users want MIPAV to perform very specific additional functions on images. Since these functions may not be currently available in MIPAV, users choose to add the functions by developing the algorithm type of plug-in program. <br />
=== Determining which version of Java to use ===
<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 avoid compatibility problems when you create a plug-in program, use the same version of Java that was used to create MIPAV. To determine which version of Java the latest version of MIPAV uses, select Help &gt; JVNM Information in the MIPAV window. The About System dialog box opens. See Figure 5.<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 5. About System dialog box'''
|+ '''Figure 10. Contour VOI Graph window '''
|-  
|-
| [[Image:MIPAV_API_JVM_Version.jpg]]  
| rowspan="1" colspan="3" |
|}
[[Image:windowContourVOIGraph.jpg]]
 
|-
<br /></font></div>
| rowspan="4" colspan="1" |
 
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">File</font>'''</span></div>
The first line in the About System dialog box indicates the version of Java that was used to develop MIPAV. To obtain the correct version of Java, go to the following web site:<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000"> &lt;</font>'''</span><span style="font-style: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><u><font color="#000000">[http://www.java.sun.com http://www.java.sun.com&gt;]</font></u></span>
| rowspan="1" colspan="2" |
 
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Open Graph</font>'''</span>-Opens a PLT file that contains graph data. When you select this command or press Ctrl O on the keyboard, the Open Graph Data dialog box appears. </div>
=== Writing the source code ===
|-
 
| rowspan="1" colspan="2" |
'''Note:''' In this section, \$MIPAV is used to represent the MIPAV user directory, which is the directory where MIPAV is installed. The user directory is indicated in the About System dialog box. In the MIPAV main window, select Help &gt; JVM Information to view the About System dialog box.<br />
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Save Graph</font>'''</span>-Saves the graph data in a PLT file. When you select this command or when you press Ctrl S on the keyboard, the Save dialog box opens.</div>
 
|-
When you develop a plug-in for MIPAV, several lines must be present in the code so that it executes properly. Some mandatory code should be included in <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">all</font>'''</span> plug-in files. Other code might change depending on the plug-in type.
| rowspan="1" colspan="2" |
 
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Print Graph</font>'''</span>-Allows you to print the graph. When you select this command or press <br />Ctrl P, the Print dialog box opens.</div>
==== Including mandatory code ====
|-
 
| rowspan="1" colspan="2" |
The next three figures (Figure 6- Figure8) show the mandatory source code needed for creating a file type of plug-in, a view type of plug-in, and an algorithm type of plug-in. The plug-ins directory of MIPAV includes these three files (e.g. C:\[$MIPAV]\mipav\plugins):
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Close Graph</font>'''</span>-Closes the Intensity Graph window. To close the window, you can also press Ctrl X on the keyboard.</div>
 
|-
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; 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">PlugInFile.java</font>'''</span>-Mandatory source code for a file type of plug-in. See Figure 6<nowiki>;</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; 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">PlugInView.java</font>'''</span>-Mandatory source code for a view type of plug-in. See Figure 7<nowiki>;</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; 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">PlugInAlgorithm.java</font>'''</span>-Mandatory source code for an algorithm type of plug-in. See Figure 8.<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">  {| 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 6. Mandatory code for a file type of plug-in (PlugInFile.java). For readability purposes, keywords in all code reproduced in this chapter appear in bold, and comments appear in green type<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">package</font>'''</span> gov.nih.mipav.plugins;<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> gov.nih.mipav.view.*;<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 <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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> java.awt.*;<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public interface</font>'''</span> PlugInFile <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">extends</font>'''</span> 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"> 8 <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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><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="#00ef07"> 10 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * run </font></span><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="#00ef07"> 11 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param UI MIPAV main user interface.</font></span><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="#00ef07"> 12 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public void </font>'''</span>run(ViewUserInterface UI);<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 }<br /></font></div> |} <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">  {| 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 7. Mandatory code for a view type of plug-in (PlugInView.java). For readability purposes, keywords in all code reproduced in this chapter appear in bold, and comments appear in green type<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">package</font>'''</span> gov.nih.mipav.plugins;<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> gov.nih.mipav.model.structures.*;<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> gov.nih.mipav.view.*;<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 <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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> java.awt.*;<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 <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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public interface</font>'''</span> PlugInView <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">extends</font>'''</span> 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"> 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 /<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>**</nowiki></font></span><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="#00ef07"> 11 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * run </font></span><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="#00ef07"> 12 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param UI MIPAV main user interface.</font></span><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="#00ef07"> 13 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param parentFrame frame that displays the MIPAV image.</font></span><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="#00ef07"> 14 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Can be used as a parent frame when building</font></span><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="#00ef07"> 15 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * dialogs.</font></span><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="#00ef07"> 16 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param image model of the MIPAV image. </font></span><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="#00ef07"> 17 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @see ModelImage</font></span><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="#00ef07"> 18 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @see ViewJFrameImage</font></span><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="#00ef07"> 19 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> *</font></span><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="#00ef07"> 20 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public void </font>'''</span>run(ViewUserInterface UI, Frame parentFrame, ModelImage image);<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 }<br /></font></div> |} {| 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 8. Mandatory code for an algorithm type of plug-in (PlugInAlgorithm.java). For readability purposes, keywords in all code reproduced in this chapter appear in bold, and comments appear in green type <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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">package</font>'''</span> gov.nih.mipav.plugins;<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> gov.nih.mipav.model.structures.*;<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import </font>'''</span>gov.nih.mipav.view.*;<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 <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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> java.awt.*;<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 <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 <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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public interface</font>'''</span> PlugInAlgorithm <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">extends</font>'''</span> 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"> 10 <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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* run </nowiki></font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @param UI MIPAV main user interface.</nowiki></font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param parentFrame frame that displays the MIPAV image.</font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* Can be used as a parent frame when building</nowiki></font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* dialogs.</nowiki></font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @param image model of the MIPAV image.</nowiki></font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @see ModelImage</nowiki></font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @see ViewJFrameImage</nowiki></font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>*</nowiki></font></span><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>*/</nowiki></font></span><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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public void</font>'''</span> run(ViewUserInterface UI, Frame parentFrame, ModelImage image);<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 <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 }<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 <br /></font></div> |} <br /></font>'''</div>
| rowspan="3" colspan="1" |
 
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Edit</font>'''</span></div>
==== Referencing files ====
| rowspan="1" colspan="2" |
 
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Delete Function</font>'''</span>-Allows you to delete a specific function. However, you cannot delete a function if it is the only function displayed in the window.</div>
To reference a class, you must specify it using the Import keyword. For example, line 2 in PlugInFile.java imports the view functions (Figure 9).
|-
 
| rowspan="1" colspan="2" |
<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">
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Copy Function</font>'''</span>-Copies a function that is currently displayed in the window.</div>
 
|-
{| border="1" cellpadding="5"
| rowspan="1" colspan="2" |
|+ '''Figure 9. Importing the view functions in PlugInFile.java '''
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Paste Function</font>'''</span>-Pastes a previously copied function into the window. The pasted function has a different color than the first function displayed in the window.</div>
|-
| rowspan="3" colspan="1" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Views</font>'''</span></div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Modify Graph Features</font>'''</span>-Allows you to customize the appearance of the graph.</div>
|-
|-
|
| rowspan="1" colspan="2" |
<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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> gov.nih.mipav.view.*;<br /></font></div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Reset Range to Default</font>'''</span>-<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">[TBD]</font>'''</span></div>
|}
 
<br /></font></div>
 
Lines 3, 4, and 6 in the PlugInView.java and PlugInAlgorithm.java files import the model structures, view functions, and the basic Java package that has GUI functions (Figure 10).
 
<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"
|+ <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 10. Importing model structures, view functions, and <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">[java.awt] </font>'''</span><br /></font>'''</div>
|-
|-
|
| rowspan="1" colspan="2" |
<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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> gov.nih.mipav.model.structures.*; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// MIPAV package where main</font></span><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="#00ef07"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // MIPAV structures are located (e.g., model image)</font></span><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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> gov.nih.mipav.view.*;<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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">import</font>'''</span> java.awt.*<br /></font></div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Reset Graph to Original</font>'''</span>-<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">[TBD]</font>'''</span>. </div>
|}
 
<br /></font></div>
 
If you reference a class, you must include it in the plug-in package so that it can be called from the main file. After you write and compile, you must now install files in the user or home directory:
 
<div style="font-style: 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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Windows</font>'''</span><br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; 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\&lt;user ID&gt;\mipav\plugins</font></span><br /></font></div><div style="font-style: 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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">UNIX</font>'''</span><br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; 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">/user/&lt;user ID&gt;/mipav/plugins</font></span><br /></font></div>
 
An example of this appears in the first line of Figure 11.
 
<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"
|+ <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 11. Example of placing referenced files in the \$MIPAV\plugins directory<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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">package</font>'''</span> plugins; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// added to plugins pkg. so PlugInSampleStub may</font></span><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">  <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// call it.</font></span><br /></font></div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Help</font>'''</span></div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Help Topics</font>'''</span>-Displays online help topics.</div>
|}
|}


<br /></font></div>
<br />
3 Select the VOI. <br />
As an option, copy the VOI to other slices in the dataset by selecting VOI &gt; Propagate and one of the following commands:<br />
*To Next Slice<br />
*To Previous Slice<br />
*To All Slices<br />
4 Do one of the following:<br />
*Select VOI &gt; Graph &gt; Boundary Intensity in the MIPAV window. <br />
*Right click on the VOI and then select Graph &gt; Boundary Intensity.<br />
*The Contour VOI Graph window (Figure 10) opens.<br />


==== Lines of code that are dependent on plug-in type ====
'''To generate 3D contour VOI graphs'''<br />
1 Open an image.<br />
2 Delineate a VOI on the image using the 3D rectangular VOI icon, in the MIPAV window. <br />
3 Select the VOI. <br />
As an option, copy the VOI to other slices in the dataset by selecting VOI &gt; Propagate and one of the following commands:<br />
*To Next Slice<br />
*To Previous Slice<br />
*To All Slices<br />
4 Do one of the following:<br />
*Select VOI &gt; Graph &gt; Boundary Intensity in the MIPAV window.<br />
*Right-click on the VOI and then select Graph &gt; Boundary Intensity. <br />
The Contour VOI Graph window (Figure 10) opens. This window displays a graph of the intensity values of the selected contour's boundary. <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"> Two lines of code depend on the type of plug-in program being developed:<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 5pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000">  Declaration<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -24pt; text-transform: none; vertical-align: baseline"><font color="#000000">  Parameters for the run method <br /></font></div>
=== Generating intensity graphs ===
Intensity profiles, or graphs, present information on the intensity values of the VOI region in an image. The intensity graph appears in the Intensity Graph window (Figure 11).<br />


===== Declaration =====
'''To generate 2D intensity graphs'''<br />
 
1 Open an image.<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"> The declaration used in a plug-in depends on the type of plug-in being developed. For instance, in line 9 in PlugInAlgorithm.java (Figure 8), the combination of words "<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public interface</font>'''</span> <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">PlugInAlgorithm"</font>''</span> indicates that the plug-in in an Algorithm. For File or View types of plug-ins, simply replace <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">PlugInAlgorithm</font>''</span> with <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">PlugInFile </font>''</span>(line 7 in PlugInFile.java, see [MIPAV_Plugins.html#1465012 Figure 310]) or <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">PlugInView </font>''</span>(line 8 in PlugInView.java, see Figure 7), 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">
2 Delineate a 2D VOI on the image using one of the 2D icons in the MIPAV window.<br /><
3 Select the VOI. <br />
As an option, copy the VOI to other slices in the dataset by selecting VOI &gt; Propagate and one of the following commands:<br />
*To Next Slice<br />
*To Previous Slice<br />
*To All Slices<br />
4 Do one of the following:<br />
Select VOI &gt; Graph in the MIPAV window and either of the following:<br />
* ''2.5D Total Intensity'' -To generate a graph of the sum of the intensity values of the VOI region. <br />
* ''2.5D Average Intensity'' -To generate a graph of the average of the intensity values of the VOI region.<br />
Right-click on the VOI and then select Graph and one of the following commands:<br />
* ''2.5D Total Intensity'' -To generate a graph of the sum of the intensity values of the area delineated by the VOI per slice.<br />
* ''2.5D Average Intensity'' -To generate a graph of the average of the intensity values of the VOI region.<br />
* ''2.5D Total Intensity with Threshold'' -TBD. <br />
* ''2.5D Average Intensity with Threshold'' -TBD.<br />
The Intensity Graph window (Figure 11) opens.


{| border="1" cellpadding="5"
{| border="1" cellpadding="5"
|+ <div class="TableTitle">Table 4. Declarations dependent on type of plug-in</div>
|+ '''Figure 11. Intensity Graph window '''
|- bgcolor="#CCCCCC"
!
<div class="CellHeading">Type of plug-in</div>
!
<div class="CellHeading">Declaration</div>
|-
|-
|
|
<div class="CellBody">File</div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">File</font>'''</span></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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public interface</font>'''</span> PlugInFile <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">extends</font>'''</span> PlugIn (<br /></font></div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Open Graph</font>'''</span>-Opens a PLT file that contains graph data.</div> <div class="CellBody">When you select this command or press Ctrl O on the keyboard, the Open Graph Data dialog box appears. </div>
| rowspan="2" colspan="1" |
[[Image:VOIGRaphMOdifyPointsVis.jpg]]
|-
|-
|
|
<div class="CellBody">View</div>
<div class="CellBody"> </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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public interface</font>'''</span> PlugInView <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">extends</font>'''</span> PlugIn (<br /></font></div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Save Graph</font>'''</span>-Saves the graph data in a PLT file. </div> <div class="CellBody">When you select this command or when you press Ctrl S on the keyboard, the Save dialog box opens.</div>
|-
|-
|
|
<div class="CellBody">Algorithm</div>
<div class="CellBody"> </div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Print Graph</font>'''</span>-Allows you to print the graph. When you select this command or press <br />Ctrl P, the Print dialog box opens.</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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public interface</font>'''</span> PlugInAlgorithm <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">extends</font>'''</span> PlugIn (<br /></font></div>
<div class="CellBody"> </div>
|}
| rowspan="1" colspan="2" |
 
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Close Graph</font>'''</span>-Closes the Intensity Graph window. To close the window, you can also press Ctrl X on the keyboard.</div>
<br /></font></div>
 
===== Parameters for the run method =====
 
<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"> The parameters for the run method also depend on the plug-in type. Compare the run methods used in PlugInFile.java (Figure 6), PlugInView.java (Figure 7), and PlugInAlgorithm.java (Figure 8).<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"
|+  <div class="TableTitle">Table 5.  Parameters for run methods dependent on type of plug-in</div>
|- bgcolor="#CCCCCC"
!
<div class="CellHeading">Type of plug-in</div>
!
<div class="CellHeading">Parameters for the run method</div>
|-
|-
|
|
<div class="CellBody">File</div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Edit</font>'''</span></div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Delete Function</font>'''</span>-Allows you to delete the function that you select. However, you cannot delete a function if it is the only function displayed in the window.</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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public void</font>'''</span> run(ViewUserInterface UI);<br /></font></div>
<div class="CellBody"> </div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Paste Function</font>'''</span>-Pastes a previously copied function into the window. The pasted function has a different color than the first function displayed in the window.</div>
|-
|-
|
|
<div class="CellBody">View</div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Views</font>'''</span></div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Modify Graph Features</font>'''</span>-Allows you to customize the appearance of the graph.</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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public void</font>'''</span> run(ViewUserInterface UI, Frame parentFrame, ModelImage image);<br /></font></div>
<div class="CellBody"> </div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Reset Range to Default</font>'''</span>-TBD.</div>
|-
|-
|
|
<div class="CellBody">Algorithm</div>
<div class="CellBody"> </div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Reset Graph to Original</font>'''</span>-TBD.</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"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">public void</font>'''</span> run(ViewUserInterface UI, Frame parentFrame, ModelImage image);<br /></font></div>
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Help</font>'''</span></div>
| rowspan="1" colspan="2" |
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Help Topics</font>'''</span>-Displays online help topics.</div>
|}
|}


<br /></font></div> <div class="CellBody">
'''To generate 3D intensity graphs of all slices in a dataset at a specific point'''<br />
1 Open an image.<br />
2 Draw a point VOI on the image (Figure 12).<br />
3 Select the VOI.<br />
4 Do one of the following:<br />
*Select the Propagate VOI to all slices icon.<br />
*Select VOI &gt; Propagate &gt; To All Slices. <br />
*Right-click on the VOI, then select Propagate &gt; To All Slices (Figure 12).<br />
5 Right-click on the VOI and select Show VOI Graph (Figure 12).<br />


{| 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 12. PlugInAlgorithm.java. For readability purposes, keywords in all code reproduced in this chapter appear in bold, and comments appear in green type<br /></font>'''</div>
|+ '''Figure 12. Point VOI'''
|-
|-
|
|
<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 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">package</font>'''</span> gov.nih.mipav.plugins;<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 import gov.nih.mipav.model structures.*;<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 import gov.nih.mipav.view.*;<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 <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 import java.awt *;<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 <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 public interface PlugInAlgorithm extends 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"> 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="#00ef07"> 10 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><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="#00ef07"> 11 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* run </nowiki></font></span><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="#00ef07"> 12 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @param UI MIPAV main user interface.</nowiki></font></span><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="#00ef07"> 13 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @param parentFrame Frame that displays the MIPAV image.</nowiki></font></span><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="#00ef07"> 14 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* Can be used as a parent frame when building dialogs.</nowiki></font></span><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="#00ef07"> 15 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @param image Model of the MIPAV image.</nowiki></font></span><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="#00ef07"> 16 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @see ModelImage</nowiki></font></span><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="#00ef07"> 17 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* @see ViewJFrameImage</nowiki></font></span><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="#00ef07"> 18 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>*/</nowiki></font></span><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 public void run(ViewUserInterface UI, Frame parentFrame, ModelImage image;)<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 }<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"> <br /></font></div>
|}


</div>
<br clear="all" />


{|
|
[[Image:PointVOIPropagate.jpg]]
|}


'''To generate 3D intensity graphs of specific areas'''<br />
1 Open an image.<br />
2 Delineate a VOI on the image using the 3D rectangular VOI icon.<br />
3 Select the VOI. Then, do one of the following:<br />
*a Select VOI &gt; Graph and either of the following in the MIPAV window:<br />
** ''2.5D Total Intensity'' -To generate a graph of the sum of the intensity values of the area delineated by the VOI per slice.<br />
** ''2.5D Average Intensity'' -To generate a graph of the average of the intensity values of the VOI region.<br />
*b Right-click the VOI, and then select Graph and one of the following commands in the MIPAV window:<br />
** ''2.5D Total Intensity'' -To generate a graph of the sum of the intensity values of the area delineated by the VOI per slice.<br />
** ''2.5D Average Intensity'' -To generate a graph of the average of the intensity values of the VOI region.<br />
** ''2.5D Total Intensity with Threshold'' -TBD.<br />
** ''2.5D Average Intensity with Threshold'' -TBD.<br />
The Intensity Graph window (Figure 11) opens.<br />


'''Next:''' [[Building and compiling plug-in programs]]


== See also: ==
[[Customizing the appearance of graphs - Modify graph dialog box]]
*[[Understanding plug-in programs]]
*[[Using the API documentation]]
*[[Developing plug-in programs]]
*[[Creating a self-contained plug-in frame]]
*[[Installing a plug-in]]
*[[Examples of MIPAV plug-ins]]
**[[Plug-in CT_MD, a typical plug-in program]]
***[[PlugInAlgorithmCT_MD.java]]
***[[Plug-in CT_MD.java]]

Revision as of 20:22, 21 February 2012

MIPAV allows you to generate intensity profiles, or contour VOI graphs, for VOI contours. For delineated VOIs, you can generate 2D, 3D, or 4D intensity graphs. You can also generate a 3D intensity graph at a specific point across all slices in a dataset. For information on how to contour a VOI, refer to Chapter 1, "Segmenting Images Using Contours and Masks,"

Generating contour VOI graphs

Contour VOI graphs display the intensity values of the selected contour's boundary in the Contour VOI Graph window (Figure 10). You can generate either 2D or 3D contour VOI graphs.

To generate 2D contour VOI graphs
1 Open an image.
2 Delineate a 2D VOI on the image using one of the 2D icons in the MIPAV window.


Figure 10. Contour VOI Graph window

WindowContourVOIGraph.jpg

File
Open Graph-Opens a PLT file that contains graph data. When you select this command or press Ctrl O on the keyboard, the Open Graph Data dialog box appears.
Save Graph-Saves the graph data in a PLT file. When you select this command or when you press Ctrl S on the keyboard, the Save dialog box opens.
Print Graph-Allows you to print the graph. When you select this command or press
Ctrl P, the Print dialog box opens.
Close Graph-Closes the Intensity Graph window. To close the window, you can also press Ctrl X on the keyboard.
Edit
Delete Function-Allows you to delete a specific function. However, you cannot delete a function if it is the only function displayed in the window.
Copy Function-Copies a function that is currently displayed in the window.
Paste Function-Pastes a previously copied function into the window. The pasted function has a different color than the first function displayed in the window.
Views
Modify Graph Features-Allows you to customize the appearance of the graph.
Reset Range to Default-[TBD]
Reset Graph to Original-[TBD].
Help
Help Topics-Displays online help topics.


3 Select the VOI.
As an option, copy the VOI to other slices in the dataset by selecting VOI > Propagate and one of the following commands:

  • To Next Slice
  • To Previous Slice
  • To All Slices

4 Do one of the following:

  • Select VOI > Graph > Boundary Intensity in the MIPAV window.
  • Right click on the VOI and then select Graph > Boundary Intensity.
  • The Contour VOI Graph window (Figure 10) opens.

To generate 3D contour VOI graphs
1 Open an image.
2 Delineate a VOI on the image using the 3D rectangular VOI icon, in the MIPAV window.
3 Select the VOI.
As an option, copy the VOI to other slices in the dataset by selecting VOI > Propagate and one of the following commands:

  • To Next Slice
  • To Previous Slice
  • To All Slices

4 Do one of the following:

  • Select VOI > Graph > Boundary Intensity in the MIPAV window.
  • Right-click on the VOI and then select Graph > Boundary Intensity.

The Contour VOI Graph window (Figure 10) opens. This window displays a graph of the intensity values of the selected contour's boundary.

Generating intensity graphs

Intensity profiles, or graphs, present information on the intensity values of the VOI region in an image. The intensity graph appears in the Intensity Graph window (Figure 11).

To generate 2D intensity graphs
1 Open an image.
2 Delineate a 2D VOI on the image using one of the 2D icons in the MIPAV window.
< 3 Select the VOI.
As an option, copy the VOI to other slices in the dataset by selecting VOI > Propagate and one of the following commands:

  • To Next Slice
  • To Previous Slice
  • To All Slices

4 Do one of the following:
Select VOI > Graph in the MIPAV window and either of the following:

  • 2.5D Total Intensity -To generate a graph of the sum of the intensity values of the VOI region.
  • 2.5D Average Intensity -To generate a graph of the average of the intensity values of the VOI region.

Right-click on the VOI and then select Graph and one of the following commands:

  • 2.5D Total Intensity -To generate a graph of the sum of the intensity values of the area delineated by the VOI per slice.
  • 2.5D Average Intensity -To generate a graph of the average of the intensity values of the VOI region.
  • 2.5D Total Intensity with Threshold -TBD.
  • 2.5D Average Intensity with Threshold -TBD.

The Intensity Graph window (Figure 11) opens.

Figure 11. Intensity Graph window
File
Open Graph-Opens a PLT file that contains graph data.
When you select this command or press Ctrl O on the keyboard, the Open Graph Data dialog box appears.

VOIGRaphMOdifyPointsVis.jpg

Save Graph-Saves the graph data in a PLT file.
When you select this command or when you press Ctrl S on the keyboard, the Save dialog box opens.
Print Graph-Allows you to print the graph. When you select this command or press
Ctrl P, the Print dialog box opens.
Close Graph-Closes the Intensity Graph window. To close the window, you can also press Ctrl X on the keyboard.
Edit
Delete Function-Allows you to delete the function that you select. However, you cannot delete a function if it is the only function displayed in the window.
Paste Function-Pastes a previously copied function into the window. The pasted function has a different color than the first function displayed in the window.
Views
Modify Graph Features-Allows you to customize the appearance of the graph.
Reset Range to Default-TBD.
Reset Graph to Original-TBD.
Help
Help Topics-Displays online help topics.

To generate 3D intensity graphs of all slices in a dataset at a specific point
1 Open an image.
2 Draw a point VOI on the image (Figure 12).
3 Select the VOI.
4 Do one of the following:

  • Select the Propagate VOI to all slices icon.
  • Select VOI > Propagate > To All Slices.
  • Right-click on the VOI, then select Propagate > To All Slices (Figure 12).

5 Right-click on the VOI and select Show VOI Graph (Figure 12).

Figure 12. Point VOI


PointVOIPropagate.jpg

To generate 3D intensity graphs of specific areas
1 Open an image.
2 Delineate a VOI on the image using the 3D rectangular VOI icon.
3 Select the VOI. Then, do one of the following:

  • a Select VOI > Graph and either of the following in the MIPAV window:
    • 2.5D Total Intensity -To generate a graph of the sum of the intensity values of the area delineated by the VOI per slice.
    • 2.5D Average Intensity -To generate a graph of the average of the intensity values of the VOI region.
  • b Right-click the VOI, and then select Graph and one of the following commands in the MIPAV window:
    • 2.5D Total Intensity -To generate a graph of the sum of the intensity values of the area delineated by the VOI per slice.
    • 2.5D Average Intensity -To generate a graph of the average of the intensity values of the VOI region.
    • 2.5D Total Intensity with Threshold -TBD.
    • 2.5D Average Intensity with Threshold -TBD.

The Intensity Graph window (Figure 11) opens.


Customizing the appearance of graphs - Modify graph dialog box