Viewer Commands

Graphics
Description
Command
Draw an Arc, Circle or Ellipse arc
Draw a line  lineto
Set Graphics Pen Parameters pen
Set a X,Y Reference Point moveto
Write Text over Image text
Set Text Font, Size and Color font 
Clear Graphics Buffer clear
Draw Graphics in Buffer draw

Image
Description
Command
Display an Image File display
Save Images in various formats imagesave
Set Window Width/Level Area focus
Set the Iso Density Window W/L isowinlev
Set Auto Width/Level Option autowinlev
Set The Window Width/Level winlev
Save Window Contents to a File screensave
Patch an image patch
Load a Palette palette
Paint Window paint
Load the Primary Palette  pripalette
Set the Primary Window W/L priwinlev
Re-Paint the Image repaint
Load the Secondary Palette secpalette
Set the Secondary Window W/L secwinlev

Viewer Control
Description
Command
Set Text in the Caption Bar caption
Enable or disable the Dual Window W/L mode dualwin
Load a list of Image Files loadlist
Disable Prior/Next Selection lock
Enable Prior/Next Selection unlock
Display Next Image next
Display Prior Image prior
Load or run a script process
Select a Shape or Cursor tool
Set Compression Write Option writeback
Set Zoom Factor zoom

Cine Frame Commands
Description
Command
Adds a Bitmap file to the frame buffer addbmp
Adds an 8 bit img file to the frame buffer addimg
Disables the Cine Control Bar within the viewer disable
Enables the Cine Control Bar within the viewer enable
Extract a frame and output to an IMG file extract
Replaces a frame with an IMG file image
 Initialize the cine frame buffer setup

Viewport Commands
Description
Command
Add a viewport to the current page. add
Retrieves the viewport and coordinates from the last mouse click. click
Retrieve the current viewport settings. getparam
Initialize a page of viewports. init
Refresh the viewport page. paint
Load a viewport with image data. setimage
Display the initial page on the viewer. show

Internet Commands
Description
Command
Email files and/or messages.  email
Upload files via FTP to an internet site.  ftp


ARC

Purpose: Draws an arc, circle or ellipse.

Usage:     viewer  arc  x1   y1   x2   y2   <x3   y3   x4   y4>

Notes:      The  ARC  command draws an arc within the bounding box specified by  x1, y1  and  x2, y2.  The bounding box coordinates are the upper-left and lower-right coordinates respectively.  The optional  x3, y3  and  x4, y4  parameters specify the starting and ending coordinates of the arc;  the arc is drawn counterclockwise from the starting point to the ending point.  If the starting and ending points are not specified then a closed circle or ellipse is drawn.  These coordinates may be expressed as numeric values or valid variable names.  The color, width and line type are specified by the previous PEN  statement.


AUTOROI

Purpose:   Enables/Disables the Auto Roi function allowing the script to run after specifying a ROI.

Format:    viewer  autoroi    on/off

Notes:  When the Autoroi function is on,  The 'Auto Process ROI' option in the viewer is enabled. This will enable the selected script to run upon completion of the user graphically specifying a Region Of Interest or clicking on the image.



AUTOWINLEV

Purpose: Enables or disables the Auto Width/Level menu option.

Usage:     viewer  autowinlev on / off

Notes:      This command will enable or disable the ' Auto Width/Level '  menu option of  the viewer.  When on, incoming image width and level parameters are calculated and applied automatically. While this may not always be the optimum values for viewing specific values it will ensure that incoming images are visible.


CAPTION

Purpose: Set the text of the FP Viewer caption bar.

Usage:      viewer  caption   text

Notes:       The  CAPTION  command will set the text of the top bar of the viewer application window.  The  text  parameter must be a legal text string.


CLEAR

Purpose: Clears the viewer of text and graphics.

Usage:     viewer  clear

Notes:      The  CLEAR  command will erase text and graphics from the viewer window.  This command does not erase the image.


DISPLAY

Purpose: Display an image file in the Viewer  window.

