Tutorial Contents | Tutorial 2 | Tutorial 3

Cheat Sheet

Tutorial 1: Basics of Using Lispix with Data Cubes

Lispix is a program frequently used for the hyperspectral analysis of data cubes.  With Lispix it is possible to view x-ray images of data cubes at different energy levels and plot a variety of  spectra and images.  After reading this tutorial, you should be able to:

Starting Lispix

Lispix requires no installation.  Simply download the latest version from the internet and extract the program into the desired folder.  When the Lispix icon is double clicked, the following splash screen will be displayed.

Menu Bar | tools


The Lispix Window

Refer to the image below for a basic understanding of the tools used in this tutorial.  The data cube window is a dialogue box.  Each button in the window will open menus to perform functions and calculations on the data cube.


 

Opening a Data Cube

Click “File” on the Lispix Menu Bar and drag down to “Open”.  Double click on a .raw file and wait for it to be imported.  A time bar will run, and when finished, the “data cube” window (see upper left on the figure above) will open.  The slider along the bottom allows you to move through the cube one energy card at a time.  This is useful for checking the quality of the data and to ensure that the import.  Any raw file can be opened and analyzed as long as its corresponding .rpl file is located in the same file folder.  Lispix will also open the EDAX .spd file type.  No .rpl file needs to be stored with the .spd file.

Troubleshooting Section 1

Refer to the table below if you see the following errors.


Error Message

Fix

No .rpl file for m-7wks_FFlyAsh_Area4_40x.

Please use the Import Tool

 to input the image size, data type, etc.

Check to make certain the .rpl file has the same name as the .raw file.  The .rpl file must be in the same folder as the .raw file.

Data cube fails to open

Make certain that the file extensions are correct.  Some programs fail to add the .raw file extension to the data cube.  Also note that Lispix will only open .raw, .spd and Emispec .ser files.  Other file formats are not supported.

Fails to open .spd file

If the .spd file is on a CD, DVD or other non-writable media, Lispix will not be able to open it.  Copy the .spd file to the hard drive or to writeable media and try to open the file again.

A dialogue window will appear asking how many channels to import.  This allows you to trim the data cube down to only the specific number of channels you wish to view, and thus reducing the file size.  On most systems, the default is 10 eV per channel.  Importing the first 1024 channels is equivalent to importing only the first 10 keV of data.  This will cover most light elements such as silicon, calcium, titanium and iron.   Select a number of channels and click “OK”.  Another dialogue window will pop up asking how many bytes of intensity per datum channel to import.

Notes on byte trimming

Many programs store the information per pixel in a data cube to 4 bytes.  This corresponds to 232 or approximately 4 billion.  While it is sometimes useful to have such deep data storage, the majority of information can be stored in 1 or 2 byte deep data.  When trimming the data cube, the user has the ability to reduce the file size by 1/4th by trimming to a single byte.  The single byte represents 28 or 256.  If the user is certain that no value in the data cube exceeds 256, trimming to a single byte can greatly reduce the file size.  Note that the spectra stored in each pixel must not have a value exceeding 255 in order to avoid truncation of the counts to 255 when trimming.  Long dwell spectra (2 or more seconds) should not be trimmed to a single byte.  Note for advanced users: It may not matter if the data are truncated.  If the only interest is in producing qualitative images, truncation will not affect the quality.


After selecting the appropriate byte trim, Lispix will import the data cube.   Depending on the file size, data type, and processor speed of the computer being used, it could take 20 seconds to 3 minutes to import.  Lispix will subsequently save the trimmed copy of the data in the same folder as the original file, with the same filename and with an “m-” as its prefix.

Saving Results

Immediately after the data cube is opened, choose a directory to save your results.  At the far right side of the Lispix Menu Bar, click on the “E1” button.  This will add another row to the Lispix Menu Bar with options for the user.  Click the “E1” button (which will become E2 and E3, subsequently) until it changes to an “S”.  The “S” stands for save, and the dialogue below the Menu Bar will allow the user to choose the directory to save, read and store data.

The default configuration for Lispix is to save files to the same directory where the file is opened.  If the user wishes to save the files to a different folder, this display will allow the user to select it.


 

Slice Slider

A slice slider appears below the data cube once imported.  Clicking on the slider icon and moving it left and right allows you to view the X-ray images at different channels.  The slider can be used to assess the quality of the data.  The text that appears in the slider shows what slice the window is currently displaying.  The slices are numbered the same way the channels are.  Thus, slice 368 is equivalent to channel 368 or 3.68 keV for 10 eV/channel data.

