Print View

NERS/BIOE 580
Lab01 - Introduction Module A

Purpose:

Students in the NERS-580 computational lab will use computer programs to solve problems in radiation imaging. This module is intended to familiarize students with the script tools that are used to complete each module. Secondly, the folders where various files and programs used in this course can be found are identified .

Prerequisites:

The current version of the laboratory software runs in the Microsoft Windows environment (XP or W7). This requires installation of XSPECT programs and data files( XSPECT_v3-5c.pdf). Additionally, The tcl/tk script interpreter and the gnuplot graphing utility must be installed on the computer system being used.

The Radiation Imaging Computational Lab was originally developed on Unix systems using the c-shell script lanquage (csh). The use of tcl/tk on Unix system was subsequently introduced. In 2005, support for Unix systems was dropped. Support for Linux and MacOS systems is now being developed. If interested, contact the instructor.


Task Intr-A1: Download and Install the Course Materials.

The files and software required for all but the last few lab modules are contained in the zip archive named 'WinRadImg_3-5c_um.zip'. Download this file and extract the contents. Within the WinRadImg folder is a folder named _Rad-Img. Move this to a location on the system which is convenient for course work.

Note: The present build has a limitation on the full path to files of 80 characters. Choose a location with a short path, such as
C:\ners580\_Rad-Img, to avoid errors from this limitation.

Most of the specialized programs and files used in this course are in this course directory. The lab module documentation refers to full path of this directory as $XSPECT_DIR. The specific path will of course vary depending on where you have placed the _Rad-Img folder.

Task Intr-A2: The XSPECT files and directories.

Open the _Rad-Img folder. You will see three directories with x-ray data (_database), data on various materials (_materials), and detector data (_detectors). Quickly familiarize yourself with the contents of these directories as they will be used throughout the course. The directory _xspect3.5 in $XSPECT_DIR contains the programs and laboratory modules that will be used in this course. Files in other directories will be considered later.

Change directories to $XSPECT_DIR/_xspect3.5. The directory _bin contains executable programs. The directory _templates contains script templates that will be used to complete laboratory assignments. Documentation files for the computational programs are in _doc.

Task Intr-A3: Use of the Tcl/Tk Script lanquage.

Tck/Tk is an open source script language (Tcl Developer Xchange ). that runs on all major operating systems (Unix, Linux, Windows, Mac OS) Simple commands can be interpreted interactively or from a script file for general programming or generation of graphic windows. This lab course makes extensive use of Tcl commands organized in script files to pass variables and execute binary programs that describe the performance of radiation imaging systems.

Tcl4xspect.pdf contains an overview on the use of this open source script lanquage. Instructions for installation of the Tcl/Tk interpreter are included in this document. Using these instructions, install Tcl on the computer being used and perform the examples suggested. Specifically write an example tcl script similar to the example at the end of Tcl4xspect.pdf that creates a file with two columns of data values.

For additional documentation of the Tcl/Tk lanquage, see the 'Tck/Tk Documentation' page of the open source web site where there is a tutorial that is very useful for learning how to use the lanquage. The 'Tclers Wiki' and the WikiBook on 'Tcl Programming' is also useful. A similar wikibook covers the use of graphic widgets, 'Tcl Programming/Tk'. Information specific to Tcl on the Microsoft Windows OS in on the Tcl on Windows FAQ.

Task Intr-A4: Generating Plots with the gnuplot program.

'Gnuplot ' is a command line plotting program for the generation of plots which runs on all major operating systems (Unix/Linux, Windows, Mac OS). 'Gnuplot4xspect.pdf' has instructions for installation of this software on windows systems along with a quick introduction to commands used in this course. After reading this document, run gnuplot and plot the data files generated by the scripts that you have written for the previous task. Using the approach described at the end of the document, generate a PNG graphic file with the plot.

For additional documentation on gnuplot, see the 'Gnuplot Homepage' This has links to demos and tutorials. An interesting blog from a physicist, 'Gnuplotting', describes advanced concepts and has numerous interesting examples.


Lab01 Results:

Turn in a copy of the example script that you develop as a part of task Intr-A3 and a copy of the plot generated by gnuplot as a part of task Intr-A4.

  • L01-A3.tcl : TCL Script for data generation.
  • L01-A4.gpl : Gnuplot commands to plot data.
  • L01-A4.png : PNG graphic file.

Next:

The next module is 02-Intro-B.