Usage:     viewer display  filename

Notes:      This command will send an image file to the viewer window to be displayed.  The  filename  parameter may be a text variable (preceded by a  '$'  variable) or the path and name of file.  The file must have a valid image format.


DRAW

Purpose: Applies graphics and text commands to the image.

Usage:     viewer draw

Notes:      Drawing commands such as  TEXT,  LINETO,  MOVETO  and  PEN  are not applied to the image until the  DRAW  statement is executed.


DUALWIN

Purpose: Enable or disable the Dual Window W/L mode.

Usage:     viewer dualwin   on/off

Notes:      This command will enable or disable the ' Dual Window W/L '  menu option of  the viewer.


EMAIL

Purpose: Email images and/or messages from the viewer using a pop3 mail account.

Usage:     viewer  email  <filename>

Notes:     Use this command to open and send a message and attach files. filename is the name of the file to attach to the email. Multiple files can be sent from a list placed in a text file by specifying the list file preceeded by the '@' character.  When this is executed the  Email Image(s)  dialog box will appear.


FTP

Purpose: Send file(s) via FTP to a remote computer.

Usage:     viewer  ftp  <filename>

Notes:


FOCUS

Purpose: Select a sub-window to apply window width/level parameters.

Usage:     viewer  focus  x1  y1  x2  y2

Notes:     Parameters  x1,  y1 are the upper left hand coordinates,  x2,  y2 are the lower right hand coordinates of the rectangular region to apply window width/level parameters.  These coordinates may be expressed as numeric values or valid variable names. The area outside this region is not affected by subsequent width/level changes.
 


FONT

Purpose: Select a new font for use by the  TEXT  statement.

Usage:     viewer  font   face name   size   weight

Notes:     The  face name  parameter must be enclosed within quotes.  "Arial" ,  "Courier New"  and  "Sans Serif"  are valid examples of a  face name  parameter.  True Type fonts are allowed.  The  size  parameter is the height of the characters in pixels.  The  weight  parameter is a value between 1 and 9 and describes the boldness of the characters.


IMAGESAVE

Purpose: Saves the currently loaded image to an IMG or picture file.

Usage:  viewer  imagesave   filename

Notes: The  filename  parameter may be a text variable (preceded by a '$' variable) or the name of a picture file.  To save the image in IMG format,  the image must be a valid IMG or DICOM file.  IMG saves are the same output format as the input format.  The file format is specified by the filename extension.  The available formats are:
 

Picture Formats
Extension
File Format
IMG IMG format (if applicable)
BMP Bitmap
JPG JPEG 
TIF TIFF 6.0
PPM Portable Pixel Map
PGM Portable Gray Map


ISOWINLEV

Purpose: Set the Iso Density Window Width and Level parameters.

Usage:     viewer  isowinlev  width   level

Notes:      The  ISOWINLEV  statement will set the Iso Density window width and level parameters of the viewer window.  The  width  and  level  parameters may be expressed as numeric values or valid variable names.


LINETO

Purpose: Draw a line from the previous x, y coordinates to the specified x, y coordinates.

Usage:     viewer  lineto  x   y

Notes:     The  LINETO  command  will draw a line from the previous pen coordinates to the new location specified by the   x  and  y  parameters. These coordinates may be expressed as numeric values or valid variable names.  The color, width and line type are specified by the previous PEN  statement. To change the current position without drawing a line use the MOVETO  statement.


LOADLIST

Purpose: Load a set of multiple images into the  FP Viewer.

Usage:     viewer  loadlist  filename

Notes:      Use this command to load multiple images into the viewer.  The ascii file specified by the  filename  parameter contains the list of files to load.  Filenames must include the complete drive/directory path.  This is the equivalent of the  'Load Images '  menu selection.  The format of the list file is as follows:

Parent    (Any numeric value)
Number of files  (The number of succeeding filenames)
filename
filename
filename
filename
etc.


LOCK

Purpose: Disables the  Load Images  menu option of the  FP Viewer.

Usage:     viewer  lock

