POWERTOOL

Section: User Commands (1)
Updated: OCTOBER 5, 1991
Index Return to Main Contents
 

NAME

powertool - multiple function tool for HIPS image manipulation  

SYNOPSIS

powertool [-F -I[L] -S] [-H "rows columns [frames]"] [-a] [-u] [-v] [-w]
        [-p "rows columns [frames]"] [-s "rows columns [frames]"]
       [-slid] [-x[x, X] #] [-c #] [-r #] [+#] [-o filename] [ < ]
input_file  

DESCRIPTION

powertool is a very useful image manipulation tool. The input image can be one of the following types:
HIPS, FITS, GIF, ICC, RLE, SUN-raster, PICT, PBM, PGM, PPM, and TIFF

This tool can do all of following jobs alone or in combination.

<1>       Convert images of any supported types above to HIPS images.
<2>       Combine multiple frame images to a single 2 dimensional image.
<3>       Combine multiple frame images into different multiple frame
          images with different or same frame, and with same or different
          frame size.
<4>       Enlarge frame(s) in x or y or both direction with same or different
          factor.
<5>       Input can be either a HIPS image (with header) or raw image data.
<6>       Output can be either a HIPS image (with header) or raw image data.
<7>       Perform image translation.
<8>       Extract a 2D or 3D subimage.
<9>       print out histogram table or ploting data for analysis.
 

OPTIONS

-FIS
specify the pure image type (raw input) to be Floating point, Integer, or Short. The option must be used with the -H option.
-H
This option means input is a pure image file without header. Following the switch the number of rows must specified. The number of columns may either be given or defaults to the number of input rows. The frames is another option and defaults to 1 if not given. If more than one parameter is given, double quotation marks are required for these parameters. Note that on a Sun system, a space is required between -H and its parameters. This rule also holds for -p and -s.
-a
adjust for enlarge with image width is not a power of 2.
or output gnuplot data when used with mhisto.
-c #
column factor - positive integer.
-r #
row factor - positive integer.
+factor
This spatial scaling factor is for both row and column. The +#, -c and -r only effect the output but not the input. For example,
powertool -H "10 25 9" -s "30 75" +2
will output a 60 x 150 x 1 image.
-o filename
This option tells powertool to output to a file instead of standard output.
-p rows columns [frames]
position will be relocated and start at rows columns [frames].
-s rows columns [frames]
This option specifies output frame size and frame number. The default frames=1 {output columns > input columns} or frames = input_frames.
-slid
view messages in a line.
-u
input is a UNIX FITS image.
-v
verbose  messages.
-w
take away all header information (strip header) and output a pure image.
-x[x, X] #
offset - relocate start position at offset (skip) from the beginning of an image file. If -x is used with -H option, it will skip # bytes at the beginning of each frame. The -xX only skip # bytes at the first frame. The # is in hexadecimal if -xx or -xX is given. This is a useful switch: see the examples below.

 

EXAMPLES

NOTE: all names with xxx_yyy_zzz mean that the image has xxx rows, yyy columns and zzz frames.
Convert an image in supporting type to A HIPS image
powertool image.any > image.hips
Generate a Pure Image (strip header)
powertool -w image.x > image.y

powertool will strip image.x of its header store the raw image data in image.y.

Build Image
powertool -H "56 56 24" -s "112 112 6" image.y -o image.z

powertool reads image.y as raw image data and treats it as 24 56x56 frames of 3D image data, and outputs 6 112x112 frames in file image.z.

Fix Damaged Image
powertool -xX 7B -H "192 192 21" -F bad_header.image > good_header.image

In this example, powertool takes away some garbage (123 bytes long = 7B in HEX) from bad_header.image and generates a workable floating point format new image - good_header.image.

Extract 3D image
powertool
-p "32 16 12" -s "192 192 80" Image_256_256_124 > Image_192_192_80

In this example, powertool extracts a central 3D image (32--224, 16--208, 12--80) from a 256x256x124 3D image. Here, -p gives the starting position as row 32, column 16, and frame 12.

Split Image
powertool -s "512 256 62" Image_256_256_124 | powertool -p 256 -s "256 256 62" > EvenImage

Here, powertool splits all even frames from image Image_256_256_124 and generates a new image: EvenImage. First, powertool spreads the image into 62 double size frames, each frame contains 2 old frames, then picks up row 256 column 1 (defaulted by missing argument) frame, which is even frame, and builds a new image (split even frames). If the -p 256 option not used, then powertool generates an image with all odd frames.

Use with mhisto
mhisto Saturn | powertool | lpr

build a histogram list table (not a graph) of Saturn. A text file can be modified by text edtior and used for histo_simulate to generate a certain spectrum.

mhisto Saturn | powertool -a > Saturn.histo.gnu-data

generate histogram data for gnuplot.

separate a RLE color image to 3 HIPS single channel image
# unix script file
RLE=$1
RGB=$RLE.rgb
red=$RLE-hr
green=$RLE-hg
blue=$RLE-hb
irow=`rlehdr $RLE | sed -n -e "s/^.*size ([0-9][0-9]*), [0-9][0-9]*))/1 2/p" | awk '{print $2}'`
icol=`rlehdr $RLE | sed -n -e "s/^.*size ([0-9][0-9]*), [0-9][0-9]*))/1 2/p" | awk '{print $1}'`
rletoraw -N $RLE > $RGB
powertool -H "$irow $icol" $RGB > $red
powertool -H "$irow $icol 2" -p "1 1 2" $RGB > $green
powertool -H "$irow $icol 3" -p "1 1 3" $RGB > $blue
rm        $RGB
exit
This shell script file takes input from command line and output 3 single channel HIPS image files.

 

SEE ALSO

append(n), ccs(1), color_ps(1), elastic(1), hexdump(n), magicprint(1), multi_mask(1), mhisto(1), 3dslice(1), 3dscale_geom(1)  

AUTHOR

Jin Guojun - 10/1/90


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 01:24:55 GMT, December 05, 2024