SRView Quick Start

Synergy Research, Inc.
21 December 2005

Back to User's Manual Contents


Quick Start Contents

Introduction

Start SRView

Loading and Displaying an Image

Overview of the Main Window

Setting Display Window and Level

Changing the Slice

Dragging to the desired slice
Stepping one slice at a time
Toggling On/Off the Slice Cross-Reference Lines

 

Time Dimension

Selecting A Time Point
Stepping Through Time Points
Plotting Time Vectors

 

Rotating an Image

Zooming an Image

Scrolling the Window

Resizing the Window

Tools

Creating an ROI (or midline)

ROI create tool
ROI labels (groups)
Drawing an ROI (or midline)

 

Changing an ROI (or midline)

ROI edit tool
Making an ROI group active
Moving ROI points
Moving ROIs
Deleting ROI points
Deleting ROIs
Inserting ROI points
Changing an ROI's label

 

Copying the Last ROI

Turning ROI Display Off and On

About ROIs and Rotated Images

Loading Multiple Images

Displaying Loaded Images

Selecting a Display Plane for the Lower Right Quadrant

Saving Images and Overlays

Closing Images

Masks

Creating Masks
Applying Masks
Masking with Multiple Time Points
Editing Masks
Undoing Mask Edits
Multilevel Masks

   

Windows Menu

Command Window (Tcl/Tk Commands)
Image Information Window

Image Array Window

Scripts Menu

Quiting SRView

Errors

Key and Mouse Button Summary Tables

Mouse Button Actions
Keyboard ShortcutsTable
ROI Editing Summary Table
Contact Information

 


Introduction

SRView is an application for viewing and manipulating three- and four-dimensional images.  It is a component of the Synergy Research Image Processing (SRIP) package that is being developed as a research  tool  for NIAAA/LCS/BEI.  Source code is available to the NIH community.

All images in SRView are really four dimensional: x, y, z and time.  These four-dimensional images may be thought of as sets of three dimensional images at a sequences of time points.  In SRView, 3D images are just 4D images that happen to have only one point in the time dimension.

SRView is useful for viewing images in three orthogonal views, rotating them interactively in 3 dimensions, scrolling through the time dimension while viewing the 3 orthogonal views, plotting pixel values along the time dimension, manually creating and editing ROIs and midlines, creating  mask images from the ROIs, and manually editing mask images.  SRView incorporates a well known and powerful scripting language called Tcl/Tk.  Using Tcl/Tk scripts, tasks can be automated and anaylses added, even analyses that require their own graphical user interface and execution of other programs.

SRView supports the image file and scan analysis file formats of the Synergy-IP application, so images and overlays created with either application are accessible in the other.  SRView also can import DICOM and AFNI formatted images.

This Quick Start document is Chapter 1 of the SRView User's Manual.  Quick Start tells you everything you need to know to start using SRView.

Start SRView

Start SRView by typing srview in a terminal window. If that doesn't work, speak with your system administrator about how to start srview on your computer.

When SRView first starts up, it opens a window (a ThreeView window) which looks like this:


FIGURE 1

After the ThreeView window is open, find the terminal window from which you invoked SRView, and move and resize it as needed so that any error messages that appear in it will be visible while you work. Resizing it to show just a few lines, and moving it to the bottom of the screen usually works well.

Load and Display an Image

To load and display an image in the ThreeView window, pull down the File menu and select Open ...
The file selection dialog box will appear and will look like this:


FIGURE 2

If you know the name of the image file you wish to load, you can type it into the Selection text box.  However, most of the time it is easier to navigate to the file you want using the directory and file lists.

There is a list of directories on the left and list of files on the right.  The current directory will be highlighted in the directory list, and will end with a dot.  The current directory will also be automatically entered into the Selection text box underneath the lists.  The directories listed are those contained in the currently selected directory.

Double click on a directory name to move to that directory.  The directory ending in .. (two dots) represents the next directory above the current directory, so double click on the .. directory to move up one level in the directory tree.

The files in the file list are those in the currently selected directory.  Click on the file you wish to load, then click OK.  The file will be read in and displayed.

SRView opens images in NIAAA, AFNI, and DICOM format.  It does not use file extensions to identify file format, so these images can have any name and extension you like.  SRView determines file format by looking in the file for key information.  When SRView is unable to determine the format of the file, it will pop up a window and ask you to tell it which format the file has.

NIAAA image file format is the primary format of the SRView application.  It always saves images to NIAAA format, and the associated NIAAA scan analysis file format is used to store information about rotations and overlays that have been created for the images.

When loading an NIAAA-formatted image, if there is a scan analysis (overlay) file in the same directory with the image, and if that file has the same name as the image file, but with a .paf extension, then it will be automatically read in and the overlays will be displayed on the image.  The overlay file stores regions of interest (ROIs), midlines, and a rotation matrix.  Overlay files with different file names can be loaded and displayed on an image through use of the Open Overlay ... command of the File menu.  To apply the rotation matrix to the image in the ThreeView window, select Apply Rotation from the View ... Rotate menu.  Note that Apply Rotation stays on until it is turned off in the View ... Rotate menu, even if another image is displayed in the ThreeView window.  See Rotating an Image in this page for more information on rotations.  The rotation matrix can also contain image translations, which can be used to align images and masks -- see Masks in this page.

