Planning scripts

From MIPAV
Revision as of 22:09, 21 February 2012 by Angelfish100 (Talk)

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

Although MIPAV allows you to easily create scripts, it is important to plan scripts before creating them, particularly if the scripts perform actions on VOIs. First, however, you need to understand:

  • Methods for creating scripts
  • Actions that can be performed in scripts,
  • Use of VOIs in scripts.

Methods for creating scripts

There are two methods for creating scripts:

1 To create a script using the Scripting toolbar, open an image of interest and simply click the Start Recording Script icon on the Scripting toolbar. See Figure 6.

Figure 5. The Start Recording Script button

Script ToolbarRecordScript.png

2 To create a script using the main MIPAV menu, click Scripts > Record Script in the MIPAV window and simply start recording. See Figure 6.

For more information, refer to Section "Recording scripts".

Figure 6. The Record Script command available via the Scripts menu

Script RecordScriptMenu.png

Actions permitted in scripts

It's also important to understand what actions or events you can record in scripts. For example, scripts neither record views, such as lightbox, triplanar, and volume renderer; nor do they record other visualization commands, such as those that adjust the lookup table.

Actions that you can record in scripts include:
  • Saving and closing images
  • Opening VOIs
  • Saving VOIs including the Save all VOIs and Save all VOIs to commands
  • Performing algorithms on images or on open VOIs on images[1]
  • Applying utilities to images or to open VOIs on images
  • Saving the global data page in the Output window
  • Exiting from the MIPAV program[2]

Use of VOIs in scripts

The only VOI commands that can be recorded in scripts are the open VOI commands:

  • VOI > Open VOI
  • VOI > Open All VOIs

MIPAV scripts do not record and save VOIs. Therefore, to apply VOIs to images in scripts, you need to:

Create and save all VOIs in advance of creating a script;
Open and apply the VOIs when you are recording the script.

After you've created all necessary VOIs, you can save them through the Save VOI commands available via the VOI menu in the main MIPAV window:

VOI > Save VOI
VOI > Save VOI as
VOI > Save All VOIs
VOI > Save All VOIs to
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).
Tip: You might consider to organize your workplace, for example, designate a specific folder(s) for VOIs using in scripts.

Saving VOIs: Some Reminders
You can save VOIs under names that MIPAV assigns or under names that you assign. If the VOIs have never been saved before, MIPAV assigns names to VOIs when you use the Save VOI or Save All VOIs commands. The name of the first VOI or set of VOIs that you save is Area1.voi; the second is Area2.voi; and so on.
If you want to specify a different name for the VOI or set of VOIs: select VOI > Save VOI as or VOI > Save All VOIs to. The Save VOI as dialog box opens. Type a name for the VOI in File name and the extension .voi or .xml, and click Save. The program saves the file under the specified name.



Recording scripts