  1 	    XIMQ - Display IMQ Images from NASA PDS CDs.     G The XIMQ application was developed as a demo for ISO 9660 CDs.  The PDS L images are distributed as compressed greyscale data, and a volume descriptor and image index file.   H XIMQ reads the volume descriptor and image index, and allows the user toH select a image to display.  It then provides a display of the image, andF allows the user to change display parameters, and do a number of image# processing operations on the image.   H There are a number of command line operators to control the operation of the application:  @   -title		Allows a title to be supplied for the main application
 			window.  3   -icon			Allows icon text to be supplied for XIMQ.   3   -display		Allows the X11 display to be specified.   D   -g <x> <y> <w> <h>	Specify the main window geometry.  Normally the/ 			window will be placed on the display using a 6 			"best fit" routine that looks at the current window 			population on the screen.  F   -file	<dev:file>	Tells XIMQ to read and display a specific IMQ file.  6   -index <dev:file>	Specifies an alternate index file.  A   -vol <dev:file>	Specifies an alternate volume information file.   D   -colors <n>		Specifies the number of colors to use (default = 128)  .   -cmap			Force the use of a private colormap.  B   -staticcolor		Force the use of a read-only colormap (uses screen 			default if not specified).   A   -noequal		Disables equalization.  Normally, the image histogram 6 			is scanned to find the lowest and highest intensity8 			levels, and the pixels are mapped from black to white8 			within this range.  Specifying this switch will cause6 			the pixels to be mapped from black to white without& 			regard to the content of the image.  K   -equal <p> <l> <h>	Specify parameters to automatic equalization.  To find 8 			the high/low levels, a threshold value is used.  This; 			is because there is almost always "noise" at all levels. 4 			So a threshold <p> is used as a percentage of the8 			highest pixel count.  The default is .015.  The input6 			value will be multiplied by .001.  In addition, the9 			black and white points can be adjusted by the <l> (for $ 			black) and <h> for white (0-255).  H   -limits <b> <w>	Specifies the black and white levels for equalization.; 			The range is from 0 to 255.  Forces manual equalization.     F   -shift <l> <i>	Specifies the linear brightness <l> and the amount to6 			shift the brightness from the menu.  The default is1 			0 for the brightness, and 5 for the increment.   F   -gamma <l> <i>	Specifies the gamma <l> adjustment, and the amount to9 			change the gamma from the menu <i>.  The default gamma 2 			is 1.2.  The input values are multiplied by .01  '   -nogamma		Turns off gamma correction.   B   -flconvolve		There are two sets of convolution logic for some of5 			the image processing selections.  One uses integer 3 			arithmetic, the other uses floating point.  This   			switch forces floating point.  B   -inconvolve		There are two sets of convolution logic for some of5 			the image processing selections.  One uses integer 3 			arithmetic, the other uses floating point.  This  			switch forces integer only.  2   -zoomstyle <n>	Allows different zooming methods.  " 			0 = Pixel Replication (default) 			1 = Nearest neighbor  			2 = Area (3x3) average   A   -nosqzoom		Allows non-square zooming.  Normally, the image will $ 			only be scaled with a 1:1 aspect.  @   -norbguns		Sets the red and blue guns to zero.  This is useful1 			when the screen is monochrome, but the display 6 			hardware is color.  All intensity values are put on 			the green gun.   &   -debug		Prints debugging statements.  A   -sync			This sets XSynchronization to TRUE.  Each X11 operation ; 			is completed on return from the call.  Useful mostly for 
 			debugging.      Notes:     Where do I get the images?  I    NASA sells images from various missions on multiple CD sets.  They are /    distributed by Planetary Data Systems (PDS).   +   Why does XIMQ not use colormap twiddling?   H    The application was written to run on any X11 display, and to work onI    TrueColor 24-plane displays, as well as other non-pseudoColor devices. J    To do this, a number of functions that could be implemented as colormapK    operations - such as brightness and gamma correction, are implemented as ;    pixel operations that require the image to be repainted.   %   Why doesn't XIMQ use the X Toolkit?   J    No particular reason, except that the author is not a Motif applicationL    programmer, and because some of the standard Motif widgets would be a bitG    slow to load up and modify (for instance the file selection window).      What is "Equalization"?   H    The image is supplied with a histogram, which is simply a 256 elementH    array that contains a count of how many pixels in the image there are,    for each of the 256 possible intensities.  I    The simplest way to display the image would be to map each image pixel H    from 0-256 to a colormap that contains a greyscale ramp from black toJ    white.  However, most images have their intensities mostly concentratedH    in a much smaller range, and when the image is mapped in this fashionJ    it appears "washed out" and does not have a lot of true black and white	    areas.   H    The equalization that XIMQ provides is to scan the histogram and findG    the area where most of the intensity data exists, and use this pixel J    range as the bottom and top of the pixel ramp from black to white.  AnyH    of the pixels outside this range are then clamped to either black, orJ    white.  The result is that the image is less washed out, and has better    contrast.  K    There are 3 values of interest in this analysis:  The computed black and G    white thresholds, and a "threshold" value that is used to find them. K    Most non-synthetic images have some amount of noise outside of the range L    where most of the pixel intensities are.  So to just look for zero countsM    in the histogram will usually fail.  Instead, a value (the deault is .015) I    is multiplied by the highest pixel count to derive a "threshold" below K    which a count is considered "noise".  The histogram is then scanned from L    0 to find the first run of two pixel values that have a count higher thanM    this threshold (this helps eliminate noise spikes) - and this is the black O    threshold.  The same process is done for white, scanning backwards from 255.      What is "Calibration"?  I    This is something that was hacked into the code.  Essentially, the PDS H    contains "Dark Current" images, which is what the camera sees when itI    is covered.  By scanning for a dark current image prior to the current N    image, that has the same characteristics as the image, and then subtractingJ    the dark current image from the base image, the final image has any CCDE    anomolies removed.  This works *really* well most of the time.  On K    occasion, the dark current image can't be found, and things get a little >    bogus.  You can turn off calibration in the secondary menu.     What is "Gamma Correction"?   I    This is a non-linear function that is applied to the greyscale ramp to H    provide a better contrast lightening and darkening of the image.  TheI    default is 1.2 which gives a modest darkening (contrast) to the image. -    A value of 1.0 will provide a linear ramp.   F    To derive the gamma correction, the normal intensity for a pixel isE    converted to a value between 0 and 1, and then raised to the gamma D    value (that is, intensity ** gamma).  As part of the process thatE    derives the final pixel value, the pixel intensity is looked up in     a gamma correction table.  +    Think of gamma as a contrast adjustment.   K    I've also found that if you leave equalization on (the default) and then M    crank the gamma adjustment to 0.1 (gamma brighten) that image data that is H    not normally visible jumps into the picture.  A good example is imageF    number 34698.58 and a number of the other S_RINGS pictures from the@    VOYAGER 1 series.  Outer rings will appear when this is done.    What is "Linear Brightness"?   F    This simply "shifts" the final pixel value by some amount.  So eachF    pixel appears lighter (or if the shift is negative, darker).  It isI    a linear function, as it effects each pixel intensity in the same way. E    The actual pixel data isn't altered, just the relative brightness.     What is the "Noise Filter"?  J    This filter takes a pixel, plus all it's neighbors in a 3x3 matrix, andJ    sorts them to find the median value.  The pixel is then replaced by theH    median value.  The end result is that very small areas of noise, thatH    show up as bright dots, or lines - are replaced by a pixel value that%    blends into the rest of the image.     What does "Enhance Edges" do?  I    It applies a laplace filter to the data.  The result is to amplify any I    edges in intensity.  This logic probably needs some refinement, but it     can show some neat stuff.    What does "Blur Image" do?   I    It does the same thing as the noise filter, only instead of the median 8    value - it replaces the pixel with the average value.  $  What are the zoom style selections?  N    The simplest, and default, selection is a pixel replication.  Each pixel isH    simply multiplied up in size.  The result is simply very large squareN    picture elements.  The nearest neighbor, and area average zooms will resultM    in zoom images that are prettier... however, the image data is altered and     is no longer exact.  