An AFNI image is stored as two files, with suffixes .HEAD and .BRIK.  The .HEAD file contains information describing the image and the .BRIK file contains the image pixels.  Select either of these in the file selection dialog box to open the image.  The first time an AFNI image is opened in SRView, an overlay file will be generated and stored in the directory of the image.  It will have the same name as the image files except that the suffix will be .paf.  This file will contain image origin (translation) information from the AFNI .HEAD file, stored in the rotation matrix.  If the .paf file exists when the image is loaded, it will be loaded as well.  As with an NIAAA image, select Apply Rotation from the View ... Rotate menu to turn on or off application of the rotation matrix.  The AFNI center of the image (the (0, 0, 0) voxel in mm coordinates as seen in the AFNI program) will be moved to the center of the lower right quadrant in the ThreeView window.  Note that the voxel coordinates displayed in SRView will be shifted along with the image.

After loading an image, the ThreeView window will look like this:


FIGURE 3

Overview of the ThreeView Window

The ThreeView window has a menu bar across the top, an image display area in the middle, and a message area across the bottom.  It also has horizontal and vertical scroll bars along the bottom and right sides of the drawing area.  Refer to Figure 3.

The name of the currently displayed image is shown in the blue band at the top of the window.  This name is formed from the file name of the image minus its extension.

The drawing area is divided into four quadrants.  The three principal orthogonal views through the volume image are shown in three of the quadrants.  The fourth (lower left) quadrant is unused.

The lower right (LR) quadrant is considered the main quadrant: that is where ROIs can be drawn and in-plane ROIs are displayed on the image. The upper left (UL) and upper right (UR) quadrants show colored dots wherever ROIs intersect the displayed slices. These upper two quadrants do not show ROIs that lie in the slice they are displaying.

The image data define a rectangular volume in xyz coordinate space.  The assignment of x, y and z coordinates to the image file data is based on the ordering of data in the file: x index increments most rapidly, then y, then z.  This is the same xyz assignment as used the Synergy IP application. Initially, the  planes displayed in the three quadrants are:

LR = xy plane
UL = yz plane
UR = xz plane
Normally it is not useful to change this plane-to-quadrant assignment; however the Plane Selection section below explains how it can be changed should you wish to do so.

You can rotate the image; how to do that is described later.  The important point now is that the quadrants retain their coordinate assignments on rotation; they just display those coordinates in the rotated coordinate system.  For example, if the LR quadrant is set to the xy plane, then it will display the xy plane of the rotated coordinate system, which is what you naturally would expect.

The xyz coordinates and the voxel value at the location of the mouse pointer are continuously displayed in the message area.  The coordinates in the message window are those in the space of the original unrotated image data set, regardless of how the image is rotated in the display.

Aside about coordinates:

In the original image data space every point in the array is by definition one unit from its neighboring points along the x, y, z  and time directions.  (More is said about the time dimension later.)  Coordinates start at zero, and run up to the array size minus one in each direction.  Thus, coordinate values correspond to the usual numbering of array indicies for a multidimensional array in the C programming language.  These are the coordinate values displayed in the message area.

Often the true physical spacing of points in an image differs in the x, y, and z directions.  The actual physical sampling intervals for each direction are carried in the image header, and are used when the image data are mapped to the display so as to present the image with the proper relative scale in the x, y, and z directions.  The current values of the physical sampling intervals, in millimeters, are shown and are editable in the Settings... dialog under the Edit menu.


All ROIs have a label (group name).  The currently-selected ROI label is displayed in the message area.  At start up, there is no ROI label selected, hence the blank Label field in the message window of Figure 3.  Selecting ROI labels is explained in the section on Creating ROIs.

There are colored slice cross-reference lines drawn on the images.  The green line passing through the upper quadrants indicates the location of the slice displayed in the LR quadrant.  The red line indicates the location of the slice in the UL quadrant, and the blue lines indicate the location of the slice in the UR quadrant.  These lines can be toggled off and on as desired, and the little colored squares (knobs) on the lines can be grabbed and dragged to change slice locations, as explained in the section on Changing the Slice.
 

Setting Display Window and Level

When an image is first loaded, the display window is set to 200 and the level to 100.  You will probably want to change those values to suit the range of the particular image you are displaying.  To get an approximately correct window and level setting, select Auto Window/Level from the View menu.  The keyboard short cut for this is Ctrl+A.  This will get you close, but you may still want to make some fine adjustments.

The easiest way to fine adjust the display window and level is to drag the cursor over the image with the middle mouse button depressed.  Start the drag on an image in one of the quadrants.  As you drag, the image in that quadrant will change.  When you release the button, all three quadrants will update to the window and level values you just selected.   Vertical motion during the drag changes the level, and horizontal motion changes the window.

