ascii2biff
[ XITE Reference Manual | XITE home ]
Contents
Name
ascii2biff - convert an ascii file to BIFF format
ascii2biff [-title title] [-pt pixel_type]
<ascii-file> <BIFF-file>
Converts an ascii file to BIFF format.
-
pixel_type
-
One of
-
ub, uns_byte
- Unsigned byte, default.
-
us, uns_short
- Unsigned short, 16 bits.
-
ss, sign_short
- Signed short, 16 bits.
-
i, integer
- Signed integer, 32 bits.
-
r, real
- Float, 32 bits.
-
title
- Set the output image title to title
-
ascii-file
- Name of input file, "-" for stdin.
-
BIFF-file
- Name of output file, "-" for stdout.
The file is an ordinary ascii file. Comments start with a
# or a ; and stop at end of line. Blank lines or comment
lines are ignored. Lines with $ in coloumn 1 are treated as
special arguments. The format is
$<keyword> <1 or 2 arguments>
where <keyword> is one of "type", "size", "xsize", "ysize",
"start", "xstart", "ystart", "mag", "xmag" or "ymag".
The format for each <keyword> is:
$type <uns_byte, uns_short, sign_short, integer, real>
$size <xsize> <ysize>
$xsize <xsize>
$ysize <ysize>
$start <xstart> <ystart>
$xstart <xstart>
$ystart <ystart>
$mag <xmag> <ymag>
$xmag <xmag>
$ymag <ymag>
The keywords will be used as image band arguments. If the size
arguments are omitted, the size is calculated from the
organization of the file. Default start arguments are
-(size/2), and default mag arguments are 1.
Pixels inside a line are separated by blanks or tabs. Lines
are separated by newline. If pixel type is uns_byte,
uns_short, sign_short or integer, the special value - means
lowest legal value, and + means largest legal value.
-
Example 1
-
#
$ size 4 3 ; xsize = 4, ysize = 3
3 5 6 4 3 2
7 5 3 2 1 3
The resulting image:
#
# 3 5 6 4
# 3 2 7 5
# 3 2 1 3
#
-
Example 2
-
#
3 5 6 4
3 2 7 5
3 2 1 3
The resulting image:
#
# 3 5 6 4
# 3 2 7 5
# 3 2 1 3
Accepts one band images only.
Otto Milvang, BLAB, Ifi, UiO
1. Convert a formatted text file
ascii2biff -v -pt ss mona.txt mona.img
2. Convert an unformatted text file without write access.
First create a file, for example mona.def, containing:
# Definition file for mona.txt
$type sign_short # set pixeltype
$size 1666 1230 # set xsize ysize
# ----------------------------------
Then convert the file with:
cat mona.def mona.txt | ascii2biff -pt ss - mona.img