Notes:      Use this command to keep the user from loading images into the viewer window by using the  'Load Images'  menu selections.  Use the  UNLOCK  command to restore these menu options.


MOVETO

Purpose: Change the current starting position used by pen plot commands.

Usage:     viewer  moveto  x   y

Notes:      The  MOVETO  command  will move the current plot location to the new location specified by the x  and  y  parameters. These coordinates may be expressed as numeric values or valid variable names.


NEXT

Purpose: Display the next viewer image.

Usage:     viewer  next

Notes:      This the same as the user clicking on the  Next  menu command.


NOTIFY

Purpose: Notifies the FP Viewer application of pending commands.

Usage:     viewer  notify

Notes:      The  FP Viewer program does not execute viewer commands until the  NOTIFY  statement  is encountered within a script.  This command should not be executed until all desired viewer commands have been collected by the viewer.


PAINT

Purpose: Paints an image in the  FP Viewer application window.

Usage:     viewer  paint

Notes:      Use the  PAINT  command to clear old and display new images within the viewer application window. The new image file to be displayed is specified by the previous DISPLAY  statement.  If the old and new images are the same size then use the REPAINT  command for faster results.


PALETTE

Purpose: Set the image palette to be used by the viewer.

Usage:     viewer  palette   filename

Notes:      This command will set the color palette to be used by images displayed by the viewer window. The filename  parameter may be a text variable (preceded by a '$' variable) or the name of an existing palette file.  All palette files must reside in the  palettes  directory.  The file must be a valid RGB palette file consisting of  256  consecutive  3  byte values representing the red,  green and blue look up table values.


PATCH

Purpose: Paste an image file over an existing displayed image on the viewer.

Usage:     viewer  patch   filename     x   y

Notes:      This command will paste an image file onto an existing displayed image in the viewer window.  The  x  and  y  parameters denote the upper left hand starting coordinates and are expressed as  numeric values or valid variable names. The  filename  parameter may be a text variable (preceded by a '$' variable) or the path and name of an existing file.  The file must have a valid image format.


PEN

Purpose: Sets the pen style, color and width.

Usage:     viewer  pen   width   red   green   blue   <type>

Notes:  The  PEN  statement is used to specify the line type, color and width to be used with the  LINETO  and  TEXT  commands.  The  width   parameter specifies the width of the line in pixels.  The  red,  green  and  blue  parameters are the combinations of colors used to define the line color and is expressed within the range of  0  to  255  each.  The  type  parameter specifies whether the line drawn will be solid  (1),  dashed  (2)  or dotted (3).  This parameter is optional with the default type being solid (1).  All parameters may be expressed as  numeric values or valid variable names.


PRIPALETTE

Purpose: Set the primary palette to be used by the viewer when in Dual Window mode.

Usage:     viewer  pripalette   filename

Notes:      This command will set the color palette to be used by images displayed by the viewer window. The filename  parameter may be a text variable (preceded by a '$' variable) or the name of an existing palette file.  All palette files must reside in the  palettes  directory.  The file must be a valid RGB palette file consisting of  256  consecutive  3  byte values representing the red,  green and blue look up table values.


PRIWINLEV

Purpose: Set the Primary Window Width and Level parameters (Dual Window W/L mode).

Usage:     viewer  priwinlev  width   level

Notes:      The  PRIWINLEV  statement will set the Primary window width and level parameters of the viewer window.  The  width  and  level  parameters may be expressed as numeric values or valid variable names.


PRIOR

Purpose: Display the prior viewer image.

Usage:     viewer  next

Notes:      This the same as the user clicking on the  Prior  menu command.


PROCESS

Purpose: Select a new process or run a current process.

Usage:    viewer  process   load / run

Notes:     Using the  load  parameter will execute the ' Run New Script  ' menu option.  Specifying the  run   parameter will select the  ' Run Current Process '  menu option of the FP Viewer.


REPAINT

Purpose: Repaints the image in the  FP Viewer application window.

Usage:    viewer  repaint