The current window and level values are always shown in the message area and are updated as you drag.

You can also enter numerical values for the window and level: pull down the View menu and select Window/Level ...  A dialog box will appear in which you can enter the window and level values.  Click in the text boxes and type the values you want, then click OK. The image display will update with the new values. 

The color lookup table used to display the image (and masks applied to the image) can be modified by the user.  See Color Lookup Tables.

Changing the Slice

When an image is first loaded, the central slices in all three orthogonal planes are displayed.  There are two ways to change slice location: drag the slice selection knobs or use the slice stepping function.

Dragging to the desired slice

There are small green, red and blue squares along the edges of the quadrants; these are called the slice selection knobs (Fig. 3).  Green, red and blue slice cross-reference lines pass through these knobs across the displayed slices.

To change the slice in the LR quadrant, grab the green knob and drag it to the desired new location indicated by the green cross-reference line. The cross-reference line will follow the knob and the display in the LR quadrant will update as you drag.

Similarly, you can change the slice in the UL quadrant by dragging the red knob, and the slice in the UR quadrant by dragging either of the two blue knobs.

The slice location is read out in the message window as the knobs are dragged, so it is easy to drag to a specific numerical location.  The locations are given in terms of the xyz coordinates of the point of intersection of the three cross-reference lines.  These coordinates are measured in the original image data space, even when the displayed image is rotated.
 

Stepping one slice at a time

In the LR quadrant, the slice can be stepped up one slice location at a time by pressing the up arrow on the keyboard. Similarly, it can be moved down with the down arrow.  Here up and down refer to the direction of motion on the screen of the green cross-reference line which indicates the location of the slice.

The slice stepping function is also available through the Up and Down buttons under the View->Slice Step menu.
 

Toggling on/off the slice cross-reference lines

Sometimes the cross reference lines may interfere with your view of the image. The cross-reference lines can be toggled on and off by selecting the Cross Ref toggle button under the View menu. The keyboard short cut for toggling the cross-reference lines is Ctrl+K.

 Time Dimension

In SRView all images are four-dimensional, with the fourth dimension being time. Ordinary 3D images with no time dimension are really 4D images that happen to have only one point along the time dimension.

If an image has more than one time point, a time slider will appear at the bottom of the ThreeView window immediately above the message area (Fig. 4).  The time slider is used to select the time point at which to display the three spatial dimensions.  The time slider is visible only when the displayed image has more than one time point.

Time points are specified in terms of their index along the time dimension in the image, so they always range from 0 to (number of time points - 1).

FIGURE 4

Selecting a time point

To select a particular time point for display, grab the time slider with the left mouse button and drag to the desired time point. The current time point is displayed above the slider and updates as it is dragged.
 

Stepping through time points

Use the left and right arrow keys to step backward and forward through the time points.
 

 Plotting Time Vectors

The time plot tool provides interactive plotting of time vectors. A time vector is the set of pixel values for all points in time for a given point in space.  See Tools for a brief overview of the Tools menu. The time vector plotting facilities are described in a separate chapter of this manual.

Rotating an Image

You can rotate images.  The rotations described here are calculated dynamically just for the display; the image data aren't actually altered.  For ways to create new rotated images in which the data have actually been recalculated for the rotation, see Rotations with Resampling

The dynamic rotation feature is turned off at startup so you don't inadvertently rotate the image while working on it.  To enable dynamic rotation, go to the Rotate submenu under the View menu, and turn on the Apply Rotation toggle button.

To rotate the image, drag with the right mouse button in a circular motion on the image in any of the three quadrants.  The image will rotate with the pointer as it is dragged around on the image.  As you might expect, the rotation is about the normal to the plane of the quadrant.

Rotations are cumulative, so you can rotate first in one quadrant and then in another, building up any total rotation you want.

As already mentioned, there is a Rotate submenu under the View menu.  There you will find buttons labeled Right and Left that rotate the image clockwise and counterclockwise in one-degree increments in the LR quadrant.  There is also a Reset button which sets the display back to an unrotated state: it zeros the rotation.  If you just wish to turn off the rotation temporarily, use the Apply Rotation toggle button.  When Apply Rotation is off, the image is displayed without applying any rotation that may have been set, but the rotation is retained and applied again when Apply Rotation is turned on.

The current rotation is saved in the scan analysis file for an image whenever you choose the Save, Save As... or Save Overlay As... items from the File menu.  The rotation is loaded again when the scan analysis file is read in; so when you reopen an image, it will be displayed automatically with the rotation it had when last saved (assuming Apply Rotation is turned on).
 

Zooming an Image

To magnify the image (zoom in) select the = key; think of it as the key with the + sign for positive zoom.  Each time you press this key the magnification increases, with a maximum magnification factor of 12.  To minify (zoom out) press the - key. You cannot minify below a magnification factor of 1.  At any time you can reset the magnification back to 1 by pressing the \ key (the one next to the zoom in key).

