i2sun: Convert IRAF images to Sun rasterfiles

Package: vol

Usage

i2sun input output z1 z2

Parameters

input
Input image template, @file, n-dimensional image, or combination.
output
Root template for output images, e.g. "home$ras/frame.%d".
clutfile
Previously saved Sun rasterfile (e.g. output from IMTOOL), containing the color/greyscale lookup table information to be passed along to each output frame. Standard ones can be saved and used with any number of images (e.g. "pseudo.ras").
z1 = INDEF, z2 = INDEF
Minimum and maximum pixel/voxel intensities to scale to full output color/greyscale range. Both are required parameters, and will apply to all images in the sequence.
ztrans = "linear"
Intensity transformation on input data (linear|log|none|user). If "user", you must also specify ulutfile.
ulutfile
Name of text file containing the look up table when ztrans = user. The table should contain two columns per line; column 1 contains the intensity, column 2 the desired greyscale output.
xsize = INDEF, ysize = INDEF
If specified, these will be the dimensions of all output Sun rasterfiles in pixels. The default will be the same size as the input images (which could vary, though this would create a jittery movie).
xmag = 1.0, ymag = 1.0
Another way to specify output rasterfile dimensions. These are the magnification factors to apply to the input image dimensions.
order = 1
Order of the interpolator to be used for spatially interpolating the image. The current choices are 0 for pixel replication, and 1 for bilinear interpolation.
sliceaxis = 3
Image axis from which to cut multiple slices when input image dimension is greater than 2. Only x-y sections are allowed, so sliceaxis must be 3 or greater.
swap = no
Swap rasterfile bytes on output? Used when rasterfiles are being written to a computer with opposite byte-swapping from that of the home computer (e.g. between VAX and Sun).

Description

Given a series of IRAF images, an intensity transformation, and a file containing color/greyscale lookup table information, produces one 2d image in Sun rasterfile format for each 2D IRAF image. This is a temporary task usually used as a step in creating filmloops for playback by a Sun Movie program.

The input images may be specified as an image template ("zoom*.imh"), an "@" file ("@movie.list"), or as an n-dimensional image from which to create multiple 2d rasterfiles. If any images in a list are nD images, all 2d sections from the specified sliceaxis will be written out (default = band or z axis). At present, only x-y sections may be made, i.e. the slice axis must be axis 3 or higher.

The minimum and maximum pixel/voxel intensities, z1 and z2, must be specified as it would be not only inefficient to calculate the full zrange of each image in a sequence, but would also make very jumpy movies. Between input intensities z1 and z2, the pixel intensities may be transformed according to the ztrans parameter: "linear", "log10", "none", or "user".

When ztrans = "user", a look up table of intensity values and their corresponding greyscale levels is read from the file specified by the ulutfile parameter. From this information, a piecewise linear look up table containing 4096 discrete values is composed. The text format table contains two columns per line; column 1 contains the intensity, column 2 the desired greyscale output. The greyscale values specified by the user must match those available on the output device. Task showcap can be used to determine the range of acceptable greyscale levels.

A color table file (clutfile) may be produced on a Sun workstation from IMTOOL (see IMTOOL manual page, R_RASTERFILE parameter and Imcopy function). This file may be specified to I2SUN as the clutfile parameter. Likewise, any rasterfiles previously created with I2SUN may be used as input clutfiles.

The output rasterfile dimensions may be larger or smaller than the input images (see parameters xsize and ysize, or xmag and ymag). The parameter order controls the mode of interpolation; 0=pixel replication, 1=bilinear.

If the output rasterfiles are being sent to a computer with opposite byte-swapping characteristics, set swap = yes (e.g., when running I2SUN on a VAX, with output to a Sun).

Examples

1.  Produce a series of Sun rasterfiles in tmp$mydir/movie/,
    using a pseudocolor color table file saved earlier, with
    input greylevels scaled between 10 and 100.

    cl> i2sun nzoom*.imh tmp$mydir/movie/frame.%d \
        home$colors/pseudo.ras 10 100

2.  Make a movie through the z, or band, axis of a datacube.

    cl> i2sun cube tmp$cubemovie/frame.%d 1 256

3.  Make a movie through the 4th, or hyper-axis of a datacube,
    holding image band 10 constant.

    cl> i2sun hypercube[*,*,10,*] tmp$movie/frame.%d 1 256 \
        sliceaxis=4

4.  Run I2SUN on a VAX, with output to a Sun.

    cl> i2sun @imlist sunnode!home$ras/frame.%d 1 256 swap+

Timings

49 seconds (1 sec/frame) to produce 50 100*100 rasterfiles from a 100*100*50 datacube with no magnification, on a diskless Sun-3/110 using NFS to Eagle disks on a lightly loaded Sun-3/160 fileserver (load factor < 1.5). 5 minutes for the same with a magnification factor of 2 in both x and y, bilinear interpolation. 20 minutes for the same with a magnification factor of 5 in both x and y.

Bugs

See also

display, imtool, volumes.pvol