Recording scripts

From MIPAV
Revision as of 19:56, 15 February 2012 by Angelfish100 (Talk)

(diff) <previousrevision> | Latest revision (diff) | <nextrevision> (diff)
Jump to: navigation, search

Recording scripts

To record a script using the Scripts toolbar:
1 Start MIPAV. The initial MIPAV window and the Output window open.
2 Open the images on which you want to run the script. The MIPAV window expands.
3 Click the Start Recording Script icon on the scripting toolbar. See [MIPAV_Scripting.html#1317350 Figure 278].
Figure 278. Click the Start Recording Script icon to record a script


{| align="center"

Script RecordScript1.png



|}


Note: The Start Recording Script icon turns red to indicate that MIPAV is now recording a script.

4 The Record New Script dialog box ([MIPAV_Scripting.html#1218117 Figure 280]) opens. The following placard message appears at the top of the dialog box: The script is now recording. Your actions will appear below.
5 Open any previously created VOIs that you want to use with the images. Perform any algorithm or utility.
6 Repeat steps above as needed.
7 In the Record New Script dialog box, select File > Save. The Save dialog box opens. Type a name for the script and either the .sct or .xml extension in File name.
8 Click Save. The program saves the script in the scripts home directory.
9 Click File > Exit to close the Record New Script dialog box. The dialog box closes. You should now be able to select and run the script from Current Script.
Figure 280. Record New Script dialog boxÂ

File
Open-Opens a previously saved script. When you select this command, the Open dialog box appears.

{| align="center"

Script RecordScript2.png



|- |

Save-Saves the script under the specified name. When you select this command, the Save dialog box opens.

|- |

Exit-Closes this dialog box without saving the script.

|- |

IconOpen.jpg
Open script

|

Open-Opens a previously saved script. When you select this command, the Open dialog box appears.

|- |

IconSave.jpg
Save script

|

Save-Saves the script under the specified name. When you select this command, the Save dialog box opens.

|- |

IconPauseScripting.jpg
Pause scripting

|

Stops recording the script. When you select this icon, the icon changes to the Resume scripting icon.

|- |

IconRecordScript.jpg Resume scripting

| rowspan="1" colspan="2" |

Activates the recording process again. When you select this icon, the icon changes to the Pause scripting icon.

|- |

IconInsertComment.jpg Insert comment

| rowspan="1" colspan="2" |

Allows you to insert a comment into the script. When you select this icon, the Input dialog box opens. Type the comment in Enter comment and click OK. MIPAV adds your comment into the script after the word Comment.
Â

{| align="center"

| File:MIPAV Scripting18.gif

|}

Figure 279. Input dialog box (A) showing a comment and (B) the comment as it appears in the scripting box

|- |

IconFreeMemory.jpg Insert command to collect garbage (free memory)

| rowspan="1" colspan="2" |

Frees memory by inserting the command to collect garbage, a Java method that clears all unnecessarily reserved memory. For more information, refer to [MIPAV_QuickStart.html#1014435 "Saving a history of actions on images (TBD)" on page 76].

|- |

IconInsertMIPAVExit.jpg Insert command to end MIPAV

| rowspan="1" colspan="2" |

Inserts the command for exiting MIPAV (Exit) into the script, which allows MIPAV to close as a part of the script.
Caution: Do not use the Exit command in MIPAV scripts unless you are calling the script from another program or scripts (Perl, C , Windows batch, etc.).

|- |

Scripting box

| rowspan="1" colspan="2" |

Displays the action commands (algorithms and utilities) and any comments in the script.

|- |

Pause

| rowspan="1" colspan="2" |

Stops recording the script. When you select this button, the name of the button changes to Resume.

|- |

Enable Edit

| rowspan="1" colspan="2" |

Paused the script recording first, then it allows you to make changes or corrections to the script. When you select this button, the scripting box turns from gray to white to indicate that 1) the script is paused and 2) that you can now type, copy, paste, or delete information from the script, and the button name changes to Disable Edit.

|- |

Disable Edit

| rowspan="1" colspan="2" |

Prevents any changes or corrections being made to the script from typing, pasting, inserting, or deleting information. It does, however, allow MIPAV to record actions on images. When you select this button, the scripting box turns from white to gray, and the button name changes to Enable Edit. It also restarts the script recording.

|- |

Help

| rowspan="1" colspan="2" |

Displays online help for this dialog box.

|}


Recording a script using the Scripts > Record Script menu
1 Start MIPAV.
2 Select Scripts > Record Script. The Record New Script dialog box opens. The following appears at the top of the dialog box: The script is now recording. Your actions will appear below.
Figure 281. Recording a script via Scripts > Record Script menu


{| align="center"

Script RecordScriptMenu1.png



|}