The zoom in, zoom out, and zoom reset functions are also available by menu selections under the View->Zoom menu.

When you magnify the image, the whole display is magnified: all four quadrants.  Ususally, the window on the screen will be too small to show the whole display.  In that case SRView will automatically scroll the display within the window to bring the LR quadrant into view, since it is the LR quadrant in which you will usually want to work.  You can scroll to any other part of the image by using the scrollbars.

The message area displays the current zoom factor setting.
 

Scrolling the Window

Whenever the entire image does not fit into the window, the scrollbar sliders on the bottom and right of the window can be dragged to bring any part of the image into view.  This is helpful when working with zoomed images.

Pressing the arrow heads at the ends of the scrollbars cause scrolling in repeated small steps.  Clicking between the scroll slider and the end of the scrollbar causes scrolling in large steps towards that end of the scrollbar.
 

Resizing the Window

The window can be resized at any time by grabbing a corner and dragging.   This does not change the magnification, just the amount of the image that  can be seen within the window. This is helpful when zooming so as to use as much room on your screen as is available and convenient.
 

Tools

There is a Tools menu. The tool selection determines the action of the left mouse button.  When over the image, the cursor changes depending on the current tool selection.  In the Tools menu, the text of the button of the currently selected tool will be blue.  There are seven tools:

Creating  an ROI (or midline)

To create ROIs  and midlines:

FIGURE 5

Changing an ROI (or midline)

To change  ROIs  and midlines:

Moving ROI points

To reposition an ROI point, grab it with the left button and drag it to the desired location.
 

Moving whole ROIs

To move an ROI, hold down the control and shift keys and grab the ROI with the left button and drag it to the desired location.
 

Deleting ROI points

To delete an ROI point, hold down the Shift key and click on the point.  The point is removed from the ROI.
 

Deleting whole ROIs

To delete an entire ROI, hold down the Shift key and click on a line segment within the ROI. This "selects" the ROI, and if you have done it successfully, all lines in the ROI will change color to cyan.  A selected ROI can be deleted by pressing the Delete key.  You can also delete a selected ROI by choosing Delete under the Edit menu.
 

Inserting ROI points

To insert points, hold down the Control key and click on a line segment at the location you would like a new point. The new point will appear.
 

Changing an ROI's label

To change an ROI's label, you must first select the ROI:  hold down the Shift key and click on a line segment in the ROI.  The lines in the selected ROI will turn cyan.  Now choose the ROI Labels ... submenu from the ROIs/Masks menu.  This brings up the ROI Labels dialog (Fig. 4).  Enter a new label for the ROI into the Active Label text box, or click on one of the predefine labels in the list under the text box to move it into the text box.  When the new label you want is in the text box, click OK.  This will assign the new label to the selected ROI and make that label the active label.

Copying the Last ROI

The last ROI on which you worked (created, edited, or clicked on) can be copied to another slice. Simply move to the slice into which you wish to place a copy of the last ROI. Then press Ctrl+V , that is, hold down the Control key and press V.  This function is also available by selecting Copy Last ROI  from the ROIs/Masks menu.
 

Turning ROI Display On and Off

ROI display can be toggled on and off with the Show ROI button under the ROI menu.  The keyboard equivalent is Ctrl+R.  The default setting at start up is to show the ROIs.
 

About ROIs and Rotated Images

ROI drawing and editing can be done on rotated images, but there are some limitations and issues of which to be aware.

You can only save ROIs drawn on the three principal planes of the unrotated image.  ROIs drawn on oblique planes are discarded when the overlay is written into the scan analysis file.  This is because the scan analysis file format does not support oblique ROIs.

The LR quadrant shows ROIs that lie in the plane of that quadrant.  Be aware that if you rotate the image such that the plane in which an ROI was drawn is tilted with respect to the plane of the LR quadrant, then that ROI will not be displayed and effectively becomes invisible.  It can be fairly difficult to find your way back to the orientation where the ROI will be displayed again in the LR quadrant.  Therefore, normally it is best not to rotate the image after you have started drawing ROIs, except for rotations about the normal to the plane of the ROIs.

The UL and UR quadrants show the intersections of all ROIs with the planes of those quadrants, even for ROIs drawn on oblique planes.  So, even though you may not be able to see an ROI in the LR quadrant because the image is rotated away from the plane in which it was drawn, the ROI's intersection in the UL and UR quadrants will still be displayed.

The Tcl mask-making command will ignore ROIs drawn on oblique planes: it only uses ROIs drawn on the three principal planes of the unrotated image.
 

Loading Multiple Images

SRView keeps images loaded in memory until you explicitly close them. To load multiple images, just open more files as explained in the section on Loading and Displaying an Image. Each time you open an image file, it is loaded and displayed. Any image being displayed at the time you open another file will be replaced in the display by the new image, but will remain loaded in memory.
 

Displaying Loaded Images

SRView maintains a list of loaded images under the Images menu. The name of the currenly-displayed image is in the title bar at the top of the main window, and shown in blue letters under the Images menu. To bring a loaded image into the display, select its name under the Images menu.
 

Selecting a View-Plane for the LR Quadrant

The three orthogonal views displayed in the quadrants are the three principal planes (xy, xz, yz) of the image data after application of any rotation that may have been specified.  That is, they are the principal planes in the space of the rotated image.  It is helpful to think of all images as rotated images: unrotated images are just rotated images with zero rotation.  The XY plane of an image is displayed in the LR quadrant when it is first loaded.  To display one of the other planes in the LR quadrant, choose the plane you want from the Plane Select submenu of the View menu.  The choices are XY plane, XZ plane and YZ plane.  In the submenu, the currently-selected plane will have its button indicator darkened.  Setting the view-plane for an image does not affect the view-plane set for other loaded images.  Your choice of view-plane will remain in effect for an image until you change it or close the image.

The most likely reason for changing view-plane would be to draw ROIs on a different view.
 

Saving Images and Overlays

Image data are stored in NIAAA image file format.  ROIs, midlines and rotation matricies are stored together using the NIAAA scan analysis file format.  NIAAA image files are normally given a .img extension, and scan analysis files are normally given a .paf extension.  Normally, scan analysis files are given the same name as the associated image file, but with a .paf extension.  SRView uses this naming convention as its default, but you can override that default by using the different Save operations described below.

All images in SRView have a 4x4 rotation matrix associated with them. If an image is not rotated, the rotation matrix is simply the identity matrix.  The rotation matrix and any ROIs the image may have are saved whenever a scan analysis file is written.  In the rest of this section the word overlay is used to mean ROIs, midlines and rotation matrix.

The File menu has four save choices: Save, Save As ... , Save Image As ... , and Save Overlay As ...  .  To undersand the differences among these Save operations, it is helpful to know that each loaded image and each loaded overlay keeps track of the name of a file where it is to be saved. We will refer to this as the "default file" for the image or overlay. When an image or overlay is loaded from disk, its default file is set to the name of the file from which it was loaded.

Save writes the currently displayed image and its overlay to their respective default files.  This means that the image and overlay will be written back to the files from which they came (unless you have used one of the Save As operations on them since first loading them).  The existing files are overwritten by the current image and overlay.

Save As ... writes the currently displayed image and overlay to disk using a file name specified by the user.  Choosing Save As ... brings up a file selection dialog box (Fig. 2) that is used to specify the directory and file name under which to save the image.  Enter the name under which to save the image.  The overlay will be saved in the same directory and under the same name, but with a .paf extension.  The name of the image in the display will be changed to reflect the file name used in this Save As ... operation.  The file names used for saving the image and overlay become the new default file names.  So these will be the files to which the image and overlay are saved in future Save operations.  You will be warned if there are existing files that will be overwritten by this operation.

Save Image As ... writes the currently displayed image to disk using a name specified by the user.  Choosing Save Image As ... brings up a file selection dialog box (Fig. 2) which is used to specify the directory and file name under which to save the image.  Any overlay associated with the image is not saved by this operation.  The default file name for the image is changed to the file name used here. So, this file will be the file to which this image is saved in future Save operations.  The default file name for the overlay is unchanged.  You will be warned if there is an existing file that will be overwritten by this operation.

Save Overlay As ...  writes the currently displayed overlay to disk using a name specified by the user.  Choosing Save Overlay As ... brings up a file selection dialog box (Fig. 2) which is used to specify the directory and file name under which to save the overlay.  The currently-displayed image is not saved by this operation.  The default file name for the overlay is changed to the file name used here.  So, this file will be the file to which this overlay is saved in future Save operations. The default file name for the image is unchanged.  You will be warned if there is an existing file that will be overwritten by this operation.

Keep in mind that these save operations only act on the currently displayed image and/or overlay.  Other images and overlays that may be loaded are not saved. However, if there are unsaved changes to any loaded images or overlays, you will be prompted to save them when you exit the program.

At present, SRView only writes ROIs, midlines and rotation matricies to scan analysis files.  Rotation matricies are stored as what the scan analysis format calls as  a "global transformation matrix".  If you open a scan analysis file that has data in it other than ROIs, midlines and a global transformation matrix, then when you save the file, that other information will be lost.
 

Closing Images

When you no longer need to keep an image loaded in memory, you can close it.  To do this, use the Images menu to bring the image into the display if it is not already displayed, then select Close from the File menu.

You should save any changes you have made before closing; but if you forget, SRView will remind you and give you a chance to save the changes.
 

Masks

Masks are images, and any image can be used as a mask.  The difference is primarily one of intent.  Masks are intended to describe regions of other images which are to be masked.  Normally, mask images are stored on disk and in memory as one byte per pixel, and the pixels are all either 0 or some specific positive value, corresponding to OFF and ON respectively.  Mask images are loaded from disk the same as other images.  Masks appear in the Images menu, and can be displayed just like other images.

Although you can name them whatever you like, the convention is to append Msk to the names of mask images prior to any extensions introduced by a period.  Also, mask names are normally based on the image for which they were created.  For example, the mask made for the image named foobar.img would normally be called foobarMsk.img.

Creating Masks

Masks are most easily created from ROIs using the Mask make & apply script under the scripts menu.  The use of that script is described in the Mask Making chapter of this manual.

Masks can also be created manually by using the mask editing tools, starting with a blank mask image.  Mask editing is explained in a later section below. Here is how to create a blank mask image which can be painted with the mask editing tools:

  1. Display the image for which you want to make the mask.  Do not apply any mask to this image.
  2. Select the mask paint or mask toggler tool from the tools menu.
  3. Click on the image with the tool.  A dialog will appear offering you a button to CREATE new mask. Click on that button.  This creates a new, blank mask image and applies it to the displayed image.  The displayed image won't look any different because the mask is blank.
  4. Now use the paint or toggler tool to paint points into the new mask just as you would for an existing mask.
In the foregoing procedure, the new, blank mask will appear in the Images menu with a name based on the filename of the displayed image with "Msk" appended.

Applying Masks

Mask images can be applied to the currently displayed image.  To do this, the mask image must be loaded, and must have been selected as the active mask image. Normally an image created to be a mask will have the letters "Msk" at the end of its name. Here is how to apply a mask image:
  1. Load the desired mask image from disk as you would any other image.
  2. Display the image to which you want to apply the mask.
  3. Select the mask image to use by choosing Mask Select ... under the ROIs/Masks menu. This will bring up a dialog with a list of loaded images to choose from. Click on the name of the image you want to be the mask.
Once you have selected the mask, it will automatically be applied to the currently displayed image.  All operations available on a regular image are available on a masked image.

Masks can be applied in  three styles: Red Wash (red transparency), Opaque, and Crop.  The default style is Red Wash.  To choose a different style select Mask Styles under the ROIs/Masks menu.  This brings up the Mask Styles submenu from which you can choose the style you want.  Figure 6 is an example of the Red Wash style.  The Opaque style is shown in Figure 7.

Once an image has been selected as the mask image, its application to the displayed image can be toggled on and off by selecting the Apply Mask button under the ROIs/Masks menu.  The keyboard equivalent is M.

A mask can be applied to any image having the same x, y and z matrix dimensions, whether or not the mask was actually created for that image.  If the matrix dimensions are incompatible, the mask application will be turned off.  However, once you have designated an image as the active mask, it remains designated and available for application to any compatible images you subsequently display, even if there are intervening displays of incompatible images.

FIGURE 6


Masking with Multiple Time Points

Images and masks can have multiple time points.  Here are the possibilities and how SRView handles them: In all cases, the mask and image must have the same x, y and z matrix dimensions.

Editing Masks

There are three tools for mask editing under the the Tools menu: Mask Toggler, Mask Erase, and Mask Edit.  When the cursor is over the drawing area its shape will be different depending on which tool has been selected.

To edit a mask, it must be applied to an image.  The edit tools work in all three quadrants of the the image display.

The  Mask Toggler toggles points in the mask ON and OFF.  If a point is ON ( i.e., not equal to zero) and you click on it with the toggler, the point is turned OFF.  If it is OFF, it is turned on. If you click and drag, with the Mask Toggler, the tool will remember the sense of the toggle for the first point, and will only toggle in that sense for the duration of the drag.  For example if you click on a point that is ON so that it is toggled OFF, and then drag, every point that you drag over that is ON, will be toggled OFF, but no points that are OFF will be toggled ON.

The Mask Erase tool erases points (turns ON points to OFF) as you click and drag over the image.  The Mask Paint tool paints points (turns OFF points ON) as you click and drag over the image.

The width of the Mask Erase and Mask Paint tools is specified in terms of their radius in pixels on an unzoomed image.  The default tool radius is 3, which gives an effective tool width of 7 pixels on an unzoomed image.  To change the tool radius open the Settings ...  dialog under the Edit menu, and enter a new value into the Mask Tool Radius box.

The value assigned to ON points by the mask editing Tools defaults to 1.  You can obtain other values by setting the Mask ON Value in the Settings ... dialog under the Edit menu.  This value is also used by the Mask Make & Apply script.

Figure 7 shows a zoomed, masked image where the mask is being edited using the Mask Erase tool.

To save changes to a mask, you must save the mask image itself.  Saving the image to which the mask is applied does not save changes to the mask.  However, if you edit a mask, and forget to save the changed mask image, you will be prompted to save unsaved changes when you close the mask image, and when you quit the program.


 FIGURE 7

Undoing Mask Edits

Masks edits can be undone by selecting the Undo button from the Edit menu.  SRView remembers the last 6 edit operations, so you can select Undo repeatedly up to 6 times.  A mask edit operation is defined as a single stroke, or click and release, of a mask edit tool.  When there are no edits to undo, the Undo button will be grayed out.  The keyboard shortcut for the Undo button is ctrl + E.
 

Multilevel Masks

