Creating a self-contained plug-in frame and Creating new images: Difference between pages

From MIPAV
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
MIPAV>Olgavovk
 
Line 1: Line 1:
You can create a self-contained plug-in that does not rely on the default MIPAV user interface. When running, this type of plug-in hides MIPAV and displays its own image(s) with the action and algorithm handling specific to its frame.<br />
<div id="CreatingImages"></div>
== To create a self-contained plug-in: ==
== Creating new images ==
[[File:RawDialogBox.jpg|350px|thumb|right|Raw dialog box]]


<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 Extend <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewJFrameImage</font></span>, as this will allow the plug-in to use a wide-range of <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewJFrameImage</font></span> and <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewJFrameBase</font></span> specific functions for storing and displaying <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ModelImages</font></span>. These functions include, for example, the image and on-screen buffers, menu and toolbar builders, etc.<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 Override the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewOpenFrameInterface</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">openFrame(ModelImage) </font></span>function. This handles the creation of a new <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">PlugIn</font></span> frame based on whether a result image is created within the dialog of an algorithm. For example, when the user runs an algorithm and selects the destination New Image rather than Replace Image, a new frame will be created with the result of the algorithm. To set all algorithms to work in place and disallow creating of new frames, call <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewUserInterface setForceInPlace(true)</font></span> function, which tells the dialogs that all algorithms must work in place.<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 Create an <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">init()</font></span> function, where the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">PlugIn</font></span> frame is layout and components will be initialized. <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 In the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">init()</font></span> function, several methods should be called:<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">  Call <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">initLUT()</font></span> for the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ModelImage</font></span> look-up table,<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">  Call <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">initResolutions()</font></span> for the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ModelImage</font></span> resolutions,<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">  Call <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">initZoom()</font></span> for the frame's zoom factor,<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">  <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">initComponentImage()</font></span> creates a displayable <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ComponentImage</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">  <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">initExtentsVariables()</font></span> initializes z-slice and time-slice positions.<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 To add toolbars and menus to your plug-in, within <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">init()</font></span>,<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"> </font></span>create a <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewControlsImage</font></span> object, and then<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">  Call <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">buildToolBar() </font></span>to create pre-defined toolbars for image, VOI, paint, and scripting controls; <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">  Or call <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">buildSimpleToolBar</font></span> and pass <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">Vector&lt;CustomUIBuilder.UIParams&gt;</font></span> using <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">addCustomToolBar()</font></span> for each of the Vectors.<br /></font></div>
'''To create a new image file:'''<br />
<ol>
<li>Do one of the following: </li>
<ul>
<li>If an image file is not already open, select File &gt; Open Image(A) &gt; Create Blank Image.</li>
<li>If an image file is already open, select File &gt; Load Image (B)&gt; Create Blank Image. The [[#ImageDialod |Raw dialog box]] appears.</li>
</ul>
<li>In the dialog box, select the image type. </li>
<li>Select the units of measure for each dimension. </li>
<li> Enter the header offset and byte ordering information.</li>
<li>Click OK. A blank image appears in an image window.</li>
<li>Use the paint and VOI tools to create an image.</li>
<li>Click File &gt; Save image as. The Save dialog box opens.</li>
<li>Type the name of the file in File Name, and select the file type in Files of type.</li>
<li>Click OK. MIPAV saves the image under the file type you selected.</li>
</ol>


Pre-defined button and menu parameters are located in <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">CustomUIBuilder</font></span>. Pre-defined as well as the user-defined <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">UIParams</font></span> can be added and used in both toolbars and menus.
<div id="ImageDialod"></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 Create <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewMenuBar</font></span>. This allows you to add either pre-defined or <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">UIParam</font></span> menus. The Vector from above (used on the custom toolbar) can be passed into the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewMenuBar</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">makeCustomMenu() </font></span>function. <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewMenuBar</font></span> also has pre-defined menus for a file, help, image, look-up tables, etc.<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 Finally, the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">init()</font></span> function should handle the container for the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewJComponentEditImage</font></span> created from <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">initComponentImage()</font></span>. The component image should be added to a <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">JScrollPane</font></span> to accommodate the variable size of the display.<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 Override the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">actionPerformed() </font></span>method to catch (handle) <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ActionEvents</font></span>. If a custom toolbar and (or) menu bar was created using a Vector of <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">UIParams</font></span>, the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">UIParam</font></span> contains the action event for each button and (or) menu item.<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 Override the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">componentResized()</font></span> method to properly handle (or ignore) the resizing of the plug-in frame. Using the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewJFrameImage</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">componentResized</font></span> function would likely create unwanted behavior as the layout of the plug-in is different from MIPAV's standard <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewJFrameImage</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: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  10 Create a basic <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">PlugInGeneric</font></span> class that will be called as a command-line argument. This class should have the ability to choose/open a <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ModelImage</font></span> using the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">FileIO.readImage()</font></span> method. The self-contained plug-in frame should be instantiated within this class by passing in the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ModelImage</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: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  11 When running MIPAV, pass in the arguments <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"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">-hide</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">-p [YourGenericPlugin]</font></span>. The <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">-hide</font></span> flag tells MIPAV not to bring up the User Interface and <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">MessageFrame</font></span>, while the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">-p</font></span> flag tells which plug-in to run. See Figure 17.<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">


== Image dialog box ==
{| 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 17. The arguments for running the self-contained plug-in frame.<br /></font>'''</div>
|+ <br />'''
|-
|-
|
|
[[Image:MIPAV_SimpleImageFramePlugInRun.jpg]]
'''Image type'''
|}
| rowspan="1" colspan="2" |
Synonymous with data type. The image type determines the number of intensities that can be represented in an image. For example, a Boolean image can display two intensities: 1 and 0. See also [[Supported Formats]].
 
'''Boolean'''-1 bit per pixel (1 on, 0 off)
 
'''Unsigned byte'''-1 byte per pixel (0, 255)
 
'''Unsigned short'''-2 bytes per pixel (0, 65535)
 
'''Unsigned integer'''-4 bytes per pixel (0, 232 -1)
 
'''Float'''-4 bytes per pixel (-3.4E38, 3.4E38)
 
'''ARGB'''-3 bytes per pixel, plus 1 byte; 8 bits per color channel (alpha, red, green, and blue)


'''Byte'''-1 byte per pixel (-128, 127)


===== Optional: =====
'''Short'''-2 bytes per pixel (-32768, 32767)


The<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"> ViewJFrameMessage</font></span> Data and Debug tabs (as well as others) can be added to the plug-in frame by retrieving the <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">JTabbedPane</font></span> through <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">ViewUserInterface.getReference().getMessageFrame().getTabbedPane()</font></span>. This enables the Data and Debug message output to be displayed outside of the separate message frame that accompanies MIPAV.
'''Integer'''-4 bytes per pixel (-231, 231-1)


See also: Figure 18 and Figure 19.
'''Long'''-8 bytes per pixel (-9.22E18, 9.22E18)


<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">
'''Double'''-8 bytes per pixel (-1.8E308, 1.8E308)


{| border="1" cellpadding="5"
'''ARGB U short'''-2 bytes per color channel and 2 bytes for alpha channel
|+ <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 18. A part of the code for PlugInDialogImageVOIDisplay.java. The full code can be found in "Examples of MIPAV plug-ins", Figure 28.<br /></font>'''</div>
|-
|-
|
|
PlugInDialogImageVOIDisplay.java
'''Dimensions and resolutions'''
| rowspan="1" colspan="2" |
Degree of manifolding of a quantity such as space or time. Two-dimensional datasets are composed of one image (the two dimensions are length and width). Generally, three-dimensional datasets are composed of more than one image. The third dimension is generally space. The fourth dimension is generally time. (Either time or space can be the third or fourth dimensions.) Zeros in the text boxes indicate that the dimension is not represented in the image. For example, if the text boxes for the first and second dimensions are filled, and the rest of the text boxes are filled with a zero, the image only has two dimensions.
Dimensions
 
1st-Width (along x axis)


<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; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import java.awt.*;</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"> 2 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import java.awt.event.*;</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"> 3 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import java.util.Vector;</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"> 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; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import javax.swing.*;</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"> 6 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import gov.nih.mipav.model.file.FileInfoBase;</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"> 7 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import gov.nih.mipav.model.structures.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="#000000"> 8 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import gov.nih.mipav.model.structures.ModelLUT;</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"> 9 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import gov.nih.mipav.model.structures.ModelRGB;</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"> 10 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import gov.nih.mipav.model.structures.VOI;</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"> 11 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">import gov.nih.mipav.view.*;</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="#000000">import gov.nih.mipav.view.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="#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 <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="#000000">/**</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="#000000"> * Plugin example class for creating a simple, self-contained frame that extends ViewJFrame 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"> 17 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"> * Contains a subset of the VOI functions, as well as the message frame contained within the frame itself</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="#000000"> * @author linkb</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="#000000"> *</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="#000000"> */</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="#000000">public class PlugInDialogImageVOIDisplay extends ViewJFrameImage implements MouseListener, AdjustmentListener {</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 <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 <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: 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 <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: 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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"> </font></span> //~ Constructors ---------------------------------------------------------------------------------------------------<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><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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">/**</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"> 28 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c"><nowiki>*</nowiki></font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">Default</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">constructor</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"> 29 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c"><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"> 30 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">public</font>'''</span> PlugInDialogImageVOIDisplay(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"> 31 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">super</font>'''</span>(image, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">null</font>'''</span>, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">null</font>'''</span>, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">false</font>'''</span>, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">false</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"> 32 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"> 33 }<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 <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 <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 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">/**</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"> 37 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c"><nowiki>*</nowiki></font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">ViewOpenFrameInterface</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">function</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">for</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">opening</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">a</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">model</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">image</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">(result)</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">into</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">a</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">new</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c">frame</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"> 38 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00007c"><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"> 39 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">public</font>'''</span> PlugInDialogImageVOIDisplay openFrame(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"> 40 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">return</font>'''</span> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#7c9ebc">new</font>'''</span> PlugInDialogImageVOIDisplay(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"> 41 }<br /></font></div>
2nd-Length (along y axis)
 
3rd-Depth (along z axis)
 
4th-Time (along t axis)
 
5th-Fifth dimension
 
Resolutions
 
Size of pixel or voxel per dimensions 1 through 5.
|-
|
'''Units of measure'''
| rowspan="1" colspan="2" |
Indicates the unit of measurement for each of the applicable dimensions.
|-
|
'''Header offset'''
| rowspan="1" colspan="2" |
Indicates the size of the space reserved at the beginning of the file where specific types of information is kept. This space, which is called the header, precedes the image data. If you know the length of the header, type it in this box. When MIPAV accesses the file, it skips the header offset and begins to read the image data. Note that not all image file formats have a header.
|-
|
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Big endian</font>'''</span></div>
| rowspan="1" colspan="2" |
Indicates whether image data is stored in the big endian format. If not, the image data is stored in the little endian format. Endianess refers to the byte ordering of the data. Some computers order the data with the least significant byte (LSB) first followed by the most significant byte (MSB). This byte order is referred as little endian or Intel byte ordering. Machines that use little-endian byte ordering are VAXes, Intel x86, and Pentium. The reverse is MSB and then LSB, which is referred as big endian or Motorola byte ordering. Machines that use big-endian byte ordering are IBM System 3D, RISC, and a Motorola 680x0. MIPAV is biendian; it supports both big- and little-endian byte-ordering formats.
|-
|
<div class="CellBody"><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">OK</font>'''</span></div>
| rowspan="1" colspan="2" |
Applies the parameters that you specified and creates a blank image.
|-
|
'''Cancel'''
| rowspan="1" colspan="2" |
>Disregards any changes you made in this dialog box, closes the dialog box, and does not create a blank image.
|-
|
'''Help'''
| rowspan="1" colspan="2" |
Displays online help for this dialog box.
|}
|}


<br /></font></div>
== Annotating images with text ==
[[File:AnnotatingWithTexst.jpg|200px|thumb|right|The Annotation dialog box]]
[[Image:AnnotataTExtIco.jpg]] You can use the Annotation tool icon located on [[MIPAV toolbars | VOI toolbar]] to place text directly on an image at any position on the image. You can use any font family, or typeface, that is installed on your computer to display the text.


<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 id="AnnotateImages"></div>
=== To annotate images with text:===


<ol>
<li>Open an image.</li>
<li>Click the Annotation tool icon. The Annotation dialog box  opens.</li>
<li>Click the image on which you want the text to appear. The image becomes the active image.</li>
<li>Select the font family and style (bold or italic). To select a regular font style, simply specify the font family.</li>
<li>Type the font size of type in the '''pt.''' box.</li>
<li>Press Enter. The Annotation dialog box either enlarges or reduces in size depending on the type size you chose.</li>
<li>Click Color to select the color of the text. The color of the type in the Text box changes to the color you have chosen.</li>
<li>Select "Enter text here" and type the text that you want to display on the image in the Text box.</li>
<li> Click OK. The text appears near the top of the image.</li>
<li> Click the text and drag it to any position on the image.</li>
</ol>
=== Annotation dialog box ===
{| 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 19. The Simple Image Frame plug-in opens the MIPAV independent image frame for a selected image. (a) The image frame contains the following elements of the interface - the VOI toolbar, image slice slider and menu bar. The Gradient Magnitude algorithm was called from the menu and applied to the image. (b) The result image opened in a new image frame.<br /></font>'''</div>
|+''' Annotation dialog box'''<br />
|-
|'''Font options'''
|'''Font'''-Specifies the font family, or typeface, for the text. When you select another typeface, "Enter text here" appears in that typeface.
|-
|
|'''Bold'''-Specifies that the type style should be bold.
|-
|
|'''Italic'''-Specifies that the type style should be italic.
|-
|-
|
|
[[Image:MIPAV_SimpleImageFramePlugIn.jpg]]
|'''Pt. (point) size'''-Specifies the point size of the typeface.
|-
|
|'''Color'''-Specifies the color of the text. When you click this box, the Pick VOI Color dialog box opens.
|-
|'''Text'''
|rowspan="1" colspan="2" |Displays the text that should appear on the image.
|-
|Marker options
|rowspan="1" colspan="2" |The arrow marker appears if you check the Use Arrow Marker box.
|-
|'''OK'''
|rowspan="1" colspan="2" |Applies the parameters that you specified and places the text on the image, which you can move to any position on the image.
|-
|'''Cancel'''
|rowspan="1" colspan="2" | Disregards any changes you made in this dialog box, closes the dialog box, and does not place text on the image.
|-
|'''Help'''
|rowspan="1" colspan="2" |Displays online help for this dialog box.
|}
|}


'''Next:''' [[Examples of MIPAV plug-ins]]
==== Previewing Font Selection ====
[[File:AnnotationDialogBox1.jpg|400px|thumb|left|The Annotation dialog box]]
 
The Annotation dialog box allows you to preview the font family, style, size, and color of the text before you click OK and add the text to the image.
 
=== To edit the text ===
<ol>
<li> Double-click the added text on an image. The Annotation dialog box opens.</li>
<li>Make any changes you want to the text, font family, font style, and color.</li>
<li>Click OK. The changes you made to the text should appear on the image.</li>
</ol>
 
=== To delete the text ===
<ol>
<li>Select the added text on an image.</li>
<li>Press Del. MIPAV removes the text from the image.</li>
</ol>
 
To restore the text to the image, select Edit > Undo VOI. The text reappears on the image.
 
== See also: ==
== See also: ==
*[[Understanding plug-in programs]]
*[[Saving and printing images]]
*[[Using the API documentation]]
*[[Delineating volumes of interest (VOIs)| Volumes of Interest]]
*[[Developing plug-in programs]]
**[[Delineating volumes of interest (VOIs)]]
*[[Creating a self-contained plug-in frame]]
**[[Calculating VOI statistics]]  
*[[Installing a plug-in]]
**[[Reviewing VOI statistics]]  
*[[Examples of MIPAV plug-ins]]
**[[Reviewing VOI statistics|Generating graphs (intensity profiles)]]
**[[Plug-in CT_MD, a typical plug-in program]]
*[[ImageJ | Working with ImageJ]]
***[[PlugInAlgorithmCT_MD.java]]
 
***[[Plug-in CT_MD.java]]
[[Category:Help]]
[[Category:Getting started]]

Revision as of 19:24, 25 April 2012

Creating new images

Raw dialog box

To create a new image file:

  1. Do one of the following:
    • If an image file is not already open, select File > Open Image(A) > Create Blank Image.
    • If an image file is already open, select File > Load Image (B)> Create Blank Image. The Raw dialog box appears.
  2. In the dialog box, select the image type.
  3. Select the units of measure for each dimension.
  4. Enter the header offset and byte ordering information.
  5. Click OK. A blank image appears in an image window.
  6. Use the paint and VOI tools to create an image.
  7. Click File > Save image as. The Save dialog box opens.
  8. Type the name of the file in File Name, and select the file type in Files of type.
  9. Click OK. MIPAV saves the image under the file type you selected.

Image dialog box


Image type

Synonymous with data type. The image type determines the number of intensities that can be represented in an image. For example, a Boolean image can display two intensities: 1 and 0. See also Supported Formats.

Boolean-1 bit per pixel (1 on, 0 off)

Unsigned byte-1 byte per pixel (0, 255)

Unsigned short-2 bytes per pixel (0, 65535)

Unsigned integer-4 bytes per pixel (0, 232 -1)

Float-4 bytes per pixel (-3.4E38, 3.4E38)

ARGB-3 bytes per pixel, plus 1 byte; 8 bits per color channel (alpha, red, green, and blue)

Byte-1 byte per pixel (-128, 127)

Short-2 bytes per pixel (-32768, 32767)

Integer-4 bytes per pixel (-231, 231-1)

Long-8 bytes per pixel (-9.22E18, 9.22E18)

Double-8 bytes per pixel (-1.8E308, 1.8E308)

ARGB U short-2 bytes per color channel and 2 bytes for alpha channel

Dimensions and resolutions

Degree of manifolding of a quantity such as space or time. Two-dimensional datasets are composed of one image (the two dimensions are length and width). Generally, three-dimensional datasets are composed of more than one image. The third dimension is generally space. The fourth dimension is generally time. (Either time or space can be the third or fourth dimensions.) Zeros in the text boxes indicate that the dimension is not represented in the image. For example, if the text boxes for the first and second dimensions are filled, and the rest of the text boxes are filled with a zero, the image only has two dimensions. Dimensions

1st-Width (along x axis)

2nd-Length (along y axis)

3rd-Depth (along z axis)

4th-Time (along t axis)

5th-Fifth dimension

Resolutions

Size of pixel or voxel per dimensions 1 through 5.

Units of measure

Indicates the unit of measurement for each of the applicable dimensions.

Header offset

Indicates the size of the space reserved at the beginning of the file where specific types of information is kept. This space, which is called the header, precedes the image data. If you know the length of the header, type it in this box. When MIPAV accesses the file, it skips the header offset and begins to read the image data. Note that not all image file formats have a header.

Big endian

Indicates whether image data is stored in the big endian format. If not, the image data is stored in the little endian format. Endianess refers to the byte ordering of the data. Some computers order the data with the least significant byte (LSB) first followed by the most significant byte (MSB). This byte order is referred as little endian or Intel byte ordering. Machines that use little-endian byte ordering are VAXes, Intel x86, and Pentium. The reverse is MSB and then LSB, which is referred as big endian or Motorola byte ordering. Machines that use big-endian byte ordering are IBM System 3D, RISC, and a Motorola 680x0. MIPAV is biendian; it supports both big- and little-endian byte-ordering formats.

OK

Applies the parameters that you specified and creates a blank image.

Cancel

>Disregards any changes you made in this dialog box, closes the dialog box, and does not create a blank image.

Help

Displays online help for this dialog box.

Annotating images with text

The Annotation dialog box

AnnotataTExtIco.jpg You can use the Annotation tool icon located on VOI toolbar to place text directly on an image at any position on the image. You can use any font family, or typeface, that is installed on your computer to display the text.

To annotate images with text:

  1. Open an image.
  2. Click the Annotation tool icon. The Annotation dialog box opens.
  3. Click the image on which you want the text to appear. The image becomes the active image.
  4. Select the font family and style (bold or italic). To select a regular font style, simply specify the font family.
  5. Type the font size of type in the pt. box.
  6. Press Enter. The Annotation dialog box either enlarges or reduces in size depending on the type size you chose.
  7. Click Color to select the color of the text. The color of the type in the Text box changes to the color you have chosen.
  8. Select "Enter text here" and type the text that you want to display on the image in the Text box.
  9. Click OK. The text appears near the top of the image.
  10. Click the text and drag it to any position on the image.

Annotation dialog box

Annotation dialog box
Font options Font-Specifies the font family, or typeface, for the text. When you select another typeface, "Enter text here" appears in that typeface.
Bold-Specifies that the type style should be bold.
Italic-Specifies that the type style should be italic.
Pt. (point) size-Specifies the point size of the typeface.
Color-Specifies the color of the text. When you click this box, the Pick VOI Color dialog box opens.
Text Displays the text that should appear on the image.
Marker options The arrow marker appears if you check the Use Arrow Marker box.
OK Applies the parameters that you specified and places the text on the image, which you can move to any position on the image.
Cancel Disregards any changes you made in this dialog box, closes the dialog box, and does not place text on the image.
Help Displays online help for this dialog box.

Previewing Font Selection

The Annotation dialog box

The Annotation dialog box allows you to preview the font family, style, size, and color of the text before you click OK and add the text to the image.

To edit the text

  1. Double-click the added text on an image. The Annotation dialog box opens.
  2. Make any changes you want to the text, font family, font style, and color.
  3. Click OK. The changes you made to the text should appear on the image.

To delete the text

  1. Select the added text on an image.
  2. Press Del. MIPAV removes the text from the image.

To restore the text to the image, select Edit > Undo VOI. The text reappears on the image.

See also: