Section 3

SpreadSheet I/O


 
 
 
 


3.1 Reading Data Using the Read Panel

Bring up the Read Panel using the Read button in the main Optional Panel, type in the dataset filename or use the file browser, select any other required options to read the data and execute the read operation by clicking on the Build & Evaluate button.

The following example reads a frame of data from disk into cell B1. Open the Read Panel by clicking Read on the Options Panel. Set the connection widget labeled Starting in Frame: to contain B 1 1. Click on the button File Name or Pattern to bring up the file selector; go to the IISS distribution directory examples/hugo and select the file hugo.01 . Select Ready to close the file selector and display the file in the Read Panel. Click on the Flip button so that it lights up. Choose the Build & Evaluate command at the top of the form. This constructs a formula for frame B1[[1]], evaluates the formula, and displays the result.

Now highlight the final character in the file name, which should be the number one, by dragging the mouse over it. Replace the 1 with the # symbol by hitting backspace and then type #. This changes the file name into a pattern which matches any file name in which # is replaced by an integer or decimal number. In this case there should be four matching filenames, so four frames will be constructed. Note that this will require an additional megabyte of RAM for four images each of size 512 x 512. Under the heading Read frames into: select Row of Cells. Build & Evaluate once more, and notice that cells B1, B2, B3 and B4 now have data. Use the scroll bars near the matrix glyph on the Options Panel to scroll to the hidden parts of the SpreadSheet.

For reading 24-bit color images three files need to be specified for the raw data format. The three files which contribute to the red, green and blue components for a Three Channel frame must be defined using the following pattern template:

      file_prefix[red_infix,green_infix,blue_infix]file_suffix

For example,

hugo.[red,green,blue]

matches the three files hugo.red, hugo.green, and hugo.blue . The general pattern:

file.[r,g,b].#

will match the files file.r.1, file.g.1, and file.b.1 to compose frame 1. The files file.r.2, file.g.2, and file.b.2 will be used for frame 2 and so on.

The currently supported options are:

MNOTE: GENERIC file format above refers to standard or commonly used image file formats and includes the filetypes listed below. Note that by GENERIC we are referring to widely used self-describing file formats supported by a variety of software applications on many hardware platforms. If your image is in a fileformat that is not listed below then you can easily convert your image file into one of these standard formats using a program such as convert which is part of the ImageMagick (free) software package from DuPont.

 

The Read Panel may contain some functions that are not yet implemented.


3.2 Reading Data Using the Formula Panel

Reading image data into a frame is a two step process:
 

  1. define the frame's formula including a Read operator
  2. evaluate the formula to execute the read operation

The following example will be helpful to understand the methods of reading data into the SpreadSheet. Start up one of the IISS examples as described in Section 2. Move the cursor into a cell containing a frame with data and press the F key to bring up the Formula Panel. Notice that the formula expression contains a Read_band[...] operator*. In the process of evaluating the formula, data is read from the file specified in the Read_band[] operator arguments.

*NOTE: The text may not completely fit in the box; characters may be positioned out of view, beyond the right edge or past the bottom of the input area; inserting or deleting carriage returns may help the user to see the hidden text. A textual browser is currently being planned for implementation.

So to read data from disk into a frame, the frame's formula needs to contain a Read operator. When the IISS in started up using command line arguments including filenames then the frame formulas are automatically generated for the user's convenience. Frame formulas can also be implicitly defined as described in the previous Section using the Read Panel, or explicitly constructed by editing the Formula field inside the Formula Panel.


3.3 Web-based File Acces, Processing & IISS Cache

In addition to reading the above formats, IISS supports reading of compressed datasets, and datasets residing anywhere on the Internet (World Wide Web) including digital archives, remote servers, and remote-compressed datasets. The distributed aspect of the Image Spreadsheet referred to as the DISS (Distributed Image SpreadSheet) supports remote file access transparently inside the Read[ ] operator or Read Panel. Remote files can be accessed via http (hypertext transfer protocol) or ftp (file transfer protocol) servers on distributed network data servers. The remote file location is specified via a URL (uniform/universal resource locator) pathname as described in Appendix C. IISS supports data compressed using Unix compress (.Z) and gzip (.gz) which can be used in conjunction with remote data using either http and ftp protocols.

To improve performance, IISS uses a caching mechanism for remote and compressed files. If there are multiple references to the same remote or compressed file, IISS only fetches or decompresses the data once, and further references use a cached copy. Local copies of remote files and uncompressed copies of compressed files are saved to a temporary location. Informative messages are given on the console indicating when a file is cached, and where this cached version resides on disk.



3.4 Writing Image Data

Datasets from individual frames can be saved selectively to disk files. To write a dataset, bring up the Write form accessible from the Options Panel, specify the frames and datasets desired, along with the base name, and press the Write button.



3.5 Save and Restore a Sheet

At any point during an IISS session the complete SpreadSheet configuration can be saved into a header file. The saved information includes the number and dimensions of the cells, the frame formulas and the frame display parameters. The frame image datasets will not be stored to reduce space requirements. A calculated data product can be saved separately, using the Write Panel as described above.

An IISS session including formulas and display parameter settings can saved at any time by selecting Save Sheet, from the SpreadSheet Level buttons in the Options Panel. A file selection dialog will be presented, and an ASCII format header file will be generated, using the filename provided with the file extension .iss .

To restore an IISS session stored in a header file, either start the IISS with the filename as the only argument (e.g. iiss my_header.iss ) or select the Read Sheet button on the Options Panel, and specify the desired file.

Feel free to examine a header file which is stored in ASCII format, but do not make changes to it. Inappropriate alterations could render a header file unreadable by the IISS program. However, minor changes can be extremely useful for quickly modifying some parameters rather than creating a desired SpreadSheet using graphical interaction. Appendix A describes the format of the header file and provides suggestions for making appropriate modifications.