Sometimes masks are created with multiple ON regions having different numeric values.  These different values signify regions in the masked image that differ in some way. For example, in a head image mask one value might signify gray matter and another value white matter.
 

Displaying One Level of a Multilevel Mask

When displaying multilevel masks it is often helpful to be able to look at the regions one level at a time.  You can do this by specifying the range of values to use for the mask.  Values outside the specified mask range are ignored and treated as not masked, i.e. OFF.  The range of mask values to use is specified in terms of an upper and lower limit, Mask Display Max and Mask Display Min.  Set these limits in the Settings... dialog under the Edit menu.

The Mask Display Max and Mask Display Min default to 255 and 1 respectively when SRView starts up.  When you change them, they stay changed for the duration of the SRView session, or until you change them again through the Settings... dialog .

Editing a Multilevel Mask

As previously described, the Mask ON Value under the Settings... dialog controls the ON value laid down with the mask Mask Paint tool.  So, with the paint tool you can edit a multilevel mask, assigning whatever value you want to any area.

Two-Color Mask Display

A two-level mask with values 1 and 2 can be displayed over an image in two colors.  Set mask type to opaque, set Mask Display Min = 101, Mask Display Max = 102 (Edit - Settings menu selection) to see mask value 1 as red, mask value 2 as blue.  This display mode can be used to show activated pixels in 4D masks generated in statistical analyses.  

Multi-Color Mask Display

A 3D multi-level mask with values 1 to 7 can be displayed over an image in different colors.  Set mask type to opaque, set Mask Display Min = 201, Mask Display Max = 202 to activate this display mode.  This display mode can also be used to display activated pixels in a statistical analysis in combination with a 3D multi-level mask.  To do this, generate a 4D mask having pixel values equal to the original 3D mask values, but having activated pixels set to value 101 (above activation threshold) or 102 (below negative activation threshold).  Then apply this mask to the desired 4D image (image and mask must have the same number of time points).  Positively activated pixels will be displayed in red, negatively activated pixels will be displayed in blue.


Mask Region Labels

A mask having mask region labels can be generated from an image that has a set of labeled ROIs -- see Quick Start - Multilevel Masks.  When a mask having mask region labels is applied to an image, the message region of the SRView window shows the mask region label, the mask voxel coordinates, and the mask value for the cursor location on the image. 

Changing Mask Colors

The colors used to display the mask and the image can be modified by the user.  See Color Lookup Table Editor in the User's Manual.

Windows Menu

The Windows Menu allows you to open other windows with different kinds of displays and functions.  Clicking the X icon in the upper right corner of the window will close the window.  (Be careful about clicking the X icon in the main window; that exits the program without prompting to save changes.)

Command Window

The Command Window is a command line interface to SRView's embedded Tcl/Tk interpreter.  This interpreter supports all of the standard Tcl/Tk commands, and also has installed in it many special commands for manipulating the SRView display and operating on images, overlays and other objects defined in the SRIP software package.  The Command Window is used primarily by programmers as a tool for testing and script development.  However, it is available to all users, and in some cases may afford the knowledgeable user a way to accomplish special tasks not available through menu selections.  The use of the Command Window is explained in another chapter of this Manual.

Image Information Window

The Image Information Window displays the header information for the currently-displayed image.

Image Array Window

The Image Array Window displays multiple images at successive z or t values.  It will display masks in the same mask mode as selected in the ThreeView Window.  If transformations from overlay files are applied to the image or mask in the ThreeView Window, the difference of the translation parts of the mask and image transformations will be applied to the mask in the Image Array Window.  Rotations are not yet implemented in the Array Window.  A rectangle is drawn around the image that corresponds to the image in the lower right quadrant (x-y plane) of the ThreeView Window.  If the image z or time setting is changed in the ThreeView Window, and then the cursor is moved to the Array Window, the Array Window will redraw itself with the new ThreeView image selected.  Click on any image in the Array Window to display it in the ThreeView Window.  The Array Window can be resized.

The window has two menus, Array and Scale.  The Array menu selections are Redraw, Slices, and Slices and Time.  Redraw updates the window for the current ThreeView Window settings (although the Array Window will usually redraw itself when the ThreeView Window is changed and the cursor is moved to the Array Window).  Slices sets the Array Window to display as many z values of the image as possible, at the current time setting.  Slices and Time sets the Array Window to display as many time values of the image as is possible at the current z setting. Multiple z values will be displayed if possible.  The Scale menu sets the image size. The selections are 1/4 x, 1/2 x, 1 x, and 2 x.

The information area at the bottom of the window shows the current scale setting.  It also shows the z and time values for the image under the cursor.  

 Scripts Menu

The Scripts menu lists Tcl/Tk scripts that can be invoked to perform various tasks.  The scripts are separate from the SRView program, but are run by the SRView's embedded Tcl/Tk interpreter.

There is a standard set of scripts that is normally placed under this menu.  The system administrator may customize this list.  At this writing there are three standard scripts:

