Difference between revisions of "Using the mipav command"
(→Using the mipav command) |
(→Using the mipav command) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
To call scripts from other programs, you use the <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">mipav</font>'''</span> command in the Command Prompt dialog box. The correct syntax of this command follows. | To call scripts from other programs, you use the <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">mipav</font>'''</span> command in the Command Prompt dialog box. The correct syntax of this command follows. | ||
− | |||
− | |||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
Line 77: | Line 73: | ||
<br /></font></div> | <br /></font></div> | ||
− | Figure 31 shows examples of the | + | Figure 31 shows examples of the '''mipav''' command. |
− | + | '''Note:''' When calling MIPAV scripts from other programs, be sure to enter an Exit command at the end of the MIPAV script.<br /> | |
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
− | |+ | + | |+ '''Figure 31. Examples of using the mipav command''' |
|- | |- | ||
| rowspan="1" colspan="2" | | | rowspan="1" colspan="2" | | ||
Line 114: | Line 110: | ||
<div class="CellBody">> mipav Exit</div> | <div class="CellBody">> mipav Exit</div> | ||
|} | |} | ||
− | + | '''To display help for using the mipav command''' <br /> | |
− | + | 1 Navigate to the mipav directory on your computer.<br /> | |
+ | 2 Select Start > All Programs > Accessories > Command Prompt. The Command Prompt dialog box opens.<br /> | ||
+ | 3 Type <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">mipav -H</font>'''</span> (refer to Figure 32).<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 32. Command Prompt dialog box showing command to open Command Line Help dialog box''' |
|- | |- | ||
| | | | ||
[[Image:dialogboxCommandPrompt.jpg]] | [[Image:dialogboxCommandPrompt.jpg]] | ||
|} | |} | ||
− | + | 4 Press Enter. The Command Line Help dialog box (Figure 33) opens.<br /> | |
− | + | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
− | |+ | + | |+ '''Figure 33. Command Line Help dialog box, which shows the syntax of the mipav command as well as examples''' |
|- | |- | ||
| | | | ||
[[Image:ScriptsCommandLineHelp.jpg]] | [[Image:ScriptsCommandLineHelp.jpg]] | ||
|} | |} | ||
− | + | '''To open a DICOM image dataset '''<br /> | |
− | + | Suppose you want to open a single DICOM image from a collection of experiments made in 2004 named exp2004. You would type the following command in the Command Prompt dialog box in Microsoft Windows XP:<br /> | |
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
Line 141: | Line 138: | ||
<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">C:\ mipav -i i:\images\DICOM\exp2004\I04301.dcm</font></span> | <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000">C:\ mipav -i i:\images\DICOM\exp2004\I04301.dcm</font></span> | ||
|} | |} | ||
− | + | '''To open VOIs into that image'''<br /> | |
− | + | You can open VOIs as well as the image from the command line. In Windows XP, it would be the following:<br /> | |
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
Line 154: | Line 151: | ||
In a UNIX BASH shell, this command looks like: | In a UNIX BASH shell, this command looks like: | ||
− | |||
− | |||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
Line 164: | Line 159: | ||
|} | |} | ||
− | + | '''To open multiple images using compound commands'''<br /> | |
+ | Suppose you know that there were multiple DICOM datasets in exp2004. To open every DICOM image on the Windows computer, you would type:<br /> | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
Line 173: | Line 169: | ||
|} | |} | ||
− | |||
In this case, you must know something of the file structure of that dataset-you assumed that all image datasets had only one image ending in 01. However, the disadvantages of this format is the possibility of not opening all of the images at the same time. | In this case, you must know something of the file structure of that dataset-you assumed that all image datasets had only one image ending in 01. However, the disadvantages of this format is the possibility of not opening all of the images at the same time. | ||
Line 179: | Line 174: | ||
A similar loop to open image sets on a UNIX BASH command line looks like: | A similar loop to open image sets on a UNIX BASH command line looks like: | ||
− | |||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
Line 188: | Line 182: | ||
|} | |} | ||
− | |||
There are three significant differences between the BASH command and the Windows command (beside from how a directory is specified): | There are three significant differences between the BASH command and the Windows command (beside from how a directory is specified): |
Revision as of 21:16, 22 February 2012
To call scripts from other programs, you use the mipav command in the Command Prompt dialog box. The correct syntax of this command follows.
Syntax of the mipav command
| |
mipav [-hH] [-iI] imageFileName [-sS] ScriptFileName [-vV] voiFileName [-hideHide]
| |
Parameters
|
Purpose
|
[-h][-H]
|
Displays help for the mipav command in a Command Prompt window
|
[-hide][-HIDE]
|
Hides application frame
|
[-i][-I]
|
Image file name
|
[-s][-S]
|
Script file name
|
[-x][-X]
|
XML script file name
|
[-v][-V]
|
VOI file name
|
[-o][-O]
|
Specifies the output file name when "Save Image As" script command is used
|
[-d] [-D]
|
Set a value of a variable used in the script
|
[-inputdir] [-INPUTDIR]
|
Specifies the input directory with images
|
[-outpudir] [-OUTPUTDIR]
|
Specifies the output directory with images
|
Exit
|
Exits the MIPAV program
|
</font></div>
Figure 31 shows examples of the mipav command.
Note: When calling MIPAV scripts from other programs, be sure to enter an Exit command at the end of the MIPAV script.
Example 1: Starts MIPAV
| |
> mipav | |
Example 2: Starts MIPAV and opening an image
| |
> mipav imageFileName
| |
Example 3: Starts MIPAV but does not display frame, opens an image, and runs a script on the image.
| |
> mipav -i imageFileName -s scriptFileName -hide
| |
Example 4: Starts MIPAV, runs a script, opens the first image, opens two VOIs associated with that image, opens a second image, and associates another VOI with that image
| |
> mipav -s scriptFileName -i imageFileName1 -v voiName1 -v voiName2 -i imageFileName2 -v voiName3
| |
Example 5: Exiting the MIPAV program
| |
> mipav Exit
|
To display help for using the mipav command
1 Navigate to the mipav directory on your computer.
2 Select Start > All Programs > Accessories > Command Prompt. The Command Prompt dialog box opens.
</font></div>
4 Press Enter. The Command Line Help dialog box (Figure 33) opens.
To open a DICOM image dataset
Suppose you want to open a single DICOM image from a collection of experiments made in 2004 named exp2004. You would type the following command in the Command Prompt dialog box in Microsoft Windows XP:
C:\ mipav -i i:\images\DICOM\exp2004\I04301.dcm |
To open VOIs into that image
You can open VOIs as well as the image from the command line. In Windows XP, it would be the following:
C> mipav -i i:\images\DICOM\exp2004\I04301.dcm -v i:\VOIs\exp2004\levelset1.xml |
In a UNIX BASH shell, this command looks like:
$ mipav -i ~/images/DICOM/exp2004/I043401.dcm -v ~/VOIs/exp2004/levelset1.xml |
To open multiple images using compound commands
Suppose you know that there were multiple DICOM datasets in exp2004. To open every DICOM image on the Windows computer, you would type:
C> for %f in (i:\images\DICOM\exp2004\*01.dcm) do mipav -i %f |
In this case, you must know something of the file structure of that dataset-you assumed that all image datasets had only one image ending in 01. However, the disadvantages of this format is the possibility of not opening all of the images at the same time.
A similar loop to open image sets on a UNIX BASH command line looks like:
$ for FI in `ls ~/images/DICOM/exp200?/*01.dcm`; do ./mipav -i $FI &; done |
There are three significant differences between the BASH command and the Windows command (beside from how a directory is specified):
When there is more than one MIPAV application window running, it's possible to close the wrong image by closing the wrong MIPAV application. In addition, operations that can occur between windows when running a single MIPAV may not be transferable between images being run by separate MIPAV windows.
While starting more than one MIPAV to display a set of images may be fine in limited applications, it causes needless overhead within in the operating system wasting system resources.