Data Cube Tool

Click on “Tools” and drag down to “Data Cube”.  The Data cube window contains various buttons that open menu boxes that aid in further analysis of the data cube.  Many techniques and buttons contained in the Data Cube menu box will not be covered in this tutorial.  Refer to the “Help” menu for further information. 


Deriving Spectra

To create a sum, max, or multi spectrum for the whole cube, click on “Plot” within the Data Cube window and drag down to the respective function.  Choosing the multi-spectrum plot will generate a dialogue window asking whether to create a “full” or “short” plot.  A “full” multi-spectrum plot will plot sum, logarithmic sum, max, running sum, logarithmic running sum, and running max spectra onto one graph, whereas a “short” multi-spectrum plot will plot just the sum, logarithmic sum and max spectra.   Consequently, the short plot takes less time to generate than the full plot.

Notes on Spectra Types

There are 6 default derived spectra that can be created using Lispix.  Derived spectra are useful for determining the chemical nature of the data cube and provide the guide for creating images.  The authors suggest that plotting the sum and max spectra should be the first step in any data cube analysis.  The types of spectra are:

  1. A sum spectrum shows the total number of counts in each channel by summing all of the pixels.  Sum spectra frequently have more than one million counts in the major peak and can be used to determine bulk compositions of certain materials. 
  2. A max spectrum shows the highest single value at each channel, thus highlighting the presence of both major and minor elements within the data cube. 
  3. The log sum is simply the base 10 log of the values of the sum spectrum
  4. The running sum is the sum value of 10 consecutive channels.
  5. The log running sum is the base 10 log of the running sum.
  6. The running max is the maximum value of 10 consecutive channels.

Saving Plots

Spectrum plots can be saved as text files.  To do so, click on “Plots” and drag down to “Save Plot Text File”.  Save the plot in the desired directory.  The simple text file is a two column tab delimited text file.  The first column is the channel number, and the second column is the counts in that channel.  Lispix will also save the plots as .emsa files for transfer over to a program such as DTSA.

Region Slider and Generating Images

Clicking on “Slider” on the Data Cube window and dragging down to “Region” will generate a region slider right below the selected plot that can be used to look at particular portions of a spectrum.  The width of the pink region can be adjusted by clicking on either edge and extending outwards or contracting inwards.  The region itself can be moved by clicking on its center and dragging left and right. 

When a region of interest is highlighted on the spectrum by the region slider, a max or sum image can be generated for the selected region by clicking on “Image” on the data cube window and selecting “Sum Image within Region.”  A max or sum image can also be generated for the entire cube by clicking on “Image” on the Data Cube window and dragging down to “Max Image of Whole Cube” and “Sum image of Whole Cube.”

Saving Images

Images can be saved as a .jpeg, .tiff, or .raw files.  Click on the image to be saved and then click “File” and scroll down to either “Save Image as JPEG”, “Save Image as TIFF”, or “Save Image as JPEG”, and save the image to the directory of choice. 

Notes on Image Scaling

Many programs such as Windows Fax and Picture Viewer have difficulty displaying images with more than 1 byte of depth.  Occasionally, Lispix users will encounter a problem where the image files acquired on the instrument or processed in Lispix will not display properly using standard imaging programs.  Lispix has a function known as “Scale to byte” under the “Image” section.  Selecting this function will scale the active image to one byte without losing image quality, although the counts will be lost in the image.  This will allow those images to view in most image processing programs.


Cheat Sheet for Tutorial 1

  1. Open .raw file by choosing File / Open
  2. Import data cube by selecting trimming functions (or simply choose not to trim the data)
  3. Open the data cube menu box by selecting Tools / Data Cube
  4. Graph sum and max spectra by selecting from the Data Cube menu box Plot / Multi Spec – Whole Cube.
    1. Alternatively, choose sum or max spectrum for whole cube
  5. Plots / Save As EMSA Text File to save the plot
  6. Open a region slider by selecting from the Data Cube menu box Slider / Region
  7. Change the limits of the region slider to paint over a peak of interest.  Use the edges to broaden or shrink the region and use the center to slide the region along the spectrum.
  8. From the Data Cube menu box, select Image / Sum Image within Region to create an elemental X-ray image.
  9. Save the image as a .jpeg, .tiff or .raw file.