Notes:     Use the  REPAINT  command to effect changes in the image within the viewer application window.  Previous  WINLEVPATCH  or  DISPLAY statements are implemented when the  REPAINT  statement is encountered.  If clearing the viewer window first is desired then use the  PAINT  statement instead.


SCREENSAVE

Purpose: Saves the contents of the viewer window to a picture file.

Usage:     viewer  screensave filename

Notes:     The  filename  parameter may be a text variable (preceded by a '$' variable) or the name of a picture file.  The file format is specified by the filename extension.  See the IMAGESAVE command for valid formats.


SECPALETTE

Purpose: Set the secondary palette to be used by the viewer when in Dual Window mode.

Usage:     viewer  secpalette   filename

Notes:      This command will set the secondary color palette to be used by images displayed by the viewer window. The  filename  parameter may be a text variable (preceded by a '$' variable) or the name of an existing palette file.  All palette files must reside in the  palettes  directory.  The file must be a valid RGB palette file consisting of  256  consecutive  3  byte values representing the red,  green and blue look up table values.



 

SECWINLEV

Purpose: Set the Secondary Window Width and Level parameters (Dual Window W/L mode).

Usage:     viewer  secwinlev  width   level

Notes:      The  SECWINLEV  statement will set the Secondary window width and level parameters of the viewer window.  The  width  and  level  parameters may be expressed as numeric values or valid variable names.


TEXT

Purpose: Writes text on the image within the viewer window.

Usage:     viewer  text  textstring

Notes:      The  TEXT  command will print text specified in the  textstring  parameter on the image displayed within the viewer application window.  The starting location (upper left hand coordinates) of the text is specified by the most recent  MOVETO  or  LINETO  statement.


TOOL

Purpose: Select a cursor or shape tool option.

Usage:     viewer  tool  type

Notes:     Use the  TOOL  command to select a tool from the menu of the  viewer application window.  The  type  parameter is used to select one of the following:
 
 

Selectable Tools
type
Menu Option 
ARROW Arrow Cursor
CROSSHAIR Cross Hair Cursor
LINE Line
RECTANGLE Rectangle
ELLIPSE Ellipse
POLYGON Polygon
TRACE Trace
FLOODFILL Flood Fill
ISO Iso Density
NONE De-Select Current


UNLOCK

Purpose: Releases the viewer from a previous  LOCK  command.

Usage:     viewer  unlock

Notes:      Use this command to release the viewer from the previous  LOCK  command. This will enable the viewer  ' Load Images '  menu option of the viewer.


WINLEV

Purpose: Sets the window width and level parameters of the viewer window.

Usage:     viewer  winlev  width   level

Notes:      The  WINLEV  statement will set the window width and level parameters of the viewer window.  The  width  and  level  parameters may be expressed as numeric values or valid variable names.


WRITEBACK

Purpose: Enables or disables the Compression Write Back option.

Usage:     viewer  writeback  on / off

Notes:       When enabled, viewed compressed images will be written back to the original file as uncompressed.


ZOOM

Purpose: Sets the zoom factor of images displayed in the viewer window.

Usage:     viewer  zoom   factor

Notes:      Use this command to set the zoom factor of displayed images. Valid  factor  parameters are  25,  50,  100,  150,  200,  300,  400,  800  and  1600.


Viewer Frame Commands










Command:ADDBMP

Purpose:    Adds a Bitmap file to the frame buffer.

Usage:        viewer  frame  addbmp  filename

Notes:        Adds the bitmap file specified by  filename  to the frame buffer.  The previous  frame setup command specifies the image parameters and the number of total frames in the buffer.  The total of  ADDBMP  or  ADDIMG  commands may not exceed the total frames parameter.
 

Command:ADDIMG

Purpose:    Adds an 8 bit img file to the frame buffer.

Usage:       viewer  frame  addimg  filename

