Difference between revisions of "Running scripts"
(Created page with '=== Running scripts === You can run a script either using the Scripts toolbar or via the Scripts>Run Script menu. If you are running the script via the Scripting toolbar and...') |
(→Running scripts) |
||
Line 3: | Line 3: | ||
You can run a script either using the Scripts toolbar or via the Scripts>Run Script menu. | You can run a script either using the Scripts toolbar or via the Scripts>Run Script menu. | ||
− | If you are running the script via the Scripting toolbar and have at least one image open and selected, the script will automatically apply to that active image. Here, the <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">active image</font>''</span> is the image that is currently selected, refer to | + | If you are running the script via the Scripting toolbar and have at least one image open and selected, the script will automatically apply to that active image. Here, the <span style="font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline">''<font color="#000000">active image</font>''</span> is the image that is currently selected, refer to Figure 12. |
<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 style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
− | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure | + | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 12. An active image, which bar is highlighted (on your left) and inactive image, which bar is dimmed and grey (on your right)<br /></font>'''</div> |
|- | |- | ||
− | |||
− | |||
| | | | ||
[[Image:Script_ActiveImage1.png]] | [[Image:Script_ActiveImage1.png]] | ||
− | |||
− | |||
− | |||
| | | | ||
[[Image:Script_InActiveImage.png]] | [[Image:Script_InActiveImage.png]] | ||
− | |||
|} | |} | ||
Line 25: | Line 19: | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
− | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure | + | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 13. Current Script lists all of the scripts in the scripts home directory alphabetically. To reorder the list of scripts in Current Script, click the Refresh icon<br /></font>'''</div> |
|- | |- | ||
− | |||
− | |||
| | | | ||
[[Image:Script_RunScript1.png]] | [[Image:Script_RunScript1.png]] | ||
− | |||
|} | |} | ||
<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 MIPAV automatically performs all of the actions in the script on the active image.<br /></font></div> | <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 MIPAV automatically performs all of the actions in the script on the active image.<br /></font></div> | ||
− | If the script requires more than one image or VOI, it will pop up the Script Execution Setup dialog box, where you can add more images and VOIs to the script procedure. Refer to | + | If the script requires more than one image or VOI, it will pop up the Script Execution Setup dialog box, where you can add more images and VOIs to the script procedure. Refer to "To run scripts from the Run Script menu" and Figure 14. |
− | <div style="font-style: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 14pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> To run scripts from the Run Script menu<br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 Call Scripts > Run Script from the main MIPAV menu. <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 Select a script you wish to run and press OK. The MIPAV Script Tool dialog box opens. Refer to | + | <div style="font-style: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 14pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> To run scripts from the Run Script menu<br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 Call Scripts > Run Script from the main MIPAV menu. <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 Select a script you wish to run and press OK. The MIPAV Script Tool dialog box opens. Refer to Figure 14.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 3 Add images to the Script Execution Setup, refer to "Adding images to the Script Execution Setup".<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 Add VOIs to the Script Execution Setup, if needed. Refer to "Adding VOIs to the Script Execution Setup".<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 Repeat step 3 and step 4 for as many images and VOIs on which you want to run the script.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 6 Press Run Script.<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 MIPAV automatically performs all of the actions in the script on the images indicated in the Script Execution Setup dialog.<br /></font></div> |
===== Adding images to the Script Execution Setup ===== | ===== Adding images to the Script Execution Setup ===== | ||
Line 45: | Line 36: | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
− | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure | + | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 14. The MIPAV Script Tool dialog box<br /></font>'''</div> |
|- | |- | ||
− | |||
− | |||
| | | | ||
[[Image:Script_GroupMode1.png]] | [[Image:Script_GroupMode1.png]] | ||
− | |||
|} | |} | ||
Line 59: | Line 47: | ||
|+ <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 286. <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Adding images to the Script Execution Setup</font>'''</span><br /></font>'''</div> | |+ <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 286. <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Adding images to the Script Execution Setup</font>'''</span><br /></font>'''</div> | ||
|- | |- | ||
− | |||
− | |||
| | | | ||
[[Image:ScriptExecution2Imagespng.png]] | [[Image:ScriptExecution2Imagespng.png]] | ||
− | |||
|} | |} | ||
Line 74: | Line 59: | ||
You don't need to manually associate VOIs for those images that already have associated VOIs. Those VOIs appear in the Script Execution Setup window automatically under the corresponding image. | You don't need to manually associate VOIs for those images that already have associated VOIs. Those VOIs appear in the Script Execution Setup window automatically under the corresponding image. | ||
− | <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 For those images that don't have linked VOIs, add VOIs manually by dragging files from the VOIs window to the designated image in the Script Execution Setup. Linked VOI is a result of <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">OpenVOI()</font></span> action in the script. Refer to | + | <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 For those images that don't have linked VOIs, add VOIs manually by dragging files from the VOIs window to the designated image in the Script Execution Setup. Linked VOI is a result of <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">OpenVOI()</font></span> action in the script. Refer to Figure 16 for details.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> |
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
− | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure | + | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 16. Adding VOIs to images<br /></font>'''</div> |
|- | |- | ||
− | |||
− | |||
| | | | ||
[[Image:Script_GroupModeVOI.png]] | [[Image:Script_GroupModeVOI.png]] | ||
− | |||
|} | |} | ||
Line 101: | Line 83: | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
− | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure | + | |+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 17. The MIPAV Script Tool dialog box <br /></font>'''</div> |
|- | |- | ||
| | | | ||
Line 108: | Line 90: | ||
<div class="CellBody">Contains a list of images and associated VOIs.</div> | <div class="CellBody">Contains a list of images and associated VOIs.</div> | ||
| rowspan="3" colspan="1" | | | rowspan="3" colspan="1" | | ||
− | |||
− | |||
[[Image:Script_MIPAV_Script_ToolDB.png]] | [[Image:Script_MIPAV_Script_ToolDB.png]] | ||
− | |||
|- | |- | ||
| | | |
Revision as of 20:40, 15 February 2012
Contents
Running scripts
You can run a script either using the Scripts toolbar or via the Scripts>Run Script menu.
If you are running the script via the Scripting toolbar and have at least one image open and selected, the script will automatically apply to that active image. Here, the active image is the image that is currently selected, refer to Figure 12.
If the script requires more than one image or VOI, it will pop up the Script Execution Setup dialog box, where you can add more images and VOIs to the script procedure. Refer to "To run scripts from the Run Script menu" and Figure 14.
Adding images to the Script Execution Setup
Adding VOIs to the Script Execution Setup
You don't need to manually associate VOIs for those images that already have associated VOIs. Those VOIs appear in the Script Execution Setup window automatically under the corresponding image.
Note: After assigning an image or VOI to a script in the Script Execution Setup, your can delete the assignment using the Delete context menu option.
Use the Scripting toolbar to run simple scripts which involve one image and one VOI. Use the Run Script menu option to run more complicated scripts which apply to multiple images and VOIs. You can also use the Scripting menu to execute the same script multiple times.
For example, you can consider to use the toolbar option to execute the script while you are setting the script parameters and/or testing it; and after the script has been tested and debugged, you can run it over the set of images via the Scripting menu.
The MIPAV Script Tool dialog box options
Script Execution Setup window
|
Contains a list of images and associated VOIs.
|
|
Images
|
Lists the images that appear in the script
| |
Add image from file
|
Allows you to add one or more images on which to run the script.
| |
VOIs from selected file
|
Lists any saved VOIs that are necessary when you run the script.
| |
Add VOI from file
|
Allows you to add one or more VOIs to the script.
| |
File menu
| ||
Open saved image and VOI selections
|
Opens the corresponding dialog box, which allows you to browse through the folders and select an image file or VOI with any specified extension.
| |
Save current image and VOI selections
|
Allows you to save the selected image or VOI.
| |
View current script contents
|
Opens a window that shows the script contents. Here, you can only select the script contents and copy it to the Clipboard using the CTRL C combination of keys.
| |
Close
|
Closes the Script Execution Setup.
| |
Run Script
|
Begins running the script.
|