Back to User's Manual Table of Contents
The command window is most useful as a debugging and experimentation tool when developing scripts for SRView. With it you can experiment with individual commands, set Tcl/Tk variables, examine Tcl/Tk variables a script has set, and run any script without putting it under the control of the Scripts menu.
You might also find the command window useful to run finished scripts
and that you have chosen not to place under the Scripts menu.

At the bottom of the Command Window is a text entry window for entering
commands. The larger window above the text entry window is a command
history window showing previously entered commands. Prior commands
can be recalled to the entry window by clicking on them. The list
of commands in the command history window becomes a scrolling list whenever
there are more commands than will fit into the window.
You can enter any of the standard Tcl commands just as you would at the command prompt of an ordinary Tcl shell. You can also enter any of the custom Tcl commands implemented in the SRIP package. SRIP's custom Tcl commands are documented in the SRIP Programmer's Guide, which you can access by clicking here.
Tk commands and widgets of Tcl/Tk are supported too, with the restriction that you should not use the Tk main window (.), but should create other toplevel windows as you need them. This is explained in the SRIP Programmers manual page on Tcl/Tk scripting in SRView.
puts "Hello World"puts is the Tcl command to print a string. Type
puts [pwd]This will report your current working directory. pwd is the familiar Unix command for printing the current working directory; it is a standard Tcl command too. Type
lsls is the Tcl command for listing the contents of a directory. So, you should get a listing of what is in the working directory. Several of the other familiar Unix commands are Tcl commands too.
Here is a less trivial example that may come in handy as you create ROIs for your images. Let's change the label of the ROIs in an image. This uses one of the custom Tcl commands written for the SRIP package. First, go to the main window and display an image. If the image doesn't have some ROIs, draw some, giving them whatever label you like. For the sake of this example we will refer to the current label of the set of ROIs as currentLabel. Now, let's change all the currentLabel ROIs to have a label of "dental_floss". To do this, go to the command window and give the command
RelabelRois currentLabel dental_flosswhere of course you have substituted for currentLabel whatever is the true current label of your ROIs. Now if you move the cursor to the image in the main window you will see the currentLabel ROI labels have changed to "dental_floss".
You can put the ROI labels back the way they were by using the RelabelRois command again, i.e.,
RelabelRois dental_floss currentLabel