Notes:        Adds the 8 bit img file specified by  filename  to the frame buffer.  filename  must be a valid 8 bit IMG file. The previous  frame setup command specifies the image parameters and the number of total frames in the buffer.  The total of  ADDBMP  or  ADDIMG  commands should not exceed the total frames parameter.
 

Command:DISABLE

Purpose:    Disables the Cine Control Bar within the viewer.

Usage:        viewer  frame  disable

Notes:        Disables and kills the frames controller within the viewer.
 

Command:ENABLE

Purpose:    Enables the Cine Control Bar within the viewer.

Usage:       viewer  frame enable

Notes:        Enables and displays the frames controller within the viewer.  Use this command prior to the  SETUP  command.
 

Command:EXTRACT

Purpose:    Extracts a frame and output it to an IMG file

Usage:        viewer  frame  extract  frame  filename

Notes:  Extracts the frame #  specified by the frame  parameter and creates an 8 bit IMG file specified by the  filename  parameter.
 

Command:IMAGE

Purpose:    Replaces a frame with an IMG file.

Usage:        viewer  frame  image  frame  filename

Notes:  Writes and displays an 8 bit IMG file specified by the  filename  to the frame # specified by the frame  parameter.  Image parameters must conform to those of the previous  SETUP  command.
 

Command:SETUP

Purpose:    Initialize the cine frame buffer.

Usage:        viewer  frame  setup  frames  bytes  width  height

Notes:        Allocates frame buffer memory for subsequent  ADDBMP and  ADDIMG  commands.  The  bytes  parameter specifies how many bytes for each pixel (normally 1).  Set to 3 for RGB (24 bit video mode).
 


Viewport Commands







ADD

Purpose: Add a viewport to the current page.

Usage:     viewer  viewport  add    x1   y1   x2   y2   width   height   zoom   pixsize   flags

Notes:      The  ADD  statement will add a viewport to the current page.  The  x1, y1 and  x2, y2  parameters specify the viewport location and size by specifed by upper left and lower right pixel coordinates.  The actual viewport image size is specified by the  width  and  height  parameters.  The initial zoom factor is pecified in the  zoom  parameter.  The  pixsize  parameter is specified in centimeters.   Use the  Flags  parameter to set the options of the viewport.
 


CLICK

Purpose: Retrieves the viewport and coordinates from the last mouse click.

Usage:     viewer  viewport  click viewport number   x   y

Notes:      The  viewport number  parameter is the viewport that was clicked,  the  x  and  y coordinates is the location on the viewport image.
 


GETPARAM

Purpose: Retrieve the current viewport settings.

Usage:     viewer  viewport  getparam    viewport number     zoom    panx    pany

Notes:      Use the  GETPARAM  statement to retrive the zoom and pan parameters of the viewport specified by the  viewport number  parameter.  The results will be placed the variable names specified by the  zoom,  panx  and  pany  parameters.


INIT

Purpose: Initialize a page of viewports.

Usage:     viewer  viewport  init    type   width   height

Notes:      The  INIT  statement will create a page of viewports.  Image is specified by the  type  parameter.  Image types can be Floating Point, Integer or Byte. The represented as 1, 2 or 3 respectively.  The  width  and  height  parameters is the page dimensions in pixels.


PAINT

Purpose: Refresh the viewport page.

Usage:     viewer  viewport  paint

Notes:      Use the  PAINT  command to refresh the entire viewport page.



 

SETIMAGE

Purpose: Load a viewport with image data.

Usage:     viewer  viewport  setimage viewport number    memory(location)
                   viewer  viewport  setimage    viewportnumber filename

Notes:      In the first implemention,  the  SETIMAGE  statement will load the specified  viewportnumber  from the memory array starting at   location with image data.  In the second implemention the viewport is loaded with the  image data from the IMG file specified by  filename.



 

SHOW

Purpose: Display the initial page on the viewer.

Usage:     viewer  viewport  show mode
 

Notes:      Use the  SHOW  statement to display the page on the viewer.  Use this after initializing and adding viewports.  Set  mode  to value of 1 to include text and graphics from the memory array starting at   location  with image data.