next up previous contents index
Next: Save image Up: Open image Previous: Reading CT, X-ray, or   Contents   Index

Reading unusual image files

Raw image files

The .IMG files produced by some other software contains a value for the image width that is off by 1. Thus, in order to read the image properly, it is necessary to read the image as ``raw bytes''. After manually changing the width from 511 to 512, the file will read normally.

Reading Images from Macintoshes

Files imported from Macintosh via Mac-TCP are corrupted by the addition of an extra header unless they are sent as ``Raw Binary''. This often creates the impression that PC-based programs are incapable of reading Macintosh images. imal, however, automatically detects the presence of the header and eliminates it before reading any image.

Reading Raw ASCII images

Raw ASCII images consisting of a series of integers are readable by imal. To read an image in ASCII format, select Raw ASCII as the File Type in the Open Menu. Then set the remaining parameters the same way as for Raw Bytes (Sec. 6.6.1). Some of the options (such as bit packing) do not apply to ASCII files and their setting is ignored.

Reading text files

Text files are a convenient way of adding preformatted labels to an image. The text file must have the extension ``.txt'' to be identified. The user is prompted to click at the position to place the text, which is then drawn on top of the current image(s) using the current font and foreground color. No new image is created. If the text is too large to fit, it is truncated. The text is also placed in the alpha channel so it can be selected like any other label, but it cannot be edited in the image editor.

Reading labels as a text file is also a simple way of adding text in non-English character sets (such as Japanese).

Reading multi-frame (3D) images (Unix version only)

Select ``File type = Raw 3-D'', select a filename, and then enter the following information:

No. of frames = Total number of sub-images in the file.

Frame width(pixels) = The width of each frame in pixels.

Frame height(pixels) = The height of each frame in pixels.

Bits/pixel = The image depth (8,15,16,24, or 32).

Multi-frame images are also supported in custom formats (Sec, 6.6).

Reading images from confocal microscopes and PET scanners

These images, which contain multiple views in 3 dimensions, must sometimes be read as Raw 3D images. Typically, the image size for confocal images is 512 x 512. PET scan images are typically 128 x 128. It is necessary to know the number of frames (slices) in the image. Most PET scan images are only 8 bits/pixel, while confocals often produce 24 bit/pixel images.

Reading images from AFMs (atomic force microscopes)

Images from atomic force microscopes are stored as signed integer values representing measured height. These images can be read by setting File Type to raw bytes, and then clicking Data type = Signed and Image Source = Mac in the Read Raw Bytes dialog. The X and Y sizes in pixels, as well as the total bits/pixel (usually 16) must also be set before reading the image.

Alternatively, the afm custom format (included with imal) can be used to read and write these images transparently. The image must have the extension .afm in this case. This can easily be changed by editing the format descriptor file, or by opening the Create Custom Format dialog.

Raw image files

BioRad has two different proprietary image formats: one for their microscopes and one for their gel documentation scanners. Imal supports reading of the 16-bit images (.1sc format) from Bio-Rad scanners. Since BioRad does not release their file format specification, the implementation is probably not perfect, and it is not possible to create 1sc format images. Depending on how the image was scanned, the contrast in the image may need to be increased before the image is visible. Occasionally the program may guess wrong about the byte order. This will cause the Bio-Rad image to appear to be composed of grainy black and white pixels. If this happens, click ``Swap image bytes'' and read the image again.

The BioRad microscope format is not readable directly, but can be converted to the supported PGM format by a utility called bioradtopgm, which is part of the NetPBM package.

Animated and multiframe images

If a GIF or custom format image contains multiple frames, it is automatically animated when read. For other multi-frame images, animation can be started by selecting ``Image..Image properties'' and checking ``Animate'', or by using the ``movie'' command (see Sec. 7.5). Click the main Cancel button to stop the animation.

Pre-processing

Image files can be pre-processed by any other program before being read by imal. This program must be able to read the file and send its output to stdout (the -c flag in gunzip does this). If a file ends in the specified extension, the file is piped through the command shown in the ``Read Image'' dialog before being read. Typically, this would be a program to decompress the image file, but could also, for example, decrypt it or perform some other action on it. The advantage of using an external program to compress image files is that, should a more efficient compression algorithm come along, the new program can be substituted without invalidating the image file format. Also, file formats such as FITS, which have no compression, can be easily stored in compressed form using this feature.

Note: Because of limitations in the design of certain image file formats (namely TIFF), preprocessing cannot be done using a pipe but must use a temporary intermediate file. Thus, this mechanism should not be relied upon to provide absolute security with an encryption utility.

The default pre-processor is gunzip. This means you can read any gzipped image directly into imal without needing to decompress it first.


next up previous contents index
Next: Save image Up: Open image Previous: Reading CT, X-ray, or   Contents   Index
root 2008-10-10