Mask make & apply
This script makes a mask from ROIs in the currently displayed image and applies the mask to that image.  See Mask Making.

Rotate - active image
This script calculates a new, rotated image from the currently displayed image using the current rotation in the display.  Cubic spline interpolation is used for calculating the points in the new image.  The rotated image is calculated with a 256 x 256 x 256 matrix and 1 mm sampling in all three dimensions. See Rotations with Resampling.

Rotate - batch
This script calculates new, rotated images for all the images in a given directory.  It has a graphical user interface that allows specification of output image matrix dimensions and sampling intervals.  See Rotations with Resampling.

The user can write scripts and add them to the menu that he or she sees when running SRView.  See the SRIP/SRView Programmer's Manual for information on how to do that.
 

Quitting SRView

To quit SRView, select Quit from the File menu.  It is best to save changes before quiting, but if there are unsaved changes to any loaded images or overlays, SRView will warn you and give you an opportunity to save them before quiting.
 

Errors

Common errors and warnings will pop up on top of the ThreeView window in dialog boxes, but some less common errors will only appear in the terminal window.  Errors from the embedded Tcl interpreter will only appear in the terminal window.  An exception to this is that Tcl errors that occur in scripts run from the Scripts menu will be displayed in a popup message box.

It is good to organize your screen at the very beginning of an SRView session so that the terminal window is visible while you work. Resizing it to show just a few lines and moving it to the bottom of the screen usually works well.

If you select a function or give a command and it seems like nothing happened, be sure to check the terminal window for messages.

If you get an error message you don't understand, write it down so that you can report exactly what it said. You can obtain assistance from your system administrator or from Synergy Research at the phone number and email address below.
 


Key and Mouse Button Summary Tables

Mouse Button Actions

Button Function
Left Depends on tool selection. ROI create and edit tool actions are summarized in table below.
Middle Window and level adjustment. Vertical drag adjusts level. Horizontal drag adjusts window.
Right Rotation. Drag in circular motion on the image to rotate. View->Rotate->Apply Rotation must be turned on.

Some X Window managers on Macintosh OS X will do middle- and right-button mouse functions for a one-button mouse if the control (apple) key or option key are held when the mouse button is clicked.

Keyboard Shortcuts

Many operations available through menu selections can be accomplished by keyboard shortcuts. If there is a shortcut for a particular menu item it will be shown on the right side of the menu item's button label. Here is a table of these keyboard short cuts.
 
Menu Item  Shortcut Function
File Open Ctrl + O Open an image file, load and display the image.

Save Ctrl + S Save the currently displayed image and overlay to disk.

Close Ctrl + W Close the currently displayed image

Quit Ctrl + Q Quit SRView




Edit Undo Ctrl + E Undo the last undoable edit. Currently only mask edits are undoable.




View Slice Step:Up Up Arrow Step up one slice for image in the LR quadrant

Slice Step: Down Down Arrow Step down one slice for image in the LR quadrant

Time Step: Up Right Arrow Step forward one time point

Time Step: Down Left Arrow Step backward one time point

Zoom:Bigger = Increment magnification factor by one

Zoom:Smaller - Decrement magnification factor by one

Zoom:Reset \ Reset magnification factor to 1X

Cross Ref Ctrl + K Toggle the cross reference lines on or off




ROIs/Masks Copy Last ROI Ctrl + V Copy last ROI into current slice

Show ROI Ctrl + R Toggle on/off display of the ROIs

Apply Mask M Toggle on/off application of the currently selected mask




Tools Pointer Z Select the neutral pointer tool

ROI Create C Select the ROI Create tool

ROI Edit X Select the ROI Edit tool

ROI Creation and Editing Summary

For ROI creation and editing remember:
ROI Create tool shows a pencil pointer; select it by pressing C.
ROI Edit tool shows a  pointing-hand pointer; select it by pressing X.
Here is a table of ROI operations and their required button and key actions:
 
ROI operation Tool Key and Button Actions
New ROI, lay down points Create click_left at the new point locations
Finish new ROI Create Shift + click_left  (no new point added with this click)
Finish an open line (don't join start and end point) Create Ctrl + click_left (no new point added with this click)
Abort an ROI creation Create Shift + click_left before laying down the third point.



Move a point Edit Drag the point to the new location, release.
Delete a point Edit Shift + click_left on the point
Insert a point Edit Ctrl + click_left on a line segment at location for new point
Delete entire ROI Edit Shift + click_left on a line segment; ROI turns cyan; press Delete key
Copy last ROI to current slice Edit Ctrl + V
Make an inactive (orange) group ROI active Edit Click_left on the orange ROI to be made active

Note: On keyboards without a Delete key, or if the Delete key doesn't function as expected, you can use Delete from the Edit menu instead.


Contact Information

This documentation and the SRView application are both under development. We would very much appreciate hearing from you about suggestions for improvement and any bugs you encounter. Here is who to contact:
Larry Woltz, Ph.D.
Synergy Research, Inc.
301-607-0321
woltz@SynergyResearch.com


Back to Quick Start contents