Image Window Library Reference Guide

Introduction

The Image Window Library (IWL) consists of a set of function calls that allow you to communicate with IVE's Image Windows (Monitors) from your application program. The Monitor program displays multiwave, multitime, volumetric image data as a stack of sections, which can be traversed using mouse or key events or thru a calling application. Multiple waves can be displayed together, overlayed in different colors, or one at a time in pseudocolor. The Monitor also draws graphics on top of images to aid in segmenting, region selection, or any kind of marking that contributes to image understanding. There can be multiple Monitors running at any one time and applications can communicate with any or all of them. For just about everything that the monitor can do, there is a function call that returns the current setting, and for many things there is a function call to change the setting. The IW Lib, IM Lib and the WM Lib work together to make programs interactive with the monitor. Most header information is accessed thru IM calls; events such as keypress, mouse and display change are registered with WM calls. Then information such as mouse position, current display section, wave, wid etc are returned through IWL...

C programs using the IWL need to include IWInclude.h. Details on how to link against the IW library can be found in the IM library documentation.

Topics

Release Notes | Initialization and Shutdown | Window Attributes | Image Display | Image Info | Graphics |
Mouse, Keys and Events | Query | Shared Memory | Utility Functions | Matrix and Vector Operations |
Alphabetical List of Functions


Release Notes

IVE 4 handles shared memory differently than IVE 3.3 and its predecessors so applications which manipulate image windows which were statically linked against the IVE 3.3 libraries will need to be recompiled. Besides the changes in the IM library (see the Release Notes section of the IM library documentation for details), other changes which break backward compatibility with IVE 3.3 are:

The following changes made between IVE 4.1 and IVE 4.2 break backward compatibility for some applications:

Additions to the library in IVE 4 are:

Changes made in IVE 3.3 were:


Initialization and Shutdown

Of the following functions, IWAttach may be of use to many applications in order to explicitly initialize communications with the image windows. The remaining functions are only useful to applications that need to create or destroy the infrastructure for the image windows.


Window Attributes

The following set of calls modify or return the current settings for the various attributes of an image window.

Alter Settings

Return Settings


Image Display

These calls effect the display of images in the window.

Alter Settings

Return Settings


Image Info

The image file header contains all sorts of information about the data. Most of the window header parallels the image header and so data info is available thru the IM calls. These calls reference information applicable only to image windows and not files.

Alter Settings

Return Settings


Graphics

Add Graphics (IWGrAdd<object> 2D, 3D, 5D)

The following graphics calls let you put graphics into the monitor window. A list of the graphics is maintained so that you only need to tell the monitor once about the graphic and it will be displayed whenever the users returns to a section it is supposed to be displayed in. All of the IWGrAdd calls draw 2D objects only. For all of the IWGrAdd calls, there are four versions:

The version without a D at the end is the window coordinate version. This means that regardless of the zoom of your underlying image, your graphics will remain a fixed size and will be displayed no matter which section you change to. For window graphics, you will most likely need to scale your x and y range to fit in the windows range which is by default, 0 -512.

2D graphics also are drawn to all sections, but are in data coordinates, so when the image is zoomed up or down, the graphics will zoom along with it.

3D graphics are only drawn to the specified z section. If there are multiple waves or times in the image window, the graphic will be shown in this z section for all waves and times.

5D graphics let you specify a z, wave and time so that the graphic will only show up in one z, one wave and one time section. 2D and 3D graphics are actually a subset of 5D graphics in that if you enter a -1 in the z parameter, the graphic will be drawn in all z's, similarly if you enter -1 for wave, the graphic would be shown in the specified section in all waves, and the same for time.

Display Graphics

Once graphics are added, they need to be displayed. They will either be displayed the first time the image is redrawn or by using a call to draw the graphic on top of the image.

Remove Graphics

When the graphics are no longer needed, they need to be removed.

5D Model Graphics

Use these calls to control which window the 5D model graphics are drawn into. The model graphics do not use the above IWGr calls.

Overlay Graphics

Use when fast graphics are needed for things like rubberbanding or roaming graphic objects. Instead of redrawing the image and graphics, the graphic can just be drawn into the overlay buffer.

Alter Other Graphics Parameters

Return Other Graphics Parameters


Mouse, Keys and Events

Events are generally registered using WMMenu calls: WMAddEventHandler and WMAddDisplayChangeEvent.

Event Broadcast Control

Getting Information from Events

Old IW Calls For Registering Events


Shared Memory


Query


Utility Functions


Alphabetical List of Image Window Functions


Initialization and Shutdown


IWAttach

Explicitly initializes communications with image windows.

Synopsis (C)

int IWAttach(void);

Synopsis (Fortran)

integer function iwattach()

Description

IWAttach performs the necessary steps to enable an application to communicate with the image windows. IWAttach returns IW_SUCCESS (1) if it could establish the communication channel. IWAttach returns IW_ERROR (-1) if it could not establish the communication channel. One possible cause for a failure is that no application had previously called IWStart to create the infrastructure necessary to communicate with image windows.

Many applications do not need to call IWAttach because a successful attempt to open an image window with IMOpen or IWAttachWin implicitly enables the communication channel. As a corollary, any IW function that expects a stream number as an argument can be safely called: either the stream number has been attached to an image window or the stream is not attached to an image window and the function will simply return. Of the remaining IW functions, the following may be safely called whether or not the communication channel to the image windows has been enabled:


IWStart

Creates the components needed for communication with the image windows.

Synopsis (C)

int IWStart(int left, int bottom, int width, int height);

Synopsis (Fortran)

integer function iwstart(left, bottom, width, height)
integer left, bottom, width, height

Description

Allocates and initializes the resources necessary to create image windows and communicate with them. The four arguments, left, bottom, width, and height, are a relic: the only effect they have is on the behavior of IWRtScrnGeom. Traditionally, applications have passed zero for left and bottom, 1280 for width, and 1024 for height.

Calling IWStart while the user already has an image windows session will have disastrous consequences for both the old and new sessions unless the environment variable IVE_SHMDIR has been set differently in both sessions. A common practice (which unfortunately involves a race condition) is to call IWAttach to check if an image windows session has already been started, and if one has not been started, to then call IWStart.

Return Value

Returns IW_SUCCESS (1) if the components necessary for creating and communicating with image windows could be created; otherwise, returns IW_ERROR (-1).


IWStop

Destroys any open image windows and the infrastructure necessary to communicate with the image windows.

Synopsis (C)

int IWStop(void);

Synopsis (Fortran)

integer function iwstop()

Limitations

Does not currently destroy all the resources allocated by IWStart. As a workaround, applications have been using something like the C code shown below after calling IWStop:

#include<stdio.h>
#include<stdlib.h>
    char* login_name = getenv("LOGNAME");
    char filename[256];
    char command[300];

    if (login_name != 0) {
        (void) sprintf(
            command, "rm -rf \"%s\"/.ive_\"%s\"_*", filename, login_name
        );
    } else {
        (void) sprintf(command, "rm -rf \"%s\"/.ive_*", filename);
    }
    system(command);

Return Value

Always returns IW_SUCCESS (1).


Alter Window Information - "IWAl"


IWAlBufImg

Enables or disables image display buffering.

Synopsis (C)

int IWAlBufImg(int istream, int iflag);

Synopsis (Fortran)

integer function iwalbufimg(istream, iflag)
integer istream, iflag

Description

If iflag is zero, instructs the image window attached to istream to not buffer displayed images. If iflag is non-zero, instructs the image window attached to istream to buffer displayed images. Unless configured otherwise by the user, displayed images are buffered by default.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window, otherwise, returns IW_ERROR (-1).


IWAlClrBkg

Requests that the next redraw should clear the window background.

Synopsis (C)

int IWAlClrBkg(int istream, int iflag);

Synopsis (Fortran)

integer function iwalclrbkg(istream, iflag)
integer istream, iflag

Description

If iflag is not zero, requests that the next redraw for the image window attached to istream should clear the window's background as well. If iflag is zero, requests that the next redraw for the image window should not clear the window's background.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window, otherwise, returns IW_ERROR (-1).


IWAlColorMode

Changes whether an image window uses true color or pseudocolor to display images

Synopsis (C)

int IWAlColormode(int istream, int mode);

Synopsis (Fortran)

integer function iwalcolormode(istream, mode)
integer istream, mode

Description

If mode is IW_PSEUDO (1), causes the image window attached to istream to display images composed of one wavelength rendered in pseudocolor. If mode is IW_TRUE_COLOR (0), causes the image window attached to istream to display images which can be composed of one or to three wavelengths with each wavelength rendered in a different color.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and the workstation's graphics support the given mode; otherwise, returns IW_ERROR (-1).


IWAlColorNames

Changes the names of the graphics colors associated with all windows.

Synopsis (C)

int IWAlColorNames(char *colors[IW_NUM_COLORS]);

Synopsis (Fortran)

integer function iwalcolornames(colors)
character*(*) colors

Description

There are only IW_NUM_COLORS (12) graphic colors available at any one time, but they can be changed by modifying the RGB values with IWAlLut. Each of the colors has a name associated with it to make it easier for end users to select a color. Use IWAlColorNames to change the names associated with all the graphic colors. The new color names, colors, is an array of null-terminated strings in C; for Fortran, the new names are packed into a single character array with a '~' at the end of each name (i.e. "Black~Red~Green~...").

IWAlColorNames ignores any characters in a color name after the first IW_COLOR_NAME_LEN (12) characters.

Return Value

Returns IW_SUCCESS (1) if the color names were modified; returns IW_ERROR (-1) if the shared memory storage for the color names could not be located.


IWAlComplexDis

Changes the way complex-valued images are displayed.

Synopsis (C)

int IWAlComplexDis(int istream, int iflag);

Synopsis (Fortran)

integer function iwalcomplexdis(istream, iflag)
integer istream, iflag

Description

Changes how the image window attached to istream converts complex-valued data to render it as an image. iflag specifies the new conversion method and may be one of the following values:

IW_COMPLEX_AMPLITUDE (0x10000 hexadecimal)
Use the amplitude of the complex value when calculating displayed images.
IW_COMPLEX_REAL (0x20000 hexadecimal)
Use the real component of the complex value when calculating displayed images.
IW_COMPLEX_IMAGINARY (0x30000 hexadecimal)
Use the imaginary component of the complex value when calculating displayed images.
IW_COMPLEX_PHASE (0x40000 hexadecimal)
Use the phase, in radians, of the complex value when calculating displayed images.

Return Value

Returns IW_SUCCESS if istream is attached to an image window which currently contains complex-valued data; otherwise, returns IW_ERROR.


IWAlCursor

Changes the mouse pointer symbol used in an image window.

Synopsis (C)

int IWAlCursor(int istream, int shape);

Synopsis (Fortran)

integer function iwalcursor(istream, shape)
integer istream, shape

Description

If shape is one, makes the mouse pointer a small red bar for the image window attached to istream. Typically this is done to hide the normal cursor when an application draws a custom cursor using the image window graphics calls. If shape is not one, changes the mouse pointer to its normal crosshair shape for the image window attached to istream.

Return Value

If istream is attached to an image window, returns IW_SUCCESS (1); otherwise, returns IW_ERROR (-1).


IWAlDisDelay

Changes the interval between repetitions automatically generated for key and mouse button events.

Synopsis (C)

int IWAlDisDelay(int istream, int delay);

Synopsis (Fortran)

integer function iwaldisdelay(istream, delay)
integer istream, delay

Description

Pressing and holding a key in an image window will generate multiple key press events if the button is held down long enough. IWAlDisDelay sets the interval between sending each subsequent event to be delay microseconds. Unless configured otherwise by the user, the default value for the delay is 33000 microseconds.

Return Value

If istream is attached to an image window, IWAlDisDelay returns IW_SUCCESS (1); otherwise, returns IW_ERROR (-1).


IWAlDisImg

Enables or disables image display.

Synopsis (C)

int IWAlDisImg(int istream, int iflag);

Synopsis (Fortran)

integer function iwaldisimg(istream, iflag)
integer istream, iflag

Description

If iflag is zero, instructs the image window attached to istream to not display images (overlayed graphics are still drawn). If iflag is non-zero, instructs the image window to display images. Unless configured otherwise by the user, images are displayed by default.

Return Value

If istream is attached to an image window, returns IW_SUCCESS (1); otherwise returns IW_ERROR (-1).


IWAlDisOffset

Sets the horizontal and vertical offsets applied when displaying a given wave.

Synopsis (C)

int IWAlDisOffset(int istream, int iwave, const int ipixel[2]);

Synopsis (Fortran)

integer function iwaldisoffset(istream, iwave, ipixel)
integer istream, iwave, ipixel(2)

Description

The positioning of images within an image window's image display area depends on four parameters: the image window's size, the size of the data's x and y dimensions, the number of rows and columns of images displayed simultaneously, and wave-dependent horizontal and vertical offsets in x and y. For the wave with index iwave in the window attached to istream, IWAlDisOffset sets the current values for that wave's horizontal and vertical offsets. IWAlDisOffset gets the horizontal offset from the first element of ipixel and gets the vertical offset from the second element of ipixel; both values are assumed to be in units of data pixels. Valid values of the wave index, iwave, range from zero to the number of waves in the window minus one.

Return Value

Returns IW_SUCCESS (1) if istream is attached to a window and that window has the specified wave, iwave; otherwise, returns IW_ERROR (-1).


IWAlDisSec_ZWT

Changes the currently displayed section (specified by its z, wave, and time indices).

Synopsis (C)

int IWAlDisSec_ZWT(int istream, int iz, int iw, int it);

Synopsis (Fortran)

integer function iwaldissec_zwt(istream, iz, iw, it)
integer istream, iz, iw, it

Description

Changes the currently displayed Z section (iz), wavelength (iw), and time-point (it). If the current sections in different waves are synchronized (see IWRtDisSyncMode and IWAlDisSyncMode), then the current section in other wavelengths will also be changed (enforcement of synchronization was added in the IVE 3.3 August 2000 release).

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and iz, iw, and it are valid z, wave, and time, respectively, indices for that image window. Otherwise, returns IW_ERROR (-1).


IWAlDisSec

Changes the currently displayed section (specified by its index in the list of sections).

Synopsis (C)

int IWAlDisSec(int istream, int isec);

Synopsis (Fortran)

integer function iwaldissec(istream, isec)
integer istream, isec

Description

Sets isec to be the current section displayed in the window attached to istream. If the current sections in different waves are synchronized (see IWRtDisSyncMode and IWAlDisSyncMode), then the current section in other wavelengths will also be changed (enforcement of synchronization was added in the IVE 3.3 August 2000 release). If the image window displays multiple images in a matrix, the current section is the section show in the first image in the matrix.

It is usually more convenient to use IWAlDisSec_ZWT.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and isec is a valid section index for that image window; otherwise, returns IW_ERROR (-1).


IWAlDisSyncMode

Enables or disables synchronized display of data with multiple waves.

Synopsis (C)

int IWAlDisSyncmode(int istream, int mode);

Synopsis (Fortran)

integer function iwaldissyncmode(istream, mode)
integer istream, mode

Description

An image window maintains the concept of a current section for each wave and can enforce a relationship between the current sections in different waves. For the image window attached to istream, IWAlDisSyncMode changes the relationship enforced between the current sections in different waves. The new policy is set by mode which may be one of the following:

IW_APPLY_SYNC (0)
The image window forces the current sections in different waves to have the same z and time indices.
IW_APPLY_NONE (1)
The image window does not enforce a relationship between the current sections in different waves.
IW_APPLY_ALL (2)
If one current section is changed, the image window applies the same relative change to the current sections in all other waves; the image window then coerces the modified indices for the current sections so that they fall within the bounds of the data set.

Unless configured otherwise by the user, the default behavior for image windows is IW_APPLY_SYNC.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWAlDisWinBdr

Changes the decorations added to an image display window.

Synopsis (C)

int IWAlDisWinBdr(int istream, int borderSettings);

Synopsis (Fortran)

integer function iwaldiswinbdr(istream, borderSettings)
integer istream, borderSettings

Description

The parameter borderSettings sets what type of decorations are present. Valid values are:

IW_MON_FULL_BRDR (0)
window title and resize border shown
IW_MON_RESIZE_BRDR (1)
window resize border shown
IW_MON_NO_BRDR (2)
no decorations added to window

Return Value

If istream is attached to an image window and borderSettings is one of the allowed values shown above, returns IW_SUCCESS (1); otherwise returns IW_ERROR (-1).


IWAlDisWinTool

Changes which menus and tool bars are shown with an image window.

Synopsis (C)

int IWAlDisWinTool(int istream, int toolSettings);

Synopsis (Fortran)

integer function iwaldiswintool(istream, toolSettings)
integer istream, toolSettings

Description

The argument toolSettings sets what type of menus and tool bars are present for the display window attached to istream. Valid values for toolSettings are a bitwise or (or simple sum in FORTRAN) of one or more of the following:

IW_MON_NO_MENU_TOOLS (0)
no menu or tool bars are shown
IW_MON_SHOW_MENU (1)
menu bar along the top of the image window is shown
IW_MON_SHOW_LEFTTOOLS (2)
buttons and slider along left side of image window are shown
IW_MON_ALL_MENU_TOOLS (3)
all menu and tool bars are shown

Return Value

If istream is attached to an image window and toolSettings is one of the values shown above, returns IW_SUCCESS (1); otherwise, returns IW_ERROR (-1).


IWAlFileFormat

Changes the byte ordering and floating-point representation assumed for an image file.

Synopsis (C)

int IWAlFileFormat(int istream, int iflag);

Synopsis (Fortran)

integer function iwalfileformat(istream, iflag)
integer istream, iflag

Description

Two different formats for image data files are supported: one in which multi-byte quantities are written in big-endian format and one in which they are written in little-endian format. Both formats use IEEE floating point representation. By default, the library automatically detects the format of the file when reading it and will apply any necessary byte swapping. When writing files, the default is to always write them in the big-endian format. If you wish to override these defaults, use IWAlFileFormat to alter how subsequent reads and writes will be performed. Setting iflag to a non-zero value will force the file to be interpreted in the small-endian format; setting it to zero forces the use of the big-endian format.

Prior to the June 1999 release of Priism, the two formats supported were a big-endian one which used the IEEE representation for floating-point values and a little-endian one which used a VAX representation for floating-point values. Library support for the VAX format was dropped in the June 1999 release and replaced with the little-endian format with IEEE floating-point values.

Return Value

If istrream is attached to an image window, IWAlFileFormat returns IW_SUCCESS (1); otherwise, returns IW_ERROR.


IWAlFilename

Changes the name of the file associated with a wave in an image window.

Synopsis (C)

int IWAlFilename(int istream, int iwave, const char *filename);

Synopsis (Fortran)

integer function iwalfilename(istream, iwave, filename)
integer istream, iwave
character filename(*)

Description

Changes the name of the file associated with wave, iwave, in the image window referenced by istream to be filename. Let n be the value returned by IWRtFilenameLength, if filename (including the terminating null character) is longer than n characters, only the last n characters are stored for later retrieval by IWRtFilename.

Return Value

Returns IW_SUCCESS if istream is attached to an image window and iwave is a valid wave index for that window; otherwise, returns IW_ERROR.


IWAlGrColors

Changes the graphic colors associated with each wavelength.

Synopsis (C)

int IWAlGrColors(int istream, const int icolor[IW_MAX_WAVE]);

Synopsis (Fortran)

integer function iwalgrcolors(istream, icolor)
integer istream, icolor(5)

Description

Sets the graphic color for the ith wave to the ith element of icolor where i ranges from zero to IW_MAX_WAVE - 1.

Return Value

Returns IW_ERROR (-1) if istream is not valid or any of elements of icolor are not in the range from 0 to IW_NUM_COLORS - 1; otherwise, returns IW_SUCCESS (1).


IWAlGrDis

Enables or disables display of graphics on an image window.

Synopsis (C)

int IWAlGrDis(int istream, int iflag);

Synopsis (Fortran)

integer function iwalgrdis(istream, iflag)
integer istream, iflag

Description

If iflag is not zero, enables display of graphics in the image window attached to istream. If iflag is zero, disables display of graphics in the image window attached to istream.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWAlGrDisRange

Allows the graphics from more than one section to be drawn when a single image is drawn.

Synopsis (C)

int IWAlGrDisRange(int istream, const int range[4]);

Synopsis (Fortran)

integer function iwalgrdisrange(istream, range)
integer istream, range(4)

Description

Sets the range for drawing graphics in istream. range has four elements:

range[0]
number of z sections before current section
range[1]
number of z sections after current section
range[2]
number of time sections before current section
range[3]
number of time sections after current section

Return Value

If istream is attached to an image window, returns IW_SUCCESS (1); otherwise, returns IW_ERROR (-1).


IWAlImgColor

Sets the image display colors for each channel ("wavelength") in the image window.

Synopsis (C)

int IWAlImgColor(int istream, const int icolor[IW_MAX_WAVE]);

Synopsis (Fortran)

integer function iwalimgcolor(istream, icolor)
integer istream, icolor(5)

Description

The image display color for each wavelength is given in icolor. Valid values of icolor are: IW_RED (1), IW_GREEN (2), IW_BLUE (4), IW_WHITE (7), IW_BLACK (0), IW_YELLOW (3), IW_PINK (5), or IW_CYAN (6).

Return Value

If istream is attached to an image window and icolor is one of the valid options listed above, IWAlImgColor returns IW_SUCCESS; otherwise, returns IW_ERROR.


IWAlInterp

Enables or disables interpolation of zoomed up images.

Synopsis (C)

int IWAlInterp(int istream, int iflag);

Synopsis (Fortran)

integer function iwalinterp(istream, iflag)
integer istream, iflag

Description

Sets how the image window attached to istream displays images when the zoom factor is greater than one. If iflag is 0, the zoomed images will not be interpolated; if iflag is not 0, the zoomed images will be interpolated. Unless configured otherwise by the user, the default is not to interpolate images when the zoom factor is greater than one.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWAlLut

Changes the RGB lookup tables (LUTs) used by all image windows.

Synopsis (C)

void IWAlLut(const int ired[], const int igreen[], const int iblue[]);

Synopsis (Fortran)

subroutine iwallut(ired, igreen, iblue)
integer ired(*), igreen(*), iblue(*)

Description

Copies ired to the red component of the image windows' color table, igreen to the green component of the image windows' color table and iblue to the blue component of the image windows' color table. ired, igreen, and iblue must have at least imin + IWRtLutSize() + IW_NUM_COLORS elements where imin is the position of the first color used for pseudocolor image display. Use IWRtSclMinMax to determine the value of imin.


IWAlMulDis

Changes the number of horizontally and vertically displayed images within a single window.

Synopsis (C)

int IWAlMulDis(int istream, int imdx, int imdy);

Synopsis (Fortran)

integer function iwalmuldis(istream, imdx, imdy)
integer istream, imdx, imdy

Description

Changes the number of horizontally (imdx) and vertically (imdy) displayed images.

By default, imdx and imdy are one.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and imdx and imdy are both positive; otherwise, returns IW_ERROR (-1).


IWAlNoCopy

Sets whether data is copied when written to an image window.

Synopsis (C)

int IWAlNoCopy(int istream, int iflag);

Synopsis (Fortran)

integer function iwalnocopy(istream, iflag)
integer istream, iflag

Description

Functions that write entire images to image windows will either copy the data that is passed to them or assume control (including responsibility of deallocation) of the block of memory passed to them avoiding the overhead of a copy. The former is the default; the latter requires that the image be allocated in shared memory with IWAlcSHM.

Call IWAlNoCopy with iflag set to a non-zero value to bypass copying when writing images to istream. Call IWAlNoCopy with iflag set to zero to cause a copy to be performed when a write is done.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWAlOffsetGroup

Synopsis (C)

int IWAlOffsetGroup(int istream, const int flags[]);

Synopsis (Fortran)

integer function iwaloffsetgroup(istream, flags)
integer istream
integer flags(*)


IWAlOVColors

Changes the colors used for drawing in the overlay planes.

Synopsis (C)

int IWAlOVColors(const int red[], const int green[], const int blue[]);

Synopsis (Fortran)

integer function iwalovcolors(red, green, blue)
integer red(*), green(*), blue(*)

Description

Copies ired to the red component of the overlay color table, igreen to the green component of the overlay color table, and iblue to the blue component of the overlay color table. ired, igreen, and iblue must have at least IWRtNumOVColors() elements.

Return Value

Always returns IW_SUCCESS (1).


IWAlPointerPos

Shifts the position of the mouse pointer to a specified location in an image window.

Synopsis (C)

int IWAlPointerPos(int istream, const int winpos[2]);

Synopsis (Fortran)

integer function iwalpointerpos(istream, winpos)
integer istream, winpos(2)

Description

Moves the mouse pointer to the location winpos[0] screen pixels to the right and winpos[1] screen pixels up from the lower left hand corner of the image display area in the image window attached to istream.

Return Value

Returns IW_SUCCESS if successful.

Returns IW_SUCCESS (1) if istream is attached to an image window and the coordinates in winpos fall within the bounds of that image window's image display area; otherwise, returns IW_ERROR (-1).


IWAlPsdGrColor

Changes the color map number of graphics displayed when the window is in pseudocolor mode.

Synopsis (C)

int IWAlPsdGrColor(int istream, int icolor);

Synopsis (Fortran)

integer function iwalpsdgrcolor(istream, icolor)
integer istream, icolor

Description

Valid values of icolor are between 0 and (IW_NUM_COLORS-1). By default, graphics will be displayed with a color map number of IW_RED.

Return Value

Returns IW_SUCCESS if istream is attached to an image window and icolor is valid; otherwise, returns IW_ERROR.


IWAlScl

Changes the intensity scaling values for a particular wavelength.

Synopsis (C)

int IWAlScl(int istream, int iwave, const float scale[4]);

Synopsis (Fortran)

integer function iwalscl(istream, iwave, scale)
integer istream, iwave
real scale(4)

Description

IWRtScl sets wave scaling parameters for the wave iwave (valid values of iwave range from zero to the number of wavelengths in the image window minus one) in the image window attached to istream. The scaling parameters are read from scale as follows:

first element
Is the minimum displayed intensity. Intensities below this value are displayed the same as the minimum intensity.
second element
Is the maximum displayed intensity.
third element
Is the exponent (i.e. gamma) of the scaling function. A linear scaling, which has an exponent of one, is a common case. A scaling relationship which varies as the square root of the intensity would have an exponent of 0.5; a scaling relationship which varies as the square of the intensity would have an exponent of two.
fourth element
Controls the display of intensities larger than the maximum displayed intensity. If this element is not one, intensities larger than the maximum intensity are displayed the same as the maximum intensity; otherwise, intensities larger than the maximum intensity are displayed the same as the minimum intensity.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and iwave is greater than or equal to zero and less than IW_MAX_WAVE (5); otherwise, returns IW_ERROR (-1).


IWAlSclBar

Enables or disables display of the distance scale bar.

Synopsis (C)

int IWAlSclBar(int istream, int iflag);

Synopsis (Fortran)

integer function iwalsclbar(istream, iflag)
integer istream, iflag

Description

Calling IWAlSclBar with iflag equal to zero turns off display of the scale bar in the window attached to istream. Calling IWAlSclBar with iflag equal to one or two turns on display of the scale bar; if iflag is two, the image window will also show a label indicating the length of the scale bar.

Return Value

Returns IW_ERROR (-1) if istream is not valid; otherwise, returns IW_SUCCESS (1).


IWAlScratchSize

Sets the maximum number of sections in a scratch window.

Synopsis (C)

int IWAlScratchSize(int istream, int size);

Synopsis (Fortran)

integer function iwalscratchsize(istream, size)
integer istream, size

Description

For the scratch window attached to istream, sets the maximum number of z sections that can be held to size

Return Value

Returns IW_SUCCESS if successful.

Returns IW_ERROR if an error occurs; this can happen if istream is not valid or is not attached to a scratch window.


IWAlSclBarAttr

Changes the properties of the distance scale bar.

Synopsis (C)

int IWAlSclBarAttr(int istream, int icolor, int direction, float length, int thickness, int position[2]);

Synopsis (Fortran)

integer function iwalsclbarattr(istream, icolor, direction, length, thickness, position)
integer istream
integer icolor, direction, thickness, position(2)
real length

Description

Changes the properties of the scale bar in the image window attached to istream. icolor sets the graphics color index used to display the scale bar. direction sets the orientation of the scale bar: if direction is one, the scale bar is vertical; if direction is zero, the scale bar is horizontal. length sets the length of the scale bar. The units of the length are the same as are used to express the pixel spacing for the data displayed in the image window: the usual convention uses microns, position sets the x and y coordinates of the lower left corner of the scale bar; the coordinates are measured in units of screen pixels and are relative to the lower left corner of the image display area. ithick sets the thickness, in screen pixels, of the scale bar.

Return Value

Returns IW_ERROR if istream is not attached to an image window; otherwise, returns IW_SUCCESS.


IWAlSclAlgorithm

Changes the algorithm used to scale images for display.

Synopsis (C)

int IWAlSclAlgorithm(int istream, int iflag);

Synopsis (Fortran)

integer function iwalsclalgorithm(istream, iflag)
integer istream, iflag

Description

Changes the scaling algorithm used by the image window attached to istream. iflag is a code for the new algorithm and may be one of the following:

IW_SCALING_DONTCARE (0)
Uses a lookup table to speed up calculations, but accuracy suffers for floating point and complex data as the exponent gets increasingly far from one.
IW_SCALING_EXACT (0x1000000 hexadecimal)
For floating point or complex data, uses a direct scaling operation that is accurate within the limits of single precision arithmetic. For other data types, the algorithm is the same as is used with IW_SCALING_DONTCARE.

For a fuller description of these algorithms, see IWScaleImage. This call was added in the October 1998 release of IVE 3.3.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and iflag is one of the allowed values listed above; otherwise, returns IW_ERROR (-1).


IWAlSecMMM

Changes the minimum, maximum, and mean values stored for a section.

Synopsis (C)

int IWAlSecMMM(int istream, int isec, float minimum, float maximum, float mean);

Synopsis (Fortran)

integer function iwalsecmmm(istream, isec, minimum, maximum, mean)
integer istream, isec
real minimum, maximum, mean

Description

Image windows are capable of storing a minimum, maximum, and mean value to be associated with a particular section. For the image window attached to istream, IWAlSecMMM changes the minimum associated with the section, isec, to be minimum, the maximum associated with that section to be maximum, and the mean associated with that section to be mean. Valid values of isec range from 0 to the number of sections in the image window minus one.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and isec is a valid section index for that window; otherwise, returns IW_ERROR (-1).


IWAlSecScl

Changes the intensity scaling values of a particular section.

Synopsis (C)

int IWAlSecScl(int istream, int isec, const float scale[4]);

Synopsis (Fortran)

integer function iwalsecscl(istream, isec, scale)
integer istream, isec
real scale(4)

Description

Same as IWAlScl except that scale is applied to the section, isec, rather than an entire wave.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and isec is a valid section index for that image window; otherwise, returns IW_ERROR (-1).


IWAlSecThreshold

Changes the recommended threshold level for a particular section.

Synopsis (C)

int IWAlSecThreshold(int istream, int isec, float threshold);

Synopsis (Fortran)

integer function iwalsecthreshold(istream, isec, threshold)
integer istream, isec
real threshold

Description

Sets the recommended intensity threshold for the section index, isec, to be threshold. Use IWRtSecThreshold to retrieve the threshold setting and IWClrSecThreshold to clear it. To set the recommended threshold for an entire wave, use IWAlThreshold.

IWAlSecThreshold was added to the IW library in February 2002.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and isec is valid for that window; otherwise, returns IW_ERROR (-1).


IWAlStepAttr

Changes the direction and increment used when stepping through sections in an image window.

Synopsis (C)

int IWAlStepAttr(int istream, int attributes[2]);

Synopsis (Fortran)

integer function iwalstepattr(istream, attributes)
integer istream, attributes(2)

Description

The behavior of IWNextImage, IWPrevImage, IWLastImage, and IWFirstImage depends upon the current step direction. IWAlStepAttr sets the step direction and step size for the image window attached to istream. The value of the first element of iattr controls the step direction; it may be one of the following:

0
Step through the sections as a linear sequence defined by the interleaving format and the dimensions in z, time, and wave.
1
The step direction is along the z dimension.
2
The step direction is along the time dimension.
3
The step direction is along the wave dimension.

The second element of iattr is the step size. Unless configured otherwise by the user, the default is to step one section at a time along the z dimension.

Return Value

Returns IW_SUCCESS (1) if istream is attached to a window and the second element of iattr is one of the allowed values; otherwise, returns IW_ERROR (-1).


IWAlSWFile

Sets the swap file name used by the memory manager.

Synopsis (C)

int IWAlSWFile(int istream, char *file);

Synopsis (Fortran)

integer function iwalswfile(istream, file)
integer istream
character file(*)

Description

If necessary, the IW library memory manager will swap out image data from an image window to a file specific to that image window. By default, the file will be a temporary one created as necessary and deleted when the user closes the image window. Use IWAlSWFile to change the name of the swap file for the image window attached to istream. For well-defined behavior, IWAlSWFile should be called before any image data is written to the image window.

Return value

If istream is attached to an image window and the length of file is within the limits the library can handle, IWAlSWFile returns IW_SUCCESS (1); otherwise, returns IW_ERROR (-1).


IWAlThreshold

Changes the recommended threshold level for a particular wave.

Synopsis (C)

int IWAlThreshold(int istream, int wave, float threshold);

Synopsis (Fortran)

integer function iwalthreshold(istream, wave, threshold)
integer istream, wave
real threshold

Description

Sets the recommended intensity threshold for the wave index, wave, to be threshold. Use IWRtThreshold to retrieve the threshold setting and IWClrThreshold to clear it. To set the recommended threshold for a single section, use IWAlSecThreshold.

IWAlThreshold was added to the IW library in February 2002.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and wave is a valid wave index for that image window; otherwise, returns IW_ERROR (-1).


IWAlWaveMap

Shows or hides a single wavelength in a window.

Synopsis (C)

int IWAlWaveMap(int istream, int iwave, int iflag);

Synopsis (Fortran)

integer function iwalwavemap(istream, iwave, iflag)
integer istream, iwave, iflag

Description

If iflag is not zero, hides the wave with index iwave in the image window attached to istream and then forces the image window to redraw. If istream is not attached to a window or iwave is not already mapped, IWAlWaveMap returns IW_ERROR (-1); otherwise, returns IW_SUCCESS (1).

If iflag is zero, shows the wave with index iwave in the image window attached to istream and then forces the image window to redraw. If istream is not attached to a window, iwave is not a valid wave for the window, or the display color for the wave is IW_BLACK, IWAlWaveMap returns IW_ERROR (-1); otherwise, returns IW_SUCCESS (1).


IWAlWinPos

Changes the screen location and size of a window.

Synopsis (C)

int IWAlWinPos(int istream, int xstart, int ystart, int width, int height);

Synopsis (Fortran)

integer function iwalwinpos(istream, xstart, ystart, width, height)
integer istream
integer xstart, ystart, width, height

Description

Moves the image window attached to istream so that its lower left corner is xstart pixel to the right and ystart pixels above the lower left corner of the screen and changes the image window to be be width screen pixels wide and height screen pixels high.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and width and height are non-negative; otherwise, returns IW_ERROR (-1).


IWAlZoom

Changes zoom factor for a window.

Synopsis (C)

int IWAlZoom(int istream, float zoom);

Synopsis (Fortran)

integer function iwalzoom(istream, zoom)
integer istream
real zoom

Description

Sets the zoom factor to be zoom for the window attached to istream.

Return Value

Returns IW_SUCCESS if successful.

Returns IW_ERROR if istream is not attached to a window or zoom is less than 0.03125 or greater than 32.


IWAlZWTMMM

Changes the minimum, maximum, and mean values stored for a section specified by its z, wave, and time indices.

Synopsis (C)

int IWAlZWTMMM(int istream, int iz, int iw, int it, float dmin, float dmax, float dmean);

Synopsis (Fortran)

integer function iwalzwtmmm(istream, iz, iw, it, dmin, dmax, dmean)
integer istream, iz, iw, it
real dmin, dmax, dmean

Description

Is the same as IWAlSecMMM, but the section is specified by its z index, iz, wave index, iw, and time index, it rather than the section's position in the stack.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and iz, iw, and it are valid indices for that window; otherwise, returns IW_ERROR (-1).


IWClrSecThreshold

Clears the recommended threshold level for a particular section.

Synopsis (C)

int IWClrSecThreshold(int istream, int isec);

Synopsis (Fortran)

integer function iwclrsecthreshold(istream, isec)
integer istream, isec

Description

Clears the recommended threshold level, if any, for the section, sec. Until IWAlSecThreshold is called for the section, IWRtSecThreshold will return IW_ERROR.

IWClrSecThreshold was added to the IW library in February 2002.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and isec is a valid section index for that window; otherwise, returns IW_ERROR (-1).


IWClrThreshold

Clears the recommended threshold level for a particular wave.

Synopsis (C)

int IWClrThreshold(int istream, int wave);

Synopsis (Fortran)

integer function iwclrthreshold(istream, wave)
integer istream, wave

Description

Clears the recommended threshold level, if any, for the wave index, wave. Until IWAlThreshold is called for the wave, IWRtThreshold will return IW_ERROR.

IWClrThreshold was added to the IW library in February 2002.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and wave is a valid wave index for that window; otherwise, returns IW_ERROR (-1).


Window Graphics - "IWGr"


IWGrAddBox, IWGrAddBox2D, IWGrAddBox3D, IWGrAddBox5D

Synopsis (C)

int IWGrAddBox(int istream, float x, float y, float width, float height, int ith, int ipat, int icolor);
int IWGrAddBox2D(int istream, float x, float y, float width, float height, int ith, int ipat, int icolor);
int IWGrAddBox3D(int istream, float x, float y, float z, float width, float height, int ith, int ipat, int icolor);
int IWGrAddBox5D(int istream, float x, float y, float z, int wave, int time, float width, float height, int ith, int ipat, int icolor);

Synopsis (Fortran)

integer function iwgraddbox(istream, x, y, width, height, ith, ipat, icolor)
integer function iwgraddbox2d(istream, x, y, width, height, ith, ipat, icolor)
integer function iwgraddbox3d(istream, x, y, z, width, height, ith, ipat, icolor)
integer function iwgraddbox5d(istream, x, y, z, wave, time, width, height, ith, ipat, icolor)
integer istream, ith, ipat, icolor, wave, time
real x, y, z, width, height

Description

In the image window attached to istream, draws a rectangle parallel to the xy plane. x and y are the coordinates of the bottom left corner of the rectangle, width is the x (horizontal) dimension of the rectangle, and height is the y (vertical) dimension of the rectangle. IWGrAddBox assumes that the location and dimensions are in window coordinates; IWGrAddBox2D, IWGrAddBox3D, and IWGrAddBox5D assume the location and dimensions are in data coordinates. A rectangle added by IWGrAddBox or IWGrAddBox2D is not associated with a particular section and will appear in all sections. A rectangle added by IWGrAddBox3D is associated with a particular z coordinate (z) but will appear across all waves and time points. A rectangle added by IWGrAddBox5D has a z coordinate (z), wave index (wave), and time index (time) associated with it. You can use -1 for z, wave, or time if you do not want a particular coordinate assigned to the rectangle for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, the rectangle appears across all sections in that dimension.

icolor sets the color index for the color of the added rectangle. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero. ith sets the thickness, in screen pixels, of the lines used to draw the rectangles boundaries. ipat is currently ignored; for compatibility with future versions where ipat will set the style of line used, always set ipat to one.

Limitations

The current implementation of IWGrAddBox5D will draw the graphics in all sections if z, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window.


IWGrAddCir, IWGrAddCir2D, IWGrAddCir3D, IWGrAddCir5D

Synopsis (C)

int IWGrAddCir(int istream, float cx, float cy, float rad, int ith, int icolor);
int IWGrAddCir2D(int istream, float cx, float cy, float rad, int ith, int icolor);
int IWGrAddCir3D(int istream, float cx, float cy, float cz, float rad, int ith, int icolor);
int IWGrAddCir5D(int istream, float cx, float cy, float cz, int wave, int time, float rad, int ith, int icolor);

Synopsis (Fortran)

integer function iwgraddcir(istream, cx, cy, rad,ith, icolor)
integer function iwgraddcir2d(istream, cx, cy, rad, ith, icolor)
integer function iwgraddcir3d(istream, cx, cy, cz, rad, ith, icolor)
integer function iwgraddcir5d(istream, cx, cy, cz, wave, time, rad, ith, icolor)
integer istream, ith, icolor, wave, time
real cx, cy, cz, rad

Description

In the image window attached to istream, draws a circle parallel to the xy plane. cx, cy, and cz are the coordinates for the center of the circle, and rad is the radius. IWGrAddCir assumes that the center coordinates and radius are in window coordinates; IWGrAddCir2D, IWGrAddCir3D, and IWGrAddCir5D assume the center coordinates and radius are in data coordinates. A circle added by IWGrAddCir or IWGrAddCir2D is not associated with a particular section and will appear in all sections. A circle added by IWGrAddCir3D is associated with a particular z coordinate (cz) but will appear across all waves and time points. A circle added by IWGrAddCir5D has a z coordinate (cz), wave index (wave), and time index (time) associated with it. You can use -1 for cz, wave, or time if you do not want a particular coordinate assigned to the circle's center for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, the circle appears across all sections in that dimension.

icolor sets the color index for the color of the added circle. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero. ith sets the thickness of the circle's boundary. if ith is one, the boundary is one screen pixel thick; if ith is not one, the thickness is in the same units as the radius (screen pixels for IWGrAddCir and data pixels for IWGrAddCir2D, IWGrAddCir3D, and IWGrAddCir5D).

Limitations

The current implementation of IWGrAddCir5D will draw the graphics in all sections if cz, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window.


IWGrAddLn, IWGrAddLn2D,IWGrAddLn3D, IWGrAddLn5D

Synopsis (C)

int IWGrAddLn(int istream, float x1, float y1, float x2, float y2, int ith, int ipat, int icolor);
int IWGrAddLn2D(int istream, float x1, float y1, float x2, float y2, int ith, int ipat, int icolor);
int IWGrAddLn3D(int istream, float x1, float y1, float z1, float x2, float y2, float z2, int ith, int ipat, int icolor);
int IWGrAddLn5D(int istream, float x1, float y1, float z1, float x2, float y2, float z2, int wave, int time, int ith, int ipat, int icolor);

Synopsis (Fortran)

integer function iwgraddln(istream, x1, y1, x2, y2, ith, ipat, icolor)
integer function iwgraddln2d(istream, x1, y1, x2, y2, ith, ipat, icolor)
integer function iwgraddln3d(istream, x1, y1, z1, x2, y2, z2, ith, ipat, icolor)
integer function iwgraddln5d(istream, x1, y1, z1, x2, y2, z2, wave, time, ith, ipat, icolor)
integer istream, wave, time, ith, ipat, icolor
real x1, y1, z1, x2, y2, z2

Description

In the image window attached to istream, draws a single line segment between two specified points. x1, y1, and z1 are the coordinates for the first endpoint, and x2, y2, and z2 are the coordinates for the second endpoint. IWGrAddLn assumes that the endpoints' coordinates are in window coordinates; IWGrAddLn2D, IWGrAddLn3D, and IWGrAddLn5D assume the endpoints' coordinates are in data coordinates. A line segment added by IWGrAddLn or IWGrAddLn2D is not associated with a particular section and will appear in all sections. A line segment added by IWGrAddLn3D is not associated with any wave or time point and appears across all waves and time points. You can use -1 for z1 and z2, wave, or time if you do not want a particular coordinate assigned to the point for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, the point appears across all sections in that dimension.

ith sets the thickness of the line segment in screen pixels. ipat is currently ignored; for compatibility with future versions where ipat will set the style of line used, always set ipat to one. icolor sets the color index for the color of the added line segment. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero.

Limitations

Image windows assume that z1 and z2 are the same, so calls to IWGrAddLn3D or IWGrAddLn5D which use different values for z1 and z2 will not be handled as expected.

The current implementation of IWGrAddLn5D will draw the graphics in all sections if z1, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window or storage for the coordinates could not be allocated.


IWGrAddLns, IWGrAddLns2D, IWGrAddLns3D, IWGrAddLns5D

Synopsis (C)

int IWGrAddLns(int istream, const IW_POINT_2D_PTR plist, int np, int ith, int ipat,int icolor);
int IWGrAddLns2D(int istream, const IW_POINT_2D_PTR plist, int np,int ith, int ipat, int icolor);
int IWGrAddLns3D(int istream, const IW_POINT_PTR plist, int np, int ith, int ipat, int icolor);
int IWGrAddLns5D(int istream, const IW_POINT_PTR plist, int np, int iwave, int itime, int ith, int ipat, int icolor);

Synopsis (Fortran)

integer function iwgraddlns(istream, plist2d, np, ith, ipat, icolor)
integer function iwgraddlns2d(istream, plist2d, np, ith, ipat, icolor)
integer function iwgraddlns3d(istream, plist3d, np, ith, ipat, icolor)
integer function iwgraddlns5d(istream, plist3d, np, wave, time, ith, ipat, icolor)
integer istream, np, ith, ipat, icolor, wave, time
real plist2d(2 * np), plist3d(3 * np)

Description

In the image window attached to istream, draws np-1 connected line segments from np points: the first line segment joins the first two points, the second line segment joins the second and third points, and so on. For IWGrAddLns and IWGrAddLns2D only the x and y coordinates are specified: the points are not associated with any section and will appear in all sections. For C, the 2D coordinates are described by a IW_POINT_2D structure which has two fields: x for the x coordinate and y for the y coordinate. The list of points, plist, for IWGrAddLns and IWGrAddLns2D is then an array of IW_POINT_2D structures. For Fortran, the coordinates are passed in plist2d, a 1D array with 2 * np elements; the x coordinate of the ith point is the 2*i-1 element of plist2d and the y coordinate of the ith point is the 2*i element of plist. For IWGrAddLns3D and IWGrAddLns5D, the x, y, and z coordinates are specified. For C, the 3D coordinates are described by a IW_POINT structure which has three fields: x for the x coordinate, y for the y coordinate, and z for the z coordinate. The list of points, plist, for IWGrAddLns3D and IWGrAddLns5D is then an array of IW_POINT structures. For Fortran, the coordinates are passed in plist3d, a 1D array with 3 * np elements; for the ith point, the x coordinate of the is the 3*i-2 element of plist3d, the y coordinate is the 3*i-1 element of plist3d, and the z coordinate is the 3*i element of plist3d.

IWGrAddLns assumes that the point coordinates are in window coordinates; IWGrAddLns2D, IWGrAddLns3D, and IWGrAddLns5D assume that the point coordinates are in data coordinates. The line segments added by IWGrAddLns3D will appear across all waves and time points. The segments added by IWGrAddLns5D are associated with a particular wave, whose index is wave, and time point, whose index is time. You can use -1 for the z coordinate, wave, or time if you do not want a particular coordinate assigned for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, the line segments appear across all sections in that dimension.

ith sets the thickness of the line segment in screen pixels. ipat is currently ignored; for compatibility with future versions where ipat will set the style of line used, always set ipat to one. icolor sets the color index for the color of the added line segment. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero.

Limitations

Image windows assume that all the points have the same z coordinate so calls to IWGrAddLns3D or IWGrAddLns5D which have points with different z values will not be handled as expected.

The current implementation of IWGrAddLns5D will draw the graphics in all sections if the z coordinate for the first point, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window or the attempt to allocated space for the coordinates failed.


IWGrAddMultLns, IWGrAddMultLns2D, IWGrAddMultLns3D, IWGrAddMultLns5D

Synopsis (C)

int IWGrAddMultLns(int istream, const IW_POINT_2D_PTR plist, int np, int ith,int ipat, int icolor);
int IWGrAddMultLns2D(int istream, const IW_POINT_2D_PTR plist, int np, int ith, int ipat, int icolor);
int IWGrAddMultLns3D(int istream, const IW_POINT_PTR plist, int np, int ith, int ipat, int icolor);
int IWGrAddMultLns5D(int istream, const IW_POINT_PTR plist, int np, int iwave, int itime, int ith, int ipat, int icolor);

Synopsis (Fortran)

integer function iwgraddmultlns(istream, plist2d, np, ith, ipat, icolor)
integer function iwgraddmultlns2d(istream, plist2d, np, ith, ipat, icolor)
integer function iwgraddmultlns3d(istream, plist3d, np, ith, ipat, icolor)
integer function iwgraddmultlns5d(istream, plist3d, np, wave, time, ith, ipat, icolor)
integer istream, np, ith, ipat, icolor, wave, time
real plist2d(2 * np), plist3d(3 * np)

Description

In the image window attached to istream, draws np/2 line segments from np points: the first line segment joins the first two points, the second line segment joins the third and fourth points, and so on. Unlike the IWGrAddLns family of functions, the segments are not guaranteed to be connected. For IWGrAddMultLns and IWGrAddMultLns2D only the x and y coordinates are specified: the points are not associated with any section and will appear in all sections. For C, the 2D coordinates are described by a IW_POINT_2D structure which has two fields: x for the x coordinate and y for the y coordinate. The list of points, plist, for IWGrAddMultLns and IWGrAddMultLns2D is then an array of IW_POINT_2D structures. For Fortran, the coordinates are passed in plist2d, a 1D array with 2 * np elements; the x coordinate of the ith point is the 2*i-1 element of plist2d and the y coordinate of the ith point is the 2*i element of plist2d. For IWGrAddMultLns3D and IWGrAddMultLns5D, the x, y, and z coordinates are specified. For C, the 3D coordinates are described by a IW_POINT structure which has three fields: x for the x coordinate, y for the y coordinate, and z for the z coordinate. The list of points, plist, for IWGrAddMultLns3D and IWGrAddMultLns5D is then an array of IW_POINT structures. For Fortran, the coordinates are passed in plist3d, a 1D array with 3 * np elements; for the ith point, the x coordinate of the is the 3*i-2 element of plist3d, the y coordinate is the 3*i-1 element of plist3d, and the z coordinate is the 3*i element of plist3d.

IWGrAddMultLns assumes that the point coordinates are in window coordinates; IWGrAddMultLns2D, IWGrAddMultLns3D, and IWGrAddMultLns5D assume that the point coordinates are in data coordinates. The line segments added by IWGrAddMultLns3D will appear across all waves and time points. The segments added by IWGrAddMultLns5D are associated with a particular wave, whose index is wave, and time point, whose index is time. You can use -1 for the z coordinate, wave, or time if you do not want a particular coordinate assigned for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, the line segments appear across all sections in that dimension.

ith sets the thickness of the line segment in screen pixels. ipat is currently ignored; for compatibility with future versions where ipat will set the style of line used, always set ipat to one. icolor sets the color index for the color of the added line segment. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero.

Limitations

Image windows assume that all the points have the same z coordinate so calls to IWGrAddMultLns3D or IWGrAddMultLns5D which have points with different z values will not be handled as expected.

The current implementation of IWGrAddMultLns5D will draw the graphics in all sections if the z coordinate for the first point, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window or the attempt to allocated space for the coordinates failed.


IWGrAddMultStr, IWGrAddMultStr2D, IWGrAddMultStr3D, IWGrAddMultStr5D

Synopsis (C)

int IWGrAddMultStr(int istream, IW_POINT_2D_PTR plist, char *str[], int npts,int max_char, int isiz, const int icolor[]);
int IWGrAddMultStr2D(int istream, IW_POINT_2D_PTR plist, char *str[], int npts,int max_char, int isiz, const int icolor[]);
int IWGrAddMultStr3D(int istream, IW_POINT_PTR plist, char *str[], int npts,int max_char,int isiz, const int icolor[]);
int IWGrAddMultStr5D(int istream, IW_POINT_PTR plist, int wave, int time, int npts, int max_char, char *str[], int isiz, const int icolor[]);

Synopsis (Fortran)

integer function iwgraddmultstr(istream, plist2d, str, npts, max_char, isiz, icolor)
integer function iwgraddmultstr2d(istream, plist2d, str, npts, max_char, isiz, icolor)
integer function iwgraddmultstr3d(istream, plist3d, str, npts, max_char, isiz, icolor)
integer function iwgraddmultstr5d(istream, plist3d, wave, time, npts, max_char, str, isiz, icolor)
integer istream, npts, max_char, isiz, wave, time
integer icolor(npts)
real plist2d(2 * npts), plist3d(3 * npts)
character*(*) str

Description

Draws npts strings of text on the image window attached to istream. In C, pass the strings, str, as the typical array of null-terminated character strings. In Fortran, pass the strings packed into a single character array with a '~' at the end of each string (i.e. for the strings, "label 1", "label 2", and "label 3", you would pass "label 1~label 2~label 3~" for str). In either C or Fortran, pass the length of the longest individual label (including the space for a terminating null character) as max_char.

For IWGrAddMultStr and IWGrAddMultStr2D the coordinates for the start of each string are specified by the x and y coordinates only: the strings are not associated with any section and will appear in all sections. For C, the 2D coordinates are described by a IW_POINT_2D structure which has two fields: x for the x coordinate and y for the y coordinate. The list of points, plist, for IWGrAddMultStr and IWGrAddMultStr2D is then an array of IW_POINT_2D structures. For Fortran, the coordinates are passed in plist2d, a 1D array with 2 * np elements; the x coordinate of the ith point is the 2*i-1 element of plist2d and the y coordinate of the ith point is the 2*i element of plist. For IWGrAddMultStr3D and IWGrAddMultStr5D, the coordinates for the start of each string are specified by x, y, and z coordinates. For C, the 3D coordinates are described by a IW_POINT structure which has three fields: x for the x coordinate, y for the y coordinate, and z for the z coordinate. The list of points, plist, for IWGrAddMultStr3D and IWGrAddMultStr5D is then an array of IW_POINT structures. For Fortran, the coordinates are passed in plist3d, a 1D array with 3 * np elements; for the ith point, the x coordinate of the is the 3*i-2 element of plist3d, the y coordinate is the 3*i-1 element of plist3d, and the z coordinate is the 3*i element of plist3d.

IWGrAddMultStr assumes that the starting locations are in window coordinates; IWGrAddMultStr2D, IWGrAddMultStr3D, and IWGrAddMultStr5D assume starting locations are in data coordinates. The text strings added by IWGrAddMultStr3D will appear across all waves and time points. The segments added by IWGrAddMultStr5D are associated with a particular wave, whose index is wave, and time point, whose index is time. You can use -1 for the z coordinate, wave, or time if you do not want a particular coordinate assigned for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, a text string appear across all sections in that dimension.

isiz sets the size, measured in screen pixels, for the drawn characters. icolor, an array with npts elements, sets the color index for each string. Valid values for an element of icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values are coerced to zero.

Limitations

Image windows assume that all the starting positions have the same z coordinate so calls to IWGrAddMultStr3D or IWGrAddMultStr5D which have points with different z values will not be handled as expected.

The current implementation of IWGrAddMultStr5D will draw the graphics in all sections if the first z coordinate, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window.


IWGrAddPoly, IWGrAddPoly2D, IWGrAddPoly3D, IWGrAddPoly5D

Synopsis (C)

int IWGrAddPoly(int istream, const IW_POINT_2D_PTR plist, int npt, int ith, int icolor);
int IWGrAddPoly2D(int istream, const IW_POINT_2D_PTR plist, int npt, int ith, int icolor);
int IWGrAddPoly3D(int istream, const IW_POINT_PTR plist, int npt, int ith, int icolor);
int IWGrAddPoly5D(int istream, const IW_POINT_PTR plist, int npt, int iwave, int itime, int ith, int icolor);

Synopsis (Fortran)

integer function iwgraddpoly(istream, plist2d, npt, ith, icolor)
integer function iwgraddpoly2d(istream, plist2d, npt, ith, icolor)
integer function iwgraddpoly3d(istream, plist3d, npt, ith, icolor)
integer function iwgraddpoly5d(istream, plist3d, npt, iwave, itime, ith, icolor)
integer istream, ipt, ith, icolor, wave, time
real plist2d(2 * npt), plist3d(3 * npt)

Description

In the image window attached to istream, draws a polygon with np vertices. For IWGrAddPoly and IWGrAddPoly2D only the x and y coordinates are specified: the vertices are not associated with any section and will appear in all sections. For C, the 2D coordinates are described by a IW_POINT_2D structure which has two fields: x for the x coordinate and y for the y coordinate. The list of vertices, plist, for IWGrAddPoly and IWGrAddPoly2D is then an array of IW_POINT_2D structures. For Fortran, the coordinates are passed in plist2d, a 1D array with 2 * np elements; the x coordinate of the ith vertex is the 2*i-1 element of plist2d and the y coordinate of the ith vertex is the 2*i element of plist2d. For IWGrAddPoly3D and IWGrAddPoly5D, the x, y, and z coordinates are specified. For C, the 3D coordinates are described by a IW_POINT structure which has three fields: x for the x coordinate, y for the y coordinate, and z for the z coordinate. The list of vertices, plist, for IWGrAddPoly3D and IWGrAddPoly5D is an array of IW_POINT structures. For Fortran, the coordinates are passed in plist3d, a 1D array with 3 * np elements; for the ith vertex, the x coordinate of the is the 3*i-2 element of plist3d, the y coordinate is the 3*i-1 element of plist3d, and the z coordinate is the 3*i element of plist3d.

IWGrAddPoly assumes that the vertex coordinates are in window coordinates; IWGrAddPoly2D, IWGrAddPoly3D, and IWGrAddPoly5D assume that the vertex coordinates are in data coordinates. The polygon added by IWGrAddPoly3D will appear across all waves and time points. The polygon added IWGrAddPoly5D is associated with a particular wave, whose index is wave, and time point, whose index is time. You can use -1 for the z coordinate, wave, or time if you do not want a particular coordinate assigned for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, the line segments appear across all sections in that dimension.

ith sets the thickness of the line segment in screen pixels. ipat is currently ignored; for compatibility with future versions where ipat will set the style of line used, always set ipat to one. icolor sets the color index for the color of the added line segment. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero.

Limitations

Image windows assume that all the vertices have the same z coordinate so calls to IWGrAddPoly3D or IWGrAddPoly5D which have vertices with different z values will not be handled as expected.

The current implementation of IWGrAddPoly5D will draw the graphics in all sections if the first z coordinate, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window or the attempt to allocated space for the coordinates failed.


IWGrAddPt, IWGrAddPt2D, IWGrAddPt3D, IWGrAddPt5D

Synopsis (C)

int IWGrAddPt(int istream, float x, float y, int shape, int icolor);
int IWGrAddPt2D(int istream, float x, float y, int shape, int icolor);
int IWGrAddPt3D(int istream, float x, float y, float z, int shape, int icolor);
int IWGrAddPt5D(int istream, float x, float y, float z, int wave, int time, int shape, int icolor);

Synopsis (Fortran)

integer function iwgraddpt(istream, x, y, shape, icolor)
integer function iwgraddpt2d(istream, x, y, shape, icolor)
integer function iwgraddpt3d(istream, x, y, z, shape, icolor)
integer function iwgraddpt5d(istream, x, y, z, iwave, itime, shape, icolor)
integer istream, shape, icolor, wave, time
real x, y, z

Description

Draw a single point marker on the image window attached to istream. IWGrAddPt assumes the point's position (x, y) is in window coordinates. IWGrAddPt2D, IWGrAddPt3D, and IWGrAddPt5D assume the point's position is in data coordinates. A point added by IWGrAddPt or IWGrAddPt2D is not associated with a particular section and will appear in all sections. A point added by IWGrAddPt3D is associated with a particular z coordinate but will appear across all waves and time points. A point added by IWGrAddPt5D has a z coordinate (z), wave index (wave), and time index (time) associated with it. You can use -1 for z, wave, or time if you do not want a particular coordinate assigned to the point for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, the point appears across all sections in that dimension.

icolor sets the color index for the color of the added point. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero. ishape sets the shape of the drawn marker. Possible options for ishape are:

IW_GR_DOT (0)
The marker is an approximately one pixel (in screen coordinates) wide dot.
IW_GR_X (1)
The marker is a cross rotated 45 degrees relative to the horizontal.
IW_GR_O (2)
The marker is a circle.
IW_GR_PLUS (3)
The marker is a cross with horizontal and vertical arms.
IW_GR_SQUARE (4)
The marker is a square.
IW_GR_TRIANGLE (5)
The marker is an equilateral triangle.
IW_GR_DIAMOND (6)
The marker is roughly square and is rotated 45 degrees relative to the horizontal.

Limitations

The current implementation of IWGrAddPt5D will draw the graphics in all sections if z, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window.


IWGrAddPts, IWGrAddPts2D, IWGrAddPts3D, IWGrAddPts5D

Synopsis (C)

int IWGrAddPts(int istream, const IW_POINT_2D_PTR plist, int np, int shape, int icolor);
int IWGrAddPts2D(int istream, const IW_POINT_2D_PTR plist, int np,int shape, int icolor);
int IWGrAddPts3D(int istream, const IW_POINT_PTR plist, int np,int shape, int icolor);
int IWGrAddPts5D(int istream, const IW_POINT_PTR plist, int np, int iwave, int itime, int shape, int icolor);

Synopsis (Fortran)

integer function iwgraddpts(istream, plist2d, np, shape, icolor)
integer function iwgraddpts2d(istream, plist2d, np, shape, icolor)
integer function iwgraddpts3d(istream, plist3d, np, shape, icolor)
integer function iwgraddpts5d(istream, plist3d, np, iwave, itime, shape, icolor)
integer istream, np, shape, icolor, iwave, itime
real plist2d(2 * np), plist3d(3 * np)

Description

Draws a set of markers on the image window attached to istream. For IWGrAddPts and IWGrAddPts2D, a marker's position is set by its x and y coordinates: the markers are not associated with any section and will appear in all sections. For C, the 2D coordinates are described by a IW_POINT_2D structure which has two fields: x for the x coordinate and y for the y coordinate. The list of points, plist, for IWGrAddPts and IWGrAddPts2D is then an array of IW_POINT_2D structures. For Fortran, the coordinates are passed in plist2d, a 1D array with 2 * np elements; the x coordinate of the ith point is the 2*i-1 element of plist2d and the y coordinate of the ith point is the 2*i element of plist2d. For IWGrAddPts3D and IWGrAddPts5D, the x, y, and z coordinates are specified. For C the 3D coordinates are described by a IW_POINT structure which has three fields: x for the x coordinate, y for the y coordinate, and z for the z coordinate. The list of points, plist, for IWGrAddPts3D and IWGrAddPts5D is then an array of IW_POINT structures. For Fortran, the coordinates are passed in plist3d, a 1D array with 3 * np elements; for the ith point, the x coordinate of the is the 3*i-2 element of plist3d, the y coordinate is the 3*i-1 element of plist3d, and the z coordinate is the 3*i element of plist3d.

IWGrAddPts assumes that the marker coordinates are in window coordinates; IWGrAddPts2D, IWGrAddPts3D, and IWGrAddPts5D assume that the marker coordinates are in data coordinates. The markers added by IWGrAddPts3D will appear across all waves and time points. The markers added by IWGrAddPts5D are associated with a particular wave, whose index is iwave, and time point, whose index is time. You can use -1 for the z coordinate, wave, or time if you do not wave a particular coordinate assigned for the z, wave or time dimension, respectively. When a coordinate is not assigned for a dimension, the markers appear across all sections in that dimension.

icolor sets the color index for the color of the added point. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero. ishape sets the shape of the drawn marker. Possible options for ishape are:

IW_GR_DOT (0)
The marker is an approximately one pixel (in screen coordinates) wide dot.
IW_GR_X (1)
The marker is a cross rotated 45 degrees relative to the horizontal.
IW_GR_O (2)
The marker is a circle.
IW_GR_PLUS (3)
The marker is a cross with horizontal and vertical arms.
IW_GR_SQUARE (4)
The marker is a square.
IW_GR_TRIANGLE (5)
The marker is an equilateral triangle.
IW_GR_DIAMOND (6)
The marker is roughly square and is rotated 45 degrees relative to the horizontal.

Limitations

Image windows assume that all the points have the same z coordinate so calls to IWGrAddPts3D or IWGrAddPts5D which have points with different z values will not be handled as expected.

The current implementation of IWGrAddPts5D will draw the graphics in all sections if the first z coordinate, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window or allocation of space for the coordinates failed.


IWGrAddStr, IWGrAddStr2D, IWGrAddStr3D, IWGrAddStr5D

Synopsis (C)

int IWGrAddStr(int istream, float xst, float yst, const char *str,int isiz, int icolor);
int IWGrAddStr2D(int istream, float xst, float yst, const char *str, int isiz, int icolor);
int IWGrAddStr3D(int istream, float xst, float yst, float zst, const char *str, int isiz, int icolor);
int IWGrAddStr5D(int istream, float xst, float yst, float zst, int wave, int time, const char *str, int isiz, int icolor);

Synopsis (Fortran)

integer function iwgraddstr(istream, xst. yst, str, isiz, icolor)
integer function iwgraddmstr2d(istream, xst, yst, str, isiz, icolor)
integer function iwgraddstr3d(istream, xst, yst, zst, str, isiz, icolor)
integer function iwgraddstr5d(istream, xst, yst, zst, wave, time, str, isiz, icolor)
integer istream, isiz, icolor, wave, time
real xst, yst, zst
character*(*) str

Description

Draws a string of text, str, on the image window attached to istream. IWGrAddStr assumes the string's position (xst, yst) is in window coordinates. IWGrAddStr2D, IWGrAddStr3D, and IWGrAddStr5D assume the strings's position is in data coordinates. A string added by IWGrAddStr or IWGrAddStr2D is not associated with a particular section and will appear in all sections. A string added by IWGrAddStr3D is associated with a particular z coordinate, zst, but will appear across all waves and time points. A string added by IWGrAddStr5D has a z coordinate (zst), wave index (wave), and time index (time) associated with it. You can use -1 for zst, wave, or time if you do not want a particular coordinate assigned to the point for the z, wave, or time dimension, respectively. When a coordinate is not assigned for a dimension, the point appears across all sections in that dimension.

isiz sets the size, measured in screen pixels, for the drawn characters. icolor sets the color index for the color of the added string. Valid values for icolor range from zero to IW_NUM_COLORS-1 (11); out-of-range values for icolor are coerced to zero.

Limitations

The current implementation of IWGrAddStr5D will draw the graphics in all sections if zst, wave, or time is less than zero.

Return Value

Returns a non-negative value which is the ID of the added graphic if successful; use that ID with the functions that manipulate individual graphics or list of graphics. Returns IW_ERROR (-1) if istream is not attached to an image window.


IWGrAtt5DMod

Attaches a window to the 5D model structure.

Synopsis (C)

int IWGrAtt5DMod(int istream);

Synopsis (Fortran)

integer function iwgratt5dmod(istream)
integer istream

Description

Attaches the 5D model to the window associated with istream. Objects created with 3DModel are stored in shared memory. Multiple windows can be attached to the model in order to view the model from different perspectives. For each window where you want the model the model to allow viewing the model on the data from different angles. For each window that should display the model, make a call to IWGrAtt5DMod.

Return Value

If istream is associated with an image window which is not already attached to the 5D model, IWGrAtt5DMod returns the number of window (including the one associated with istream) currently attached to the model; otherwise, returns IW_ERROR (-1).


IWGrDet5DMod

Detaches a window from the 5D model structure.

Synopsis (C)

int IWGrDet5DMod(int istream);

Synopsis (Fortran)

integer function iwgrdet5dmod(istream)
integer istream

Description

Detaches the image window associated with istream from the 5D model. Graphics related to the model will no longer be rendered in that image window.

Return Value

If istream is associated with an image window which is attached to the 5D model, IWGrDet5DMod returns the number of windows attached to the model after detaching the image window associated with istream; otherwise, returns IW_ERROR (-1).


IWGrDisGrID

Displays one graphic.

Synopsis (C)

int IWGrDisGrID(int istream, int igrid);

Synopsis (Fortran)

integer function iwgrdisgrid(istream, igrid)
integer istream, igrid

Description

For the image window attached to istream, redraws the graphic with the ID, igrid. Provides a faster alternative to a complete redraw, via IWDisplay, when adding a graphic.

Return Value

Always returns IW_SUCCESS (1).


IWGrDisGrList

Displays a list of graphic objects.

Synopsis (C)

int IWGrDisGrList(int istream, const int list[], int nobj);

Synopsis (Fortran)

integer function iwgrdisgrlist(istream, list, nobj)
integer istream, nobj
integer list(nobj)

Description

Redraws zero or more graphics in the image window attached to istream. nobj is the number of graphics to redraw and list is the array of graphic IDs to redraw. Provides a faster alternative to a complete redraw, via IWDisplay, when adding graphics.

Return Value

Always returns IW_SUCCESS (1).


IWGrRmAllGrID

Removes all graphics in an image window.

Synopsis (C)

int IWGrRmAllGrID(int istream);

Synopsis (Fortran)

integer function iwgrrmallgrid(istream)
integer istream

Description

Remove all the graphics in the image window attached to istream.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWGrRmGrID

Removes one graphic from an image window.

Synopsis (C)

int IWGrRmGrID(int istream, int igrid);

Synopsis (Fortran)

integer function iwgrrmgrid(istream, igrid)
integer istream, igrid

Description

Deletes a graphic object, igrid from the image window attached to istream where igrid is the ID returned by the IWGrAdd function used to create the graphic.

Return Value

If istream is attached to an image window and igrid is a valid ID for a graphic in that image window, IWGrRmGrID returns IW_SUCCESS (1); otherwise, returns IW_ERROR (-1).


IWGrRmGrList

Removes a list of graphics from an image window.

Synopsis (C)

int IWGrRmGrList(int istream, const int list[], int nobj);

Synopsis (Fortran)

integer function iwgrrmgrlist(istream, list, nobj)
integer istream, nobj
integer list(nobj)

Description

Removes one or more graphics from an image window. Can be faster than repeated calls to IWGrRmGrID. istream is the stream associated with the target image window, nobj is the number of graphics to remove, and list is the array of graphic IDs to remove.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and all the graphic IDs from list were present; otherwise, returns IW_ERROR (-1).


IWGrRmProc

Removes all the graphics the calling program placed in an image window.

Synopsis (C)

int IWGrRmProc(int istream);

Synopsis (Fortran)

integer iwgrrmproc(istream)
integer istream

Description

For the image window attached to the stream, istream, removes all the graphics created by the calling program.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and that image window has at least one graphic created by the calling program; otherwise, returns IW_ERROR (-1).


Window Query - "IWIs"


IWIsViewFile

Returns whether or not an image window has its backing store in a file.

Synopsis (C)

int IWIsViewFile(int istream);

Synopsis (Fortran)

integer iwisviewfile(istream)
integer istream

Description

Returns 1 if the image window attached to istream was attached to a file with IWAttachFile. Returns 0 if the image window attached to istream is not attached to a file.

An application that modifies the headers of image windows may need to call IWIsViewFile because windows attached to files effectively have two sets of header information (one stored in memory and the other in the file), and any changes in one header are not automatically propagated to the other.


IWIsIWLEvt

Queries whether an event came from an image window or not.

Synopsis (C)

int IWIsIWLEvt(XEvent* event);

Synopsis (Fortran)

integer function iwisiwlevt(event)
dummy_type event

Description

Given an X event event, returns zero if the event did not come from an image window or the window number, a positive integer, if the event came from an image window.


IWIsSclBarOn

Returns whether or not an image window displays a scale bar.

Synopsis (C)

int IWIsSclBarOn(int istream);

Synopsis (Fortran)

integer function iwissclbaron(istream)
integer istream

Description

Returns one of the following:

IW_ERROR (-1)
istream is not attached to an image window.
zero
istream is attached to an image window that currently does not display a scale bar.
one
istream is attached to an image window that currently displays a scale bar without a label indicating the scale bar's length.
two
istream is attached to an image window that currently displays a scale bar with a label indicating the scale bar's length.

IWIsStructSame

Tests whether two strings of bytes are equal.

Synopsis

int IWIsStructSame(void* str1_ptr, void* str2_ptr, int size);

Description

Returns one if the first size bytes pointed to by str1_ptr are identical to the first size bytes pointed to by str2_ptr; otherwise, returns zero.


IWIsValidMode

Returns whether or not a pixel format code is supported by the IM and IW libraries.

Synopsis (C)

int IWIsValidMode(int mode);

Synopsis (Fortran)

integer function iwisvalidmode(mode)
integer mode

Description

Tests whether or not the argument is a valid code for the data type (byte, float, etc...) of the pixels in a window or file. Such a code would typically be returned by IMRdHdr and is used as an argument to a number of other functions: IMCrHdr, IMAlMode, IWScaleImage, and IWRtPixSize.

Return Value

Returns one if the library understands the given mode; otherwise, returns zero.


IWIsWaveMap

Returns whether or not a wave is currently displayed.

Synopsis (C)

int IWIsWaveMap(int istream, int iwave);

Synopsis (Fortran)

integer iwiswavemap(istream, iwave)
integer istream, iwave

Description

Returns 0 if the wave with index iwave is not displayed in the window attached to istream, returns 1 if the wave with index iwave is displayed in the window attached to istream, and returns IW_ERROR (-1) if istream is not valid.


IWIsWinExist

Returns whether or not a given window number is in use.

Synopsis (C)

int IWIsWinExist(int wid);

Synopsis (Fortran)

integer function iwiswinexist(wid)
integer wid

Description

If the image window numbered, wid, currently exists, IWIsWinExist returns one; otherwise, returns 0.


IWIsWinMap

Returns whether an image window is iconified or not.

Synopsis (C)

int IWIsWinMap(int istream);

Synopsis (Fortran)

integer function iwiswinmap(istream)
integer istream

Description

Returns IW_ERROR (-1) if istream is not attached to an image window. Returns 1 if istream is attached to an open image window which is not iconified. Otherwise, returns 0.


Return Window Information - "IWRt"


IWRtAllWin

Returns the window numbers for all currently open windows.

Synopsis (C)

int IWRtAllWin(int *nwin, int wlist[]);

Synopsis (Fortran)

integer function iwrtallwin(nwin, wlist)
integer nwin, wlist(*)

Description

Sets nwin to the total number of image windows currently open (including "Monitor 0", the parent of all the image windows) and fills the elements of wlist with the window numbers for the currently open image windows.

Return Value

Alwars returns IW_SUCCESS (1).


IWRtBufImg

Returns whether or not displayed images are buffered.

Synopsis (C)

int IWRtBufImg(int istream);

Synopsis (Fortran)

integer function iwrtbufimg(istream)
integer istream

Description

For the window associated with istream, returns 1 if the image window saves the scaled images used for display or returns 0 if the scaled images are not saved. Saving the scaled images takes more memory or disk space but can avoid recalculation if the image needs to be redrawn. If istream is not valid, IWRtBufImg returns IW_ERROR (-1). Unless configured otherwise by the user, the default is to save scaled images.


IWRtColorMode

Returns whether an image window is using true color or pseudocolor to display images.

Synopsis (C)

int IWRtColormode(int istream);

Synopsis (Fortran)

integer function iwrtcolormode(istream)
integer istream

Description

For the window associated with istream, returns IW_PSEUDO (1) when the window displays images using pseudocolor and returns IW_TRUE_COLOR (0) when multiple wavelengths are combined with different colors to form a single image. Returns IW_ERROR (-1) if istream is not attached to an image window.


IWRtColorNames

Returns the names of the graphics colors.

Synopsis (C)

int IWRtColorNames(char *colors[IW_NUM_COLORS]);

Synopsis (Fortran)

integer function iwrtcolornames(colors)
character*(*) colors

Description

There are only IW_NUM_COLORS (12) graphic colors available at any one time, but they can be changed by modifying the RGB values with IWAlLut. Each of the colors has a name associated with it to make it easier for end users to select a color. IWRtColorNames fills colors with the current names of the graphic colors. In C, colors is an array of null-terminated strings each of which must have IW_COLOR_NAME_LEN + 1 characters (IW_COLOR_NAME_LEN is defined to have a value of 12). In Fortran, the color names are packed into a single character array, colors, with a tilde following each name; if the length of colors is insufficient to hold all the packed names (at most IW_NUM_COLORS times IW_COLOR_NAME_LEN + 1 characters will be used), IWRtColorNames silently truncates the result.

Return Value

Returns IW_ERROR (-1) if the shared memory storage for the color names could not be located; otherwise, returns IW_SUCCESS (1).


IWRtComplexDis

Returns the current display method for complex-valued image data.

Synopsis (C)

int IWRtComplexDis(int istream);

Synopsis (Fortran)

integer function iwrtcomplexdis(istream)
integer istream

Description

Returns one of the following values:

IW_ERROR (-1)
istream is not attached to an image window.
IW_COMPLEX_AMPLITUDE (0x10000 hexadecimal)
The image window attached to istream displays the amplitude of the complex value when displaying complex-valued data.
IW_COMPLEX_REAL (0x20000 hexadecimal)
The image window attached to istream displays the real component of the complex value when displaying complex-valued data.
IW_COMPLEX_IMAGINARY (0x30000 hexadecimal)
The image window attached to istream displays the imaginary component of the complex value when displaying complex-valued data.
IW_COMPLEX_PHASE (0x40000 hexadecimal)
The image window attached to istream displays the phase, in radians, of the complex value when displaying complex-valued data.

IWRtComplexNormalValue

Returns the amplitude of a complex value.

Synopsis (C)

float IWRtComplexNormalValue(IW_COMPLEX_PTR complex_ptr)

Description

Returns the square root of complex_ptr->real * complex_ptr->real + complex_ptr->imaginary * complex_ptr->imaginary.


IWRtCurDataGraphics

Synopsis (C)

int IWRtCurDataGraphics(int istream, int z_offset, IW_GRL_PTR** graphic_ptr);


IWRtCurWinGraphics

Synopsis (C)

int IWRtCurWinGraphics(int istream, IW_GRL_PTR** graphic_ptr);


IWRtDisArea

Returns the geometry of an image display.

Synopsis (C)

int IWRtDisArea(int istream, int* ix, int* iy, int* iwidth, int* iheight);

Synopsis (Fortran)

integer function iwrtdisarea(istream, ix, iy, iwidth, iheight)
integer istream
integer ix, iy, iwidth, iheight

Description

For the given stream, returns the geometry of the portion of the image window dedicated to image display. The width and height in pixels are returned in iwidth and iheight. The origin is returned in ix and iy. The origin is measured in pixels relative to the lower left hand corner of the screen. The return value is IW_SUCCESS (1) if istream is attached to a window and IW_ERROR (-1) if it is not.


IWRtDisDelay

Returns the interval between repetitions automatically generated for key and mouse button events.

Synopsis (C)

int IWRtDisDelay(int istream);

Synopsis (Fortran)

integer function iwrtdisdelay(istream)
integer istream

Description

Pressing and holding a key in an image window will generate multiple key press events if the button is held down long enough. IWRtDisDelay returns the interval, measured in microseconds, between each subsequent event that is sent. Unless configured otherwise by the user, the default value for the delay is 33000 microseconds. If istream is not attached to an image window, IWRtDisDelay returns IW_ERROR (-1).


IWRtDisFmt

Returns how images are ordered when displayed as a matrix in a single image window.

Synopsis (C)

int IWRtDisFmt(int istream);

Synopsis (Fortran)

integer function iwrtdisfmt(istream)
integer istream

Description

Returns DATA_FMT (0) if images appear in increasing order from left to right and then from bottom to top when displayed as a matrix. Returns TEXT_FMT (1) if images appear in increasing order from left to right and then from top to bottom when displayed as a matrix. Returns IW_ERROR (-1) if istream is not attached to an image window.


IWRtDisImg

Returns whether or not an image window has image display enabled.

Synopsis (C)

int IWRtDisImg(int istream);

Synopsis (Fortran)

integer function iwrtdisimg(istream)
integer istream

Description

An image window has the option to not display the image in case you want to only see the graphics that are in the window. IWRtDisImg will return one if the window attached to istream has image display enabled, will return zero if the window attached to istream has image display disabled, and will return IW_ERROR (-1) if istream is not valid.


IWRtDisOffset

Returns the horizontal and vertical offsets applied when displaying a given wave.

Synopsis (C)

int IWRtDisOffset(int istream, int iwave, int ipixel[2]);

Synopsis (Fortran)

integer iwrtdisoffset(istream, iwave, ipixel)
integer istream, iwave
integer ipixel(2)

Description

The positioning of images within an image window's image display area depends on four parameters: the image window's size, the size of the data's x and y dimensions, the number of rows and columns of images displayed simultaneously, and wave-dependent horizontal and vertical offsets in x and y. For the wave with index iwave in the window attached to istream, IWRtDisOffset returns the current values for that wave's horizontal and vertical offsets. IWRtDisOffset stores the horizontal offset in the first element of ipixel and stores the vertical offset in the second element of ipixel; both values have units of data pixels. Valid values of the wave index, iwave, range from zero to the number of waves in the window minus one.

Return Value

Returns IW_SUCCESS (1) if istream is attached to a window and that window has the specified wave, iwave; otherwise, returns IW_ERROR (-1).


IWRtDisSec

Returns the index of the currently displayed section.

Synopsis (C)

int IWRtDisSec(int istream);

Synopsis (Fortran)

integer function iwrtdissec(istream)
integer istream

Description

IWRtDisSec returns the index of the currently displayed image in the window attached to istream. If the image window displays multiple images in a grid, the index returned is that of the first image in the matrix. Valid indices range from zero to the total number of sections in that data set minus one. If istream is not attached to an image window, IWRTDisSec returns IW_ERROR (-1).


IWRtDisSec_ZWT

Returns the z, wave, and time indices for the currently displayed section.

Synopsis (C)

int IWRtDisSec_ZWT(int istream, int *iz, int *iw, int *it);

Synopsis (Fortran)

integer function iwrtdissec_zwt(istream, iz, iw, it)
integer istream
integer iz, iw, it

Description

IWRtDisSec_ZWT sets iz to the z index, iw to the wave index, and it to the time index of the currently displayed section in the image window attached to istream. If the image window displays multiple images in a grid, the indices are for the first image in the matrix.

Return Value

If istream is attached to an image window, IWRtDisSec_ZWT returns IW_SUCCESS (1); otherwise, IWRtDisSec_ZWT returns IW_ERROR (-1).


IWRtDisSyncMode

Returns current setting for synchronized display of waves.

Synopsis (C)

int IWRtDisSyncmode(int istream);

Synopsis (Fortran)

integer function iwrtdissyncmode(istream)
integer istream

Description

Returns a code to reflect how the image window attached to istream synchronizes the current section in different waves. The value returned will be one of the following:

IW_ERROR (-1)
istream is not attached to an image window.
IW_APPLY_SYNC (0)
The image window forces the current sections in different waves to have the same z and time indices.
IW_APPLY_NONE (1)
The image window does not enforce a relationship between the current sections in different waves.
IW_APPLY_ALL (2)
If one current section is changed, the image window applies the same relative change to the current sections in all other waves; the image window then coerces the modified indices for the current sections so that they fall within the bounds of the data set.

Unless configured otherwise by the user, the default behavior for image windows is IW_APPLY_SYNC.


IWRtDisWinBdr

Returns which decorations are shown on an image display window.

Synopsis (C)

int IWRtDisWinBdr(int istream, int* pBorderSettings);

Synopsis (Fortran)

integer function iwrtdiswinbdr(istream, borderSettings)
integer istream
integer borderSettings

Description

The location pointed to by pBorderSettings is set to what type of decorations are present (this is for C, in FORTRAN borderSettings is modified). The result will be one of the following:

IW_MON_FULL_BRDR (0)
window title and resize border shown
IW_MON_RESIZE_BRDR (1)
window resize border shown
IW_MON_NO_BRDR (2)
no decorations added to window

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWRtDisWinTool

Returns the current setting for which menus and tool bars are show with an image window.

Synopsis (C)

int IWRtDisWinTool(int istream, int* pToolSettings);

Synopsis (Fortran)

integer function iwrtdiswintool(istream, toolSettings)
integer istream
integer toolSettings

Description

The location pointed to by pToolSettings is set to which menus and tools bars are shown on the display window attached to istream (this is for C, in FORTRAN toolSettings is modified). Its value will be a bitwise or of one or more of the following:

IW_MON_NO_MENU_TOOLS (0)
no menu or tool bars are shown
IW_MON_SHOW_MENU (1)
menu bar along the top of the image window is shown
IW_MON_SHOW_LEFTTOOLS (2)
buttons and slider along left side of image window are shown
IW_MON_ALL_MENU_TOOLS (3)
all menu and tool bars are shown

Return Value

Returns IW_SUCCESS if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWRtDisWave

Returns which waves an image window currently combines to form the displayed image.

Synopsis (C)

int IWRtDisWave(int istream, int w_array[IW_MAX_WAVE]);

Synopsis (Fortran)

integer function iwrtdiswave(istream, w_array)
integer istream
integer w_array(5)

Description

If the image window attached to istream displays images in pseudocolor (one wave per image), IWRtDisWave sets w_array[j] (w_array(j+1) in FORTRAN) to one if j is the currently displayed wave (i.e. as returned by IWRtDisSec_ZWT) and sets it to zero if j is some other value. If the image window combines multiple waves to form a single image, IWRtDisWave sets w_array[j] (w_array(j+1) in FORTRAN) to one if j is the index of one of the waves combined to form the image and sets it to zero if j is some other value; at most three elements of w_array will be set to one.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWRtDisWinList

Returns the window numbers for all uniconified image windows.

Synopsis (C)

int IWRtDisWinList(int *nwin, int wlist[]);

Synopsis (Fortran)

integer function iwrtdiswinlist(nwin, wlist)
integer nwin, wlist(*)

Description

Sets nwin to the total number of image windows which are currently open and not iconified. Fills the elements of wlist with the window numbers for the currently open and uniconified image windows.

Return Value

Always returns IW_SUCCESS (1).


IWRtFilename

Gets the name of the file associated with a wave in an image window.

Synopsis (C)

int IWRtFilename(int istream, int iwave, char *filename);

Synopsis (Fortran)

integer function iwrtfilename(istream, iwave, filename)
integer istream, iwave
character*(*) filename

Description

Sets the contents of filename to be the name of the file that is associated with wave iwave in the window referenced by istream. The value returned in filename may have up to IWRtFilenameLength characters (including the terminating null character). For C, it is the caller's responsibility that filename be long enough. For Fortran, the file name will be truncated by dropping characters from the front if filename is not long enough.

If you perform string comparisons with the returned value, keep in mind that IWAlFilename truncates long file names by dropping characters from the start of the name.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and iwave is a valid wave index for that window; otherwise, returns IW_ERROR (-1).


IWRtFilenameLength

Returns the maximum length of a file name returned by IWRtFilename or accepted without truncation by IWAlFilename.

Synopsis (C)

int IWRtFilenameLength(void);

Synopsis (Fortran)

integer function iwrtfilenamelength()


IWRtFontAscent

Synopsis (C)

int IWRtFontAscent(int istream);

Synopsis (Fortran)

integer function iwrtfontascent(istream)
integer istream


IWRtGrColors

Returns the graphic colors associated with each wavelength.

Synopsis (C)

int IWRtGrColors(int istream, int icolor[IW_MAX_WAVE]);

Synopsis (Fortran)

integer function iwrtgrcolors(istream, icolor)
integer istream
integer icolor(5)

Description

For the window associated with istream, sets the ith element of icolor to the graphic color index for wave i where i ranges from 0 to IW_MAX_WAVE - 1. Graphic color indices range from 0 to IW_NUM_COLORS - 1.

Return Value

Returns IW_ERROR (-1) is istream is not valid; otherwise, returns IW_SUCCESS (1).


IWRtGrDis

Returns whether or not graphics display is enabled for an image window.

Synopsis (C)

int IWRtGrDis(int istream);

Synopsis (Fortran)

integer function iwrtgrdis(istream)
integer istream

Description

Returns one if the image window attached to istream has graphics display enabled. Returns zero if the image window does not have graphics display enabled. Returns IW_ERROR (-1) if istream is not attached to an image window.


IWRtGrDisRange

Returns the range of z, wavelengths, and time points which affect graphics on a single section.

Synopsis (C)

int IWRtGrDisRange(int istream, int range[4]);

Synopsis (Fortran)

integer function iwalgrdisrange(istream, range)
integer istream
integer range(4)

Description

Returns the range for drawing graphics in istream. range has four elements:

range[0]
number of z sections before current section
range[1]
number of z sections after current section
range[2]
number of time sections before current section
range[3]
number of time sections after current section

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWRtImgColor

Returns the image display colors for each wavelength.

Synopsis (C)

int IWRtImgColor(int istream, int icolor[IW_MAX_WAVE]);

Synopsis (Fortran)

integer function iwrtimgcolor(istream, icolor)
integer istream
integer icolor(5)

Description

Returns the image display color for each wavelength in the array icolor. Valid values of icolor are: IW_RED (1), IW_GREEN (2), IW_BLUE (4), IW_WHITE (7), IW_BLACK (0), IW_YELLOW (3), IW_PINK (5), or IW_CYAN (6).


IWRtInterp

Returns whether or not an image window interpolates zoomed up images.

Synopsis (C)

int IWRtInterp(int istream);

Synopsis (Fortran)

integer iwrtinterp(istream)
integer istream

Description

For the window associated with istream, returns 1 if the window interpolates images when a zoom factor greater than one is applied, returns 0 if the window does not interpolate images when a zoom factor greater than one is applied, and returns IW_ERROR (-1) if istream is not attached to an image window.


IWRtLastDLWin

This function is not currently used; it always returns -1.

Synopsis (C)

int IWRtLastDLWin(void);

Synopsis (Fortran)

integer function iwrtlastdlwin()


IWRtLut

Gets the current RGB lookup tables (LUTs) used for all image windows.

Synopsis (C)

void IWRtLut(int ired[], int igreen[], int iblue[]);

Synopsis (Fortran)

subroutine iwrtlut(ired, igreen, iblue)
integer ired(*), igreen(*), iblue(*)

Description

Returns the red component of the image window color lookup table in ired, the green component in igreen, and the blue component in iblue. ired, igreen, and iblue must have at least imin + IWRtLutSize() + IW_NUM_COLORS elements where imin is the position of the first color used for pseudocolor image display. Use IWRtSclMinMax to determine the value of imin.


IWRtLutSize

Returns the number of elements in the color lookup table (LUT) used for pseudocolor image display.

Synopsis (C)

int IWRtLutSize(void);

Synopsis (Fortran)

integer function iwrtlutsize()

Description

The number of colors in the lookup table depends on the graphics hardware and Priism startup parameters. Use IWRtLutSize to return the number of colors used for pseudocolor image display in the current session; that number is useful for determining the size of the arrays needed when calling IWRtLut or IWAlLut.


IWRtMaxWin

Returns the maximum number of windows possible.

Synopsis (C)

int IWRtMaxWin(void);

Synopsis (Fortran)

integer function iwrtmaxwin()

Description

Returns the maximum number of image windows that can be open simultaneously. Window numbers will fall in the range of 1 to the return value of IWRtMaxWin.


IWRtMulDis

Returns the current setting for the multiple image matrix.

Synopsis (C)

int IWRtMulDis(int istream, int* imdx, int* imdy);

Synopsis (Fortran)

integer function iwrtmuldis(istream, imdx, imdy)
integer istream
integer imdx, imdy

Description

An image window can display the different sections of the data stack as a matrix. IWRtMulDis returns the number of columns for the matrix in imdx and the number rows in imdy.


IWRtNextDLWin

Returns the next window in the display list.

Synopsis (C)

int IWRtNextDLWin(int wid);

Synopsis (Fortran)

integer function iwrtnextdlwin(wid)
integer wid

Description

All the currently displayed image windows are kept in a display list in order from most recently displayed to least recently displayed. IWRtNextDLWin returns the number of the window that is next in the list after wid.

Return Value

Returns the window number of the window in the display list after wid; if there is no such window, returns -1.


IWRtNoCopy

Returns how IMWr* calls transfer data to an image window.

Synopsis (C)

int IWRtNoCopy(int istream);

Synopsis (Fortran)

integer iwrtnocopy(istream)
integer istream

Description

Functions that write entire images to image windows will either copy the data that is passed to them or assume control (including responsibility of deallocation) of the block of memory passed to them avoiding the overhead of a copy. The former is the default; the latter requires that the image be allocated in shared memory with IWAlcSHM.

IWRtNoCopy returns zero if the image data passed to istream is copied, returns one if the image data is not copied, and returns IW_ERROR (-1) if istream is invalid.


IWRtNumDisWin

Returns the number of image windows which are open and not iconified.

Synopsis (C)

int IWRtNumDisWin(void);

Synopsis (Fortran)

integer function iwrtnumdiswin()


IWRtNumOVColors

Returns the number of overlay colors.

Synopsis (C)

int IWRtNumOVColors(void);

Synopsis (Fortran)

integer function iwrtnumovcolors()

Description

The total number of overlay colors is dependent on the graphics hardware. This call lets you know how big your arrays need to be for the function IWRtOVColors and how many colors you have to work with. If the system does not support overlay graphics, IWRtNumOVColors returns zero.


IWRtNumWin

Returns the number of windows currently open.

Synopsis (C)

int IWRtNumWin(void);

Synopsis (Fortran)

integer function iwrtnumwin()

Description

Returns the total number of image windows currently running in the session. The number returned includes image windows that are iconified and "Monitor 0" which does not display a window but is the parent of all the other monitors.


IWRtOffsetGroup

Synopsis (C)

int IWRtOffsetGroup(int istream, int flags[]);

Synopsis (Fortran)

integer function iwrtoffsetgroup(istream, flags)
integer istream
integer flags(*)


IWRtOVColors

Returns the red, green, and blue components of the colors used for drawing in the overlay planes.

Synopsis (C)

int IWRtOVColors(int ired[], int igreen[], int iblue[]);

Synopsis (Fortran)

integer function iwrtovcolors(ired, igreen, iblue)
integer ired(*), igreen(*), iblue(*)

Description

For the ith color of the IWRtNumOVColors() colors used to draw to the overlay planes, sets the ith element of ired to the red component of the color, the ith element of igreen to the green component of the color, and the ith element of iblue to the blue component of the color. Each component will be a value in the range of zero to 255, inclusive. The ired, igreen, and iblue arrays each have at least IWRtNumOVColors() elements a piece.

Return Value

Always returns IW_SUCCESS (1).


IWRtPixSize

Returns the number of bytes per pixel based on data type.

Synopsis (C)

int IWRtPixSize(int mode);

Synopsis (Fortran)

integer function iwrtpixsize(mode)
integer mode

Description

The modified MRC format used has codes for the format of a pixel. You can find a table of valid codes in the IM library documentation. IWRtPixSize returns the number of bytes required per pixel give the type code, mode.

Return Value

Returns the number of bytes per pixel for mode. If mode is not one of the recognized formats, returns IW_ERROR (-1).


IWRtPsdGrColor

Returns the current color map number for graphics drawn to the window when in pseudocolor mode.

Synopsis (C)

int IWRtPsdGrColor(int istream);

Synopsis (Fortran)

integer function iwrtpsdgrcolor(istream)
integer istream

Description

Returns the one graphic color associated with all the waves when in pseudocolor mode. By default, graphics will be displayed with the color index IW_RED. One can always use the other colors, but this lets the user select the graphic color on the monitor.

Return Value

If istream is valid and attached to an image window, returns a value between 0 and (IW_NUM_COLORS-1); otherwise returns IW_ERROR (-1).


IWRtScl

Returns the intensity scaling values for one wavelength.

Synopsis

int IWRtScl(int istream, int iwave, float scale[4]);

Description

IWRtScl retrieves the wave scaling parameters for the wave iwave (valid values of iwave range from zero to the number of wavelengths in the image window minus one) in the image window attached to istream. The scaling parameters are stored in scale as follows:

first element
Is the minimum displayed intensity. Intensities below this value are displayed the same as the minimum intensity.
second element
Is the maximum displayed intensity.
third element
Is the exponent (i.e. gamma) of the scaling function. A linear scaling, which has an exponent of one, is a common case. A scaling relationship which varies as the square root of the intensity would have an exponent of 0.5; a scaling relationship which varies as teh square of the intensity would have an exponent of two.
fourth element
Controls the display of intensities larger than the maximum displayed intensity. If this element is not one, intensities larger than the maximum intensity are displayed the same as the maximum intensity; otherwise, intensities larger than the maximum intensity are displayed the same as the minimum intensity.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and iwave is greater than or equal to zero and less than IW_MAX_WAVE (5); otherwise, returns IW_ERROR (-1).


IWRtSclBarAttr

Returns the current attributes of the image window's scale bar.

Synopsis (C)

int IWRtSclBarAttr(int istream, int *icolor, int *idir, float *rlen, int *ithick, int ipos[2]);

Synopsis (Fortran)

integer iwrtsclbarattr(istream, icolor, idir, rlen, ithick, ipos)
integer istream
integer icolor, idir, ithick, ipos(2)
real rlen

Description

Fetches the attributes of the scale bar for the window attached to istream. Sets icolor to the graphics color index used to display the scroll bar. Sets idir to the orientation of the scroll bar: one if vertical and zero if horizontal. Sets rlen to the length of the scroll bar in terms of the pixel spacing units (normally microns). Sets ithick to the thickness of the scroll bar in pixels. Sets the first element of ipos to the x coordinate of the lower left corner of the scroll bar and the second element ofipos to the corresponding y coordinate; the coordinates are in units of screen pixels and are relative to the lower left corner of the image display area.

Return Value

Returns IW_ERROR if istream is not attached to an image window; otherwise, returns IW_SUCCESS.


IWRtSclMinMax

Returns the range of color table indices used for pseudocolor image display.

Synopsis (C)

void IWRtSclMinMax(int *imin, int *imax);

Synopsis (Fortran)

subroutine iwrtsclminmax(imin, imax)
integer imin, imax

Description

The number of colors in the lookup table depends on the graphics hardware and Priism startup parameters. IWRtSclMinMax sets imin to the color table position of the first color used for pseudocolor image display and sets imax to the color table position of the last color used for pseudocolor image display. The The graphics colors are in the same colormap immediately after the colors for pseudocolor image display.


IWRtSclAlgorithm

Returns the scaling algorithm used for image display.

Synopsis (C)

int IWRtSclAlgorithm(int istream);

Synopsis (Fortran)

integer function iwrtsclalgorithm(istream)
integer istream

Description

Returns a code for the algorithm used when scaling images for display. See IWAlSclAlgorithm and IWScaleImage for more details about the algorithm options. This call was added in the October 1998 release.

Return Value

Returns IW_ERROR (-1) if istream does not to refer to a valid window. Otherwise, returns either IW_SCALING_DONTCARE (0) or IW_SCALING_EXACT (0x1000000 hexadecimal).


IWRtScratchSize

Returns the number of sections a scratch window can contain.

Synopsis (C)

int IWRtScratchSize(int istream);

Synopsis (Fortran)

integer function iwrtscratchsize(istream)
integer istream

Description

A scratch window can contain a finite number of sections. The IMSubs function IMAlSiz or IWAlScratchSize set the maximum number of sections a scratch window may contain.

Return Value

If istream is attached to a valid scratch window, returns the number of z sections allotted to the window. If istream is not attached to a valid scratch window, returns IW_ERROR.


IWRtScrnGeom

Returns the geometry set by IWStart.

Synopsis (C)

int IWRtScrnGeom(int *left, int *bottom, int *width, int *height);

Synopsis (Fortran)

integer function iwrtscrngeom(left, bottom, width, height)
integer left, bottom, width, height

Description

Sets left, bottom, width, height, to the arguments passed to IWStart when the current session was initialized. The IW library does not internally use the arguments to IWStart except to return their values to callers of IWRtScrnGeom.

Return Value

Always returns IW_SUCCESS (1).


IWRtSecMMM

Returns the minimum, maximum, and mean stored for a section.

Synopsis (C)

int IWRtSecMMM(int istream, int isec, float *dmin, float *dmax, float *dmean);

Synopsis (Fortran)

integer function iwrtsecmmm(istream, isec, dmin, dmax, dmean
integer istream, isec
real dmin, dmax, dmean

Description

Image windows are capable of storing a minimum, maximum, and mean value to be associated with a particular section. IWRtSecMMM sets dmin to the minimum value associated with the section isec in the image window attached to istream, dmax to the maximum value associated with that section, and dmean to the mean value associated with that section. Valid values of isec range from zero to the number of sections in the image window minus one. IWRtSecMMM only returns the values associated with the section and does not recalculate them based on the current image data.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and isec is a valid section number for that window; otherwise, returns IW_ERROR (-1).


IWRtSecScl

Returns the current scale values for a section.

Synopsis (C)

int IWRtSecScl(int istream, int isec, float scale[4]);

Synopsis (Fortran)

integer function iwrtsecscl(istream, isec, scale)
integer istream, isec
real scale(4)

Description

The image window scales images using three methods. If an individual section has a scale minimum or maximum are that are different than zero, then the section scale is used. if the section scale has both the minimum and maximum equal to zero, the scaling for the wave that the section is part of is used. If the wave scaling also has a minimum and maximum equal to zero, the minimum and maximum are calculated for a horizontal and vertical slice through the middle of the section and those are used to set the section scale. IWRtSecScl retrieves the section scaling parameters for the section isec (valid values of isec range from 0 to the total number of sections in the image window minus one) in the image window attached to istream. The section scaling parameters are stored in scale as follows:

first element
Is the minimum displayed intensity. Intensities below this value are displayed the same as the minimum intensity.
second element
Is the maximum displayed intensity.
third element
Is the exponent (i.e. gamma) of the scaling function. A linear scaling, which has an exponent of one, is a common case. A scaling relationship which varies as the square root of the intensity would have an exponent of 0.5; a scaling relationship which varies as teh square of the intensity would have an exponent of two.
fourth element
Controls the display of intensities larger than the maximum displayed intensity. If this element is not one, intensities larger than the maximum intensity are displayed the same as the maximum intensity; otherwise, intensities larger than the maximum intensity are displayed the same as the minimum intensity.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and isec is a valid section index for that image window; otherwise, returns IW_ERROR (-1).


IWRtSecThreshold

Returns the recommended threshold level for a particular section.

Synopsis (C)

int IWRtSecThreshold(int istream, int isec, float *threshold);

Synopsis (Fortran)

integer function iwrtsecthreshold(istream, isec, threshold)
integer istream, isec
real threshold

Description

If the window has a recommended threshold level for the section, isec, IWRtSecThreshold stores the threshold level in threshold and returns IW_SUCCESS. If not, IWRtSecThreshold does not modify threshold and returns IW_ERROR. IWRtThreshold is similar, but retrieves the recommended threshold level for a particular wave.

IWRtSecThreshold was added to the IW library in February 2002.


IWRtStepAttr

Returns the current settings for stepping through the sections in an image window.

Synopsis (C)

int IWRtStepAttr(int istream, int iattr[2]);

Synopsis (Fortran)

integer function iwrtstepattr(istream, iattr)
integer istream
integer iattr(2)

Description

The behavior of IWNextImage, IWPrevImage, IWLastImage, and IWFirstImage depends upon the current step direction. IWRtStepAttr returns the step direction and step size for the image window attached to istream. IWRtStepAttr sets the first element of iattr to one of the following values to indicate the step direction:

0
Step through the sections as a linear sequence defined by the interleaving format and the dimensions in z, time, and wave.
1
The step direction is along the z dimension.
2
The step direction is along the time dimension.
3
The step direction is along the wave dimension.

IWRtStepAttr sets the second element of iattr to the step size. Unless configured otherwise by the user, the default is to step one section at a time along the z dimension.

Return Value

Returns IW_SUCCESS (1) if istream is attached to a window; otherwise, returns IW_ERROR (-1).


IWRtThreshold

Returns the recommended threshold level for a particular wave.

Synopsis (C)

int IWRtThreshold(int istream, int wave, float *threshold);

Synopsis (Fortran)

integer function iwrtthreshold(istream, wave, threshold)
integer istream, wave
real threshold

Description

If the window attached to istream has a recommended threshold level for the wave index, wave, IWRtThreshold stores the threshold level in threshold and returns IW_SUCCESS. If not, IWRtThreshold does not modify threshold and returns IW_ERROR. IWRtSecThreshold is similar, but retrieves the recommended threshold level for a particular section.

IWRtThreshold was added to the IW library in February 2002.


IWRtTopDLWin

Returns the most recently displayed image window.

Synopsis (C)

int IWRtTopDLWin(void);

Synopsis (Fortran)

integer function iwrttopdlwin()

Description

A list is kept of all the image windows that are currently displayed. Whenever a new window is displayed or an iconified window is redisplayed, it becomes the top window in the display list.

Return Value

If at least one window is displayed, returns the top window number. Windows are numbered between 1 and the value returned by IWRtMaxWin. If no window is displayed, returns -1.


IWRtTopImgLoc

Returns the number of sections currently in a scratch window.

Synopsis (C)

int IWRtTopImgLoc(int istream, int iwave);

Synopsis (Fortran)

integer iwrttopimgloc(istream, iwave)
integer istream, iwave

Description

A scratch window contains a finite number of sections. The maximum number of sections it can contain is set with the IMSubs function IMAlSiz. The top image location of the scratch window is the next available section number: a value of 5 means sections 0 through 4 are already in the window. Once the maximum number of sections are in the window, the top image location will be equal to the maximum number of section. Writing another section once the image window is full will cause section 0 to be lost, the remaining sections to be pushed down one slot, and the new section to be placed in the highest slot.

Return Value

If istream is attached to scratch window, IWRtTopImgLoc returns a non-negative integer which is the current top image location. Otherwise, returns IW_ERROR (-1).


IWRtWaveGrColor

Returns the current graphic color for a wave.

Synopsis (C)

int IWRtWaveGrColor(int istream, int iwave);

Synopsis (Fortran)

integer function iwrtwavegrcolor(istream, iwave)
integer istream, iwave

Description

The user can set the desired graphics colors for an image window: one color for all waves in pseudocolor and a color for each wave in true color. Any program using the function calls IWRtPsdGrColor, IWRtGrColors, and IWRtColorMode can make use of the user selected colors, use IWRtWaveGrColor as an easy alternative to get the graphics color appropriate for the wave with index iwave and the current color display mode of the image window attached to istream.

Return Value

Returns the graphic color index, a value between zero and IW_NUM_COLORS-1 (11) if istream is positive integer; otherwise, returns IW_ERROR (-1).


IWWinExistState

Returns the form of hardware stereo, if any, in use in an image window.

Synopsis (C)

int IWWinExistState(int istream);

Synopsis (Fortran)

integer function iwwinexiststate(istream)
integer istream

Description

Returns one of the following:

IW_ERROR (-1)
istream is not attached to an image window.
1
istream is attached to an image window which is not currently using hardware stereo.
2
istream is attached to an image window which is currently using split-screen stereo.
3
istream is attached to an image window which is using stereo-in-a-window.

IWRtWinPos

Returns the screen location and size of an image window.

Synopsis (C)

int IWRtWinPos(int istream, int* ixst, int* iyst, int* iwidth, int* iheight);

Synopsis (Fortran)

integer function iwrtwinpos(istream, ixst, iyst, iwidth, iheight)
integer istream
integer ixst, iyst, iwidth, iheight

Description

For the window associated with istream, the coordinates of the lower left corner of the window are returned in ixst and iyst; (0,0) corresponds to the lower left corner of the screen. The width and height, measure in screen coordinates, are returned in iwidth and iheight.


IWRtWID

Returns the window number associated with a stream number.

Synopsis (C)

int IWRtWID(int istream);

Synopsis (Fortran)

integer function iwrtwid(istream)
integer istream

Description

A call to IMOpen associates a window with a stream number. Once IMOpen has been called, most operations on image windows use the stream number. Stream numbers are local to the application; window numbers are global.

If istream is attached to an image window, IWRtWID returns the window number, a positive integer, for that window. If istream is zero or is a valid stream number but is not attached to an image window, IWRtWID returns zero. If istream is negative, IWRtWID returns -1.


IWRtZoom

Returns the current zoom factor for a window.

Synopsis (C)

float IWRtZoom(int istream);

Synopsis (Fortran)

real function iwrtzoom(istream)
integer istream

Description

If istream is attached to a valid window, IWRtZoom returns the zoom factor of that window; otherwise, returns IW_ERROR (-1).


IWRtZWTMMM

Returns the minimum, maximum, and mean stored for a section specified by its z, wave, and time indices.

Synopsis (C)

int IWRtZWTMMM(int istream, int iz, int iw, int it, float *dmin, float *dmax, float *dmean);

Synopsis (Fortran)

integer function iwrtzwtmmm(istream, iz, iw, it, dmin, dmax, dmean)
integer istream, iz, iw, it
real dmin, dmax, dmean

Description

Is the same as IWRtSecMMM, but the section is specified by its z index, iz, wave index, iw, and time index, it rather than the section's position in the stack.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window and iz, iw, and it are valid indices for that window; otherwise, returns IW_ERROR (-1).


Shared Memory - "IW*SHM"


IWAlcNamedSHM

Allocates space in shared memory and associate this memory with a name so that it can be accessed by other programs.

Synopsis (C)

void* IWAlcNamedSHM(int nelem, int size, const char *name);

Synopsis (Fortran)

pointer_type function iwalcnamedshm(nelem, size, name)
integer nelem, size
character*(*) name

Description

Allocates space for nelem contiguous items where each item is size bytes in size and then assigns the allocated space the name, name. Others can look up the block of memory by its name using IWRtNamedSHMAdd.

Return Value

Returns the address of the allocated memory if successful or zero if not successful. When the allocated memory is no longer needed, call IWFreeNamedSHM with the address returned by IWAlcNamedSHM.


IWAlcSHM

Allocates shared memory dynamically.

Synopsis (C)

void* IWAlcSHM(int nelem, int size);

Synopsis (Fortran)

pointer_type function iwalcshm(nelem, size)
integer nelem, size

Description

Allocates space for nelem contiguous items where each item is size bytes in size. One would use this call instead of IWAlcNamedSHM when a name has already been associated with the top of a list of pointers or a structure containing pointers, and now the memory needs to be allocated for what those pointers will point to.

Return Value

Returns the address of the allocated memory if successful or zero if not successful. When the allocated memory is no longer needed, call IWFreeSHM with the address returned by IWAlcSHM.


IWFreeNamedSHM

Frees memory allocated by IWAlcNamedSHM.

Synopsis (C)

void IWFreeNamedSHM(void *ptr);

Synopsis (Fortran)

subroutine iwfreenamedshm(ptr)
pointer_type ptr

Description

Given a pointer, ptr, previously returned by IWAlcNamedSHM, releases the memory pointed to by ptr.


IWFreeSHM

Frees memory allocated by IWAlcSHM or IWRealcSHM.

Synopsis (C)

void IWFreeSHM(void *ptr);

Synopsis (Fortran)

subroutine iwfreeshm(ptr)
pointer_type ptr

Description

Given a pointer, ptr, previously returned by IWAlcSHM or IWRealcSHM, releases the memory pointed to by ptr.


IWRealcSHM

Changes the size of a block of memory previously allocated by IWAlcSHM or IWRealcSHM.

Synopsis (C)

void *IWRealcSHM(void *ptr, int size);

Synopsis (Fortran)

pointer_type iwrealcshm(ptr, size)
pointer_type ptr
integer size

Description

When the size requirement changes for some memory space you have already allocated with IWAlcSHM or IWRealcSHM, use IWRealcSHM to reallocate the block while preserving the contents up to the smaller of the currently allocated size and the new size. ptr must be a value returned by a previous call to IWAlcSHM or IWRealcSHM. size is the requested size, in bytes, for the reallocated block.

Return Value

Returns the address of the reallocated block if successful. That block should be freed with IWFreeSHM. If IWRealc fails, it returns zero and the contents of the block pointed to by ptr remain as they were.


IWRtNamedSHMAdd

Returns the memory address associated with a name.

Synopsis (C)

void* IWRtNamedSHMAdd(const char *name);

Synopsis (Fortran)

pointer_type iwrtnamedshmadd(name)
character*(*) name

Description

Returns the pointer to the block of memory associated with the name name. In conjunction with IWAlcNamedSHM, IWRtNamedSHMAdd allows multiple programs to share data using well-known names.

Return Value

Returns the address of the block of memory if successful or zero if name does not have an associated block of memory.


IWEncodeSHMPtr

Encodes a pointer to shared memory so another process can interpret it.

Synopsis (C)

IWEncodedSHMPtr IWEncodeSHMPtr(void* ptr);

Description

Because the shared memory segment may not be mapped into the same location for all processes, the values of pointers to shared memory locations can not be meaningfully exchanged with the other processes attached to the same shared memory segment. IWEncodeSHMPtr converts a pointer, ptr, to the shared memory segment into a value that can be passed to another process. The other process would use IWDecodeSHMPtr to convert the encoded value back into a pointer. The encoded value of the pointer will be an unsigned integral value of the type IWEncodedSHMPtr.

IWEncodeSHMPtr is a new function in IVE 4.


IWDecodeSHMPtr

Converts an encoded pointer value into a pointer.

Synopsis (C)

void* IWDecodeSHMPtr(IWEncodedSHMPtr encoded_ptr);

Description

Convert, encoded_ptr, which is presumed to be the result of a previous call to IWEncodeSHMPtr, into a pointer.

IWDecodeSHMPtr is a new function in IVE 4.


X Windows Related Functions


IWXEvtToData

Returns the x, y, z, and, time point coordinates given an X key or mouse event.

Synopsis (C)

int IWXEvtToData(int istream, int iw, XEvent* event, float xyz[3], int *itime);

Synopsis (Fortran)

integer function iwxevttodata(istream, iw, event, xyz, itime)
integer istream, iw
dummy_type event
real xyz(3)
integer itime

Description

Given an X key or mouse event, event, from an image window, the stream number, istream, attached to that image window, and the index of the wave of interest, iwave, IWXEvtToData computes the position of the event in data coordinates. It sets the three elements of xyz to be the x, y, and z data coordinates, respectively, of the event and sets *itime to be the time point index.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWXEvtToKeySym

Returns key symbol from a key press or key release X event.

Synopsis (C)

int IWXEvtToKeySym(XEvent* event);

Synopsis (Fortran)

integer function iwxevttokeysym(event)
dummy_type event

Description

Returns the X keysym for the X event, event. event must be a KeyPress or KeyRelease event.


IWXEvtToStream

Returns the stream number associated with an X event.

Synopsis (C)

int IWXEvtToStream(XEvent* event);

Synopsis (Fortran)

integer iwxevttostream(event)
dummy_type event

Description

Given an X event event, returns zero if the event did not come from an image window or the number, a positive integer, of the stream attached to the originating image window if the event came from an image window.


IWXEvtToWid

Returns the number of the image window that sent an event.

Synopsis (C)

int IWXEvtToWid(XEvent* event);

Synopsis (Fortran)

integer function iwxevttowid(event)
dummy_type event

Description

Given an X event event, returns zero if the event did not come from an image window or the window number, a positive integer, if the event came from an image window.


IWGetAppXDisplay

Synopsis

Display *IWGetAppXDisplay();


IWSetAppXDisplay

Synopsis

void IWSetAppXDisplay(Display *disp_id);


Window Control


IWAttachFile

Attaches a window to a file in Viewfile mode.

Synopsis (C)

int IWAttachFile(int istream, const char *file);

Synopsis (Fortran)

integer function iwattachfile(istream, file)
integer istream
character*(*) file

Description

When you use IWAttachFile to link the image file on disk, file, to the window attached to istream, the sections of data are read into memory from the file when the user moves to the section. Data is not loaded into the window until it needs to be viewed.

The typical steps to use IWAttachFile are:

  1. Open the image file on disk with IMOpen and read its header with IMRdHdr.
  2. Open an image window using either IMOpen or IWAttachWin; use "new" for the mode argument in either case.
  3. Transfer the header from the input file to the image window with IMTrHdr.
  4. Call IWAttachFile.
  5. Call IWAlFilename to set the file name associated with the image window.
  6. Call IMClose on the input or the image window if you no longer need to access them.

Return Value

Returns IW_SUCCESS (1) if the image window could be attached to the file; otherwise, returns IW_ERROR (-1).


IWAttachWin

Opens a stream to an image window.

Synopsis (C)

int IWAttachWin(int istream, int iwin, const char *status);

Synopsis (Fortran)

integer function iwattachwin(istream, iwin, status)
integer istream, iwin
character*(*) status

Description

Opens image window number iwin and attaches it to stream number istream. Use one the following status strings:

ro
Opens an existing image window for reading only.
new
Creates a new image window, or if the image window already exists, overwrites its contents.
old
Open an existing image window for reading and writing.
scratch
Creates a new scratch window, or if the image window already exists, overwrites its contents and converts it to a scratch window.

Return Value

If successful, returns IW_SUCCESS (1). If the image window could not be opened, returns IW_ERROR (-1).


IWBgnFastGr

Creates a copy of the image and graphics currently displayed for fast redraw later with IWDisFastGr.

Synopsis (C)

int IWBgnFastGr(int istream);

Synopsis (Fortran)

integer function iwbgnfastgr(istream)
integer istream

Description

On systems where overlay planes are not available ( i.e. when IWRtNumOVColors returns 0), IWBgnFastGr, IWDisFastGr, and IWEndFastGr are an alternative mechanism to improve responsiveness when changes are made to the graphics displayed on top of an image. A prototypical case is an application which changes a graphic as the mouse is dragged across the image.

IWBgnFastGr creates a copy of the images and graphics currently displayed in the window. This copy can be redisplayed more quickly than forcing an window redraw with IWDisplay. Here is a recipe for the use of IWBgnFastGr and the related calls in the case where an application must update graphics when a mouse button is held down and the mouse is dragged across the image:

  1. When the mouse button is pressed, call IWBgnFastGr to make a copy of the current window contents.
  2. In response to mouse motion while the button is down, remove the old graphics (if any), call IWDisFastGr to restore the display, make the calls to create the new graphics, and then cause them to be displayed with calls to IWGrDisGrID or IWGrDisGrList.
  3. When the mouse button is release, call IWEndFastGr to free the memory associated with the copy of the window contents and IWDisplay to refresh the display.

Return Value

Always returns IW_SUCCESS (1).


IWClearWin

Clears the normal planes of an image window.

Synopsis (C)

int IWClearWin(int istream);

Synopsis (Fortran)

integer function iwclearwin(istream)
integer istream

Description

Causes the normal planes of the image window attached istream to be filled with the background color; anything currently in the overlay planes is not cleared. The effect is temporary: any enabled images or added graphics will reappear if something causes a full redraw of the image window.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWClrScr

Sets the top image location to zero for a scratch window.

Synopsis (C)

int IWClrScr(int istream);

Synopsis (Fortran)

integer function iwclrscr(istream)
integer istream

Description

If istream is attached to a scratch window, sets the top image location, the position where the next section will be written, to zero for all waves in the scratch window. Returns IW_SUCCESS (1) if istream is attached to a window or IW_ERROR (-1) if istream is invalid or is not attached to a window.


IWCopyPartialData

Synopsis

int IWCopyPartialData(void *source,int width,int height,int mode, int xst,int new_width,int yst,int new_height,void *destination, int destination_stride);


IWDataToDVPos

Converts data coordinates to real space coordinates.

Synopsis (C)

int IWDataToDVPos(int istream, float ind_x, float ind_y, float ind_z, float rtn_pos[3]);

Synopsis (Fortran)

integer function iwdatatodvpos(istream, ind_x, ind_y, ind_z, rtn_pos)
real istream, ind_x, ind_y, ind_z
real rtn_pos(3)

Description

Converts a single data coordinate triple (ind_x, ind_y, ind_z) to the corresponding real space coordinates (the three elements of rtn_pos which, in order of appearance, are the real space x, y, and z coordinates). The conversion uses the geometry specified by the header of the data set attached to istream.

The data coordinate system for a data set has its origin at the lower left corner of the first z section of the data set (an x value of zero is the left edge; a y value of zero is the bottom edge; and a z value of zero on the first z section). The right edge of the data set in data coordinates is at nx, the top edge of the data set in data coordinates is at ny, and a point on the top z section has a z data coordinate of nz. nx, ny, and nz are the x, y, and z dimensions, in pixels, of the data set. The relationship between the data coordinate system and the real coordinate system is set by the origin, pixel spacing, and tilt angles stored in the data set's header.

Return Value

Returns IW_SUCCESS (1) if istream is attached to a image window; otherwise, returns IW_ERROR (-1).


IWDataToWin

Converts a list of data coordinates to window coordinates.

Synopsis (C)

int IWDataToWin(int istream, int iwave, int iwinpos[], const int idatapos[], int npoint);

Synopsis (Fortran)

integer function iwdatatowin(istream, iwave, iwinpos, idatapos, npoint)
integer istream, iwave, npoint
integer idatapos(2 * npoint)
integer iwinpos(2 * npoint)

Description

Converts npoint sets of data coordinates into window coordinates. Window coordinates range from (0,0) in the lower left corner of the image display area to (width-1,height-1) in the upper right corner, where width and height are the dimensions of the image display are (you can use IWRtDisArea to find the values of width and height). Data coordinates are the x and y indices into the image data; data coordinates which map to valid data locations range from (0,0) to (nx-1,ny-1) where nx and ny are the dimensions of a section of data.

IWDataToWin reads the data coordinates from idatapos, a 2 * npoint element array where the first and second elements of the array form one x and y data coordinate pair, the third and fourth elements another data coordinate pair, and so on. IWDataToWin stores the converted coordinates in iwinpos, another 2 * npoint element array. The first two elements of iwinpos will contain the x and y data coordinates corresponding to the first two elements of idatapos, the next two elements of iwinpos will contain the x and y data coordinates for the third and fourth elements of idatapos, and so on. iwave is the zero-based index for the wave to use when converting (translations of the images may depend on the wave so it is necessary to specify it).

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWClearOverlay

Clears the overlay planes of an image window.

Synopsis (C)

int IWClearOverlay(int istream);

Synopsis (Fortran)

integer function iwclearoverlay(istream)
integer istream

Description

Causes the overlay planes of the image window attached to istream to be erased; the normal planes of the image window are not affected. The effect is temporary: if overlay graphics are still in use (a call to IWStartOverlay has been made without a matching call to IWEndOverlay), any redraw of graphics associated with the image window will put those graphics in the overlay planes.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWStartOverlay

Turns on overlay graphics and sets the color used for drawing in the overlay planes.

Synopsis (C)

int IWStartOverlay(int istream, int icolor);

Synopsis (Fortran)

integer function iwstartoverlay(istream, icolor)
integer istream, icolor

Description

After calling IWStartOverlay, any operation to draw graphics on the image window attached to istream will draw the graphics in the overlay planes using the colors index icolor (valid values of icolor range from 1 to the value returned by IWRtNumOVColors minus one). The overlay planes allow for faster drawing of a graphic or graphics that you want to update constantly since it is only necessary to clear the overlay plane and redraw the graphics that were in the overlay plane to change a graphic. If the graphic was in the normal planes, a change would require redrawing the image and all graphics. The overlay planes may not be available, and in that case, IWStartOverlay has no effect. To test whether or not the overlay planes are available use IWRtNumOVColors.

Return Value

Returns IW_ERROR (-1) if istream is not valid; otherwise, returns IW_SUCCESS (1).


IWEndOverlay

Turns off overlay graphics.

Synopsis (C)

int IWEndOverlay(int istream);

Synopsis (Fortran)

integer function iwendoverlay(istream)
integer istream

Description

After calling IWEndOverlay, any operation to draw graphics on the image window attached to istream will draw the graphics in the normal planes. In the normal planes, changing an existing graphic requires a redraw of the image and all graphics in order to correctly display the change.

Return Value

Returns IW_ERROR (-1) if istream is not valid; otherwise, returns IW_SUCCESS (1).


IWFileExist

Tests if a file name is already in use.

Synopsis (C)

int IWFileExist(char *filename);

Synopsis (Fortran)

integer function iwfileexist(filename)
character*(*) filename

Description

If a file named filename exists, IWFileExist returns zero. If filename is a number and that window number exists, IWFileExist returns the window number. Otherwise, returns -1.


IWFirstImage

Steps to the first section in a wave.

Synopsis (C)

int IWFirstImage(int istream, int iwave);

Synopsis (Fortran)

integer function iwfirstimage(istream, iwave)
integer istream, iwave

Description

IWFirstImage changes the current section in the wavelength with index iwave. The effects of this call depend on the step direction (see IWRtStepAttr and IWAlStepAttr). If stepping in the z direction, sets the z index for the current section to zero. If stepping in the time direction, sets the time index for the current section is to zero. If stepping in the section index (how the sections are arranged in the file), sets both the z and time indices for the current section to zero. If stepping in the wave dimension, does nothing and prints an error message. If the current section in different waves is synchronized (see IWRtDisSyncMode and IWAlDisSyncMode), then the current section in all other waves will be similarly affected. IWFirstImage does not force the image window to be redrawn.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an existing image window and the wave index, iwave, is valid for that image window; otherwise, returns IW_ERROR (-1).

Bugs

When the step direction is along the wave dimension, should return IW_ERROR and not print a diagnostic message.


IWFirstSec

Steps to the first section and displays it.

Synopsis (C)

int IWFirstSec(int istream);

Synopsis (Fortran)

integer function IWFirstSec(istream)
integer istream

Description

IWFirstSec is the same as IWFirstImage with the following differences:

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWGetButPressInfo

Returns image window number and position of a button press event.

Synopsis (C)

int IWGetButPressInfo(XEvent* event, int* wid, float xyz[3], int* w, int* t);

Synopsis (Fortran)

integer function iwgetbutpressinfo(event, wid, xyz, w, t)
dummy_type event
integer wid, w, t
real xyz(3)

Description

If event is an X key or mouse event from an image window, sets wid to the window number of that image window, w to the current wave for that image window, the three elements of xyz to the x, y, and z data coordinates corresponding to the position of the event, and t to the time point index in which the event occurred.

Return Value

Returns one if event is an X event from an image window; otherwise, returns zero.


IWDecZoom

Decrements the zoom factor for image display in a window.

Synopsis (C)

int IWDecZoom(int istream);

Synopsis (Fortran)

integer function iwdeczoom(istream)
integer istream

Description

If the current zoom factor for the image window attached to istream is an integer, n, greater than two, IWDecZoom changes the zoom factor to be n - 1. If the current zoom factor for the image window is 1/n where n is a positive integer, IWDecZoom changes the zoom factor to be 1/(n+1). Internally, zoom factors are not allowed to go below 1/32.

Return Value

Returns IW_SUCCESS (1) if istream to an image window; otherwise, returns IW_ERROR (-1).


IWDeleteWin

Removes an image window.

Synopsis (C)

int IWDeleteWin(int istream, int mode);

Synopsis (Fortran)

integer function iwdeletewin(istream, mode)
integer istream, mode

Description

Removes the image window associated with istream. If the mode is not zero, then completely removes the image window. If mode is zero, the image data stored in the window is erased but the window remains as if you had called IMOpen(..., "new").

Return Value

Always returns zero.


IWDisFastGr

Replaces what an image window displays with the contents copied by a previous call to IWBgnFastGr.

Synopsis (C)

int IWDisFastGr(int istream);

Synopsis (Fortran)

integer function iwdisfastgr(istream)
integer istream

Description

The description of IWBgnFastGr describes how to use this call and IWEndFastGr as an alternative mechanism for fast updates of graphics drawn on an image.

Return Value

Always returns IW_SUCCESS (1).


IWDisplay

Requests that an image window redraw its contents.

Synopsis (C)

int IWDisplay(int istream);

Synopsis (FORTRAN

integer function iwdisplay(istream)
integer istream

Description

Requests that the image window attached to istream redraw the images and any associated graphics. Whenever you want any modifications to the image window, such as zoom, currently displayed section, scaling, or added graphics, to be visible, call IWDisplay. If you are only adding graphics (or exactly overwriting an existing graphic but with a different color), then there are other functions (IWGrDisGrID and IWGrDisGrList) which will update the display without the overhead of redrawing everything.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWDLDecZoom

Decrements the zoom factor for all displayed windows.

Synopsis (C)

int IWDLDecZoom(void);

Synopsis (Fortran)

integer function iwdldeczoom()


IWDLFirstSec

Causes all displayed windows to display the first section.

Synopsis (C)

int IWDLFirstSec(void);

Synopsis (Fortran)

integer function iwdlfirstsec()


IWDLIncZoom

Increments zoom factor for all displayed windows.

Synopsis (C)

int IWDLIncZoom(void);

Synopsis (Fortran)

integer function iwdlinczoom()


IWDLLastSec

Causes all displayed windows to display the last section.

Synopsis (C)

int IWDLLastSec(void);

Synopsis (Fortran)

integer function iwlastsec()


IWDLNextSec

Causes all displayed windows to display the next section.

Synopsis (C)

int IWDLNextSec(void);

Synopsis (Fortran)

integer function iwdlnextsec()


IWDLPrevSec

Causes all displayed windows to display the last section.

Synopsis (C)

int IWDLPrevSec(void);

Synopsis (Fortran)

integer function iwdlprevsec()


IWEndFastGr

Frees the copy of the window contents created by IWBgnFastGr.

Synopsis (C)

int IWEndFastGr(int istream);

Synopsis (Fortran)

integer function iwendfastgr(istream)
integer istream.

Description

The description of IWBgnFastGr describes how to use this call and IWDisFastGr as an alternative mechanisms for fast updates of graphics drawn on an image.


IWIncZoom

Increments the zoom factor for image display in a window.

Synopsis (C)

int IWIncZoom(int istream);

Synopsis (Fortran)

integer function iwinczoom(istream)
integer istream

Description

If the current zoom factor for the image window attached to istream is a positive integer, n, IWIncZoom changes the zoom factor to be n + 1. If the current zoom factor for the image window is 1/n where n is a positive integer greater than one, IWIncZoom changes the zoom factor to be 1/(n-1). Internally, zoom factors are not allowed to exceed 32.

Return Value

Returns IW_SUCCESS (1) if istream to an image window; otherwise, returns IW_ERROR (-1).


IWLastImage

Steps to the last section in a wave.

Synopsis (C)

int IWLastImage(int istream, int iwave);

Synopsis (Fortran)

integer iwlastimage(istream, iwave)
integer istream, iwave

Description

IWLastImage changes the current section in the wavelength with index iwave. The effects of this call depend on the step direction (see IWRtStepAttr and IWAlStepAttr). If stepping in the z direction, sets the z index for the current section to the number of z sections minus one. If stepping in the time direction, sets the time index for the current section to number of time points minus one. If stepping in the section index (how the sections are arranged in the file), sets the z index for the current section to the number of z sections minus one and the time index to the number of time points minus one. If stepping in the wave dimension, does nothing and prints an error message. If the current section in different waves is synchronized (see IWRtDisSyncMode and IWAlDisSyncMode), then the current section in all other wavelengths will be similarly affected. IWLastImage does not force the image window to be redrawn.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an existing image window and the given wave index, iwave, is valid for that image window; otherwise, returns IW_ERROR (-1)

Bugs

When the step direction is in wavelength, IW_ERROR should be returned and no message printed.


IWLastSec

Steps to the last section and displays it.

Synopsis (C)

int IWLastSec(int istream);

Synopsis (Fortran)

integer function iwlastsec(istream)
integer istream

Description

IWLastSec is the same as IWLastImage with the following differences:

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWLockSec_ZWT

Prevents a section (specified by its z, wave, and time indices) of image data from being swapped out while an application directly accesses the data.

Synopsis (C)

char *IWLockSec_ZWT(int istream, int iz, int iw, int it);

Synopsis (Fortran)

pointer_type function iwlocksec_zwt(istream, iz, iw, it)
integer istream, iz, iw, it

Description

Returns a pointer to a section of data in a data stack and flags that data as in use so that it is not removed from active memory by the library's memory management routines. IWUnlockSec_ZWT should be called when the data referenced by the pointer is no longer needed. This routine provides a lightweight alternative to obtaining a section of data with IMRdSec. No copying or translation of the data occurs so it is in the format indicated by IMRdHdr.

Return Value

Returns a pointer to the first element in the section if istream is attached to an image window and it was possible to load the section into memory. Otherwise, returns zero.

In FORTRAN, the type returned by the function is an integer which has the same size as a pointer in C (i.e. an integer*4 on 32-bit systems and an integer*8 on 64-bit systems).


IWLockSec

Prevents a section (specified by its position in the section list) of image data from being swapped out while an application directly accesses the data.

Synopsis (C)

char *IWLockSec(int istream, int iz);

Synopsis (Fortran)

pointer_type function iwlocksec(istream, iz)
integer istream, iz

Description

Is the same as IWLockSec_ZWT except the section desired is specified by its zero-based index in the stack rather than its z, wave, and time indices. The partner function for IWLockSec is IWUnlockSec.


IWLowerWin

A function by this name is present in the library but currently does nothing useful.

Synopsis (C)

int IWLowerWin(int istream);

Synopsis (Fortran)

integer function iwlowerwin(istream)
integer istream

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWMapWin

Uniconifies an image window.

Synopsis (C)

int IWMapWin(int istream);

Synopsis (Fortran)

integer iwmapwin(istream)
integer istream

Description

If istream is attached to an iconified image window, IWMapWin causes that window to return to its normal (fully visible) state.

Return Value

Returns IW_SUCCESS if stream is attached to a window and that window is iconified.

Returns IW_ERROR in all other cases.


IWNextImage

Increments the current section.

Synopsis

int IWNextImage(int istream, int iwave, int inc);

Description

Given the current step direction for the window (see IWRtStepAttr and IWAlStepAttr), IWNextImage adds inc sections to the position of the current section for the wavelength with index iwave and makes that the new current section for that wavelength. If incrementing would move the current section before the beginning or past the end, sets the current section to the beginning or the end, respectively. If the step direction is in the wave dimension, does nothing and prints an error message.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an existing image window and the wave index, iwave, is valid for that image window; otherwise, returns IW_ERROR (-1).

Bugs

When the step direction is along the wave dimension, should return IW_ERROR and not print a diagnostic message.


IWNextSec

Steps to the next section and displays it.

Synopsis (C)

int IWNextSec(int istream);

Synopsis (Fortran)

integer function iwnextsec(istream)
integer istream

Description

Causes the next section to be displayed in the image window. The next section depends on the current section displayed (see IWRtDisSec_ZWT) and the step attributes (see IWRtStepAttr and IWAlStepAttr).

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWPopMemList

Decreases the likelihood that the image data for a window will be swapped out.

Synopsis (C)

int IWPopMemList(int istream);

Synopsis (Fortran)

integer function iwpopmemlist(istream)
integer istream

Description

The memory manager maintains a list of blocks that it sequentially searches if it is necessary to evict some blocks in order to make room for others. For the image window attached to istream, IWPopMemList places the blocks holding that window's data at the end of the memory manager's list so that is less likely to be swapped out and, therefore, somewhat quicker to access.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWPrevImage

Decrements the current section.

Synopsis (C)

int IWPrevImage(int istream, int iwave, int inc);

Synopsis (Fortran)

integer function iwprevimage(istream, iwave, inc)
integer istream, iwave, inc

Description

A call to IWPrevImage has the same effect as a call to IWNextImage with inc negated.

Return Value

Returns IW_SUCCESS (1) if istream is attached to an existing image window and the given wave index, iwave, is valid for that image window; otherwise returns IW_ERROR (-1).

Bugs

When the step direction is along the wave dimension, should return IW_ERROR and not print a diagnostic message.


IWPrevSec

Steps to the previous section and displays it.

Synopsis (C)

int IWPrevSec(int istream);

Synopsis (Fortran)

Description

Causes the previous section to be displayed in the image window. The previous section depends on the current section displayed (see IWRtDisSec_ZWT) and the step attributes (see IWRtStepAttr and IWAlStepAttr).

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWRaiseWin

A function by this name is present in the library but currently does nothing useful.

Synopsis (C)

int IWRaiseWin(int istream);

Synopsis (Fortran)

integer iwraisewin(istream)
integer istream

Return Value

Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWRegDisChg

Synopsis

int IWRegDisChg(int istream, int ixwin);


IWRegEvt

Synopsis

int IWRegEvt(int istream, int ixwin, int mask);


IWRetBaseDirectory

Returns the name of the directory where IVE is installed.

Synopsis (C)

int IWRetBaseDirectory(char *string_ptr);

Synopsis (Fortran)

subroutine iwretbasedirectory(str)
character*(*) str

Description

Copies the full pathname of the top-level directory for the IVE distribution into the string argument. The string is terminated with a null in C, and padded as necessary with blanks in FORTRAN. In C, there is no checking that the size of the string argument is sufficient; in FORTRAN, if the length of the name exceeds the length of the string, the string argument is filled with spaces. The name of the directory is determined from the IVE_BASE environment variable or a fallback mechanism if that variable is not set; no check is actually done to see if a directory with the returned name actually exists.

Return Value

In C, IWRetBaseDirectory always returns IW_SUCCESS; in Fortran, there is no return value.


IWRetBinDirectory

Returns the name of the directory where IVE executables are stored.

Synopsis (C)

const char* IWRetBinDirectory(void);

Synopsis (Fortran)

subroutine iwretbindirectory(str)
character*(*) str

Description

Returns the full pathname to the directory containing the IVE distribution executables. In C, returns the name as a pointer to static storage which is terminated with a null character. The region pointed can be invalidated by subsequent calls to putenv or other modifications of the environment. In Fortran, the copies the name to the argument, str and pads it with blanks as necessary. If the name is too long to fit in str, IWRetBinDirectory fills str with blanks. For both languages, determines the name of the directory from the IVE_EXE environment variable or a fallback mechanism if that variable is not set; IWRetBinDirectory does not check if a directory with the returned name actually exists.


IWRetSHMDirectory

Returns the name of the directory where shared memory files are stored.

Synopsis (C)

int IWRetSHMDirectory(char* string_ptr);

Synopsis (Fortran)

integer function iwretshmdirectory(string_ptr)
character*(*) string_ptr

Description

Fills string_ptr with the name of the directory where the memory manager stores shared memory files.

Return Value

Always returns IW_SUCCESS (1).


IWRetVersion

Returns the name of the version of the IW library in use.

Synopsis (C)

const char* IWRetVersion(void);

Synopsis (Fortran)

subroutine iwretversion(str)
character*(*) str

Description

In C, returns the version name of the library as a pointer to static storage which is terminated by a null character. In Fortran, copies the version name of the library to the argument str and pads it with blanks as necessary. If the name is too long to fit in str, fills str with blanks,


Utility Functions


IWAllocTrueColor

Synopsis (C)

int IWAllocTrueColor(int istream, int icolor[IW_NUM_COLORS]);

Synopsis (Fortran)

integer iwalloctruecolor(istream, icolor)
integer istream
integer icolor(12)


IWCaptureImage

Creates a copy of what is shown in an image window.

Synopsis (C)

int IWCaptureImage(int istream, int ix, int iy, int width, int height, int buffers, int format, int type, int scan_size, void* pixels);

Synopsis (Fortran)

integer function iwcaptureimage(istream, ix, iy, width, height, buffers, format, type, scan_size, pixels)
integer istream, ix, iy, width, height, buffers, format, type, scan_size
application-specific type pixels

Description

Copies a portion of the image display attached to istream into the array, pixels. The portion of the display copied has its lower corner at (ix, iy) ((0, 0) is the lower left corner of the image display and (nx - 1, ny - 1) is the upper right corner where nx and ny are the width and height reported by IWRtDisArea). buffers specifies which image buffers are read; it must be a bitwise-or (or simple addition in Fortran) of one or more of the following:

IW_LEFT_IMAGE (1)
Reads the left buffer (i.e. what is shown to the left eye when quadbuffered stereo is in use).
IW_RIGHT_IMAGE (2)
Reads the right buffer (i.e. what is shown to the right eye when quadbuffered stereo is in use).
IW_NORMAL_IMAGE (3)
Reads the both the left and right buffers; it is a synonym for IW_LEFT_IMAGE | IW_RIGHT_IMAGE. This would be the setting to use to capture an image displayed without quadbuffered stereo enabled.

format specifies the format that should be used for each pixel. It must be one of the following:

IW_RGBA_PIXEL (0)
Each pixel has four components which are, in order of appearance: red, green, blue, alpha.
IW_LUMINANCE_PIXEL (1)
Each pixel has a single component which is the weighted sum of the red, green, and blue components (29.9% red, 58.7% green, and 11.4% blue).

type specifies the data type used for the components of each pixel (for instance, an RGBA pixel has four components and a luminance pixel one). It must be one of the following:

IW_BYTE (0)
Each component is an unsigned 8-bit quantity with a range of 0 to 255 inclusive.

pixels is the destination for the copy operation; it must have space for height contiguously packed lines with scan_size pixels per line. The space needed for each pixel is either:

The copy operation affects the first width pixels in each line of pixels; the remainder are unaffected.

Return value

Returns IW_SUCCESS if the copy operation was successful. Returns IW_ERROR in the following cases:

Limitations

Currently does not support capturing the contents of the overlay plane; this could be added by an additional constants for buffers.


IWInitFPSCounters

Initializes counters for use with IWMeasureFPS.

Synopsis (C)

int IWInitFPSCounters(int istream, unsigned int* p_frame_counter, double* p_time_pt);

Synopsis (Fortran)

integer function iwinitfpscounters(istream, frame_counter, time_pt)
integer istream, frame_counter
double precision time_pt

Description

Initializes frame_counter and time_pt (*p_frame_counter and *p_time_pt in C) for use in a subsequent call to IWMeasureFPS. The contents of frame_counter and time_pt are not intended to be directly meaningful to the application; instead they encode the conditions at the time of the call to IWInitFPSCounters and when passed later to IWMeasureFPS the average number of redraws per second since that time is determined. The IWInitFPSCounters call was added in the November 2001 release of Priism 3.3.

Return value

Returns IW_ERROR (-1) if istream is not attached to a window; otherwise, returns IW_SUCCESS (1).


IWMeasureFPS

Returns the number of images drawn per second since a time point established by IWInitFPSCounters.

Synopsis (C)

int IWMeasureFPS(int istream, unsigned int frame_counter, double time_pt, double* p_fps, double* p_intvl_s);

Synopsis (Fortran)

integer function iwmeasurefps(istream, frame_counter, time_pt, fps, intvl_s)
integer istream, frame_counter
double precision time_pt
double precision fps, intvl_s

Description

Given a time point established by IWInitFPSCounters, returns the number of redraws per second since that time and the time elapsed. The time point is given by the input arguments frame_counter and time_pt. For a valid measurement these must have been initialized with IWInitFPSCounters on the same stream. Returns the average number of redraws per second since that time point in fps (*p_fps in C), and returns the elapsed time in seconds in intvl_s (*p_intvl_s in C). The IWMeasureFPS call was added in the November 2001 release of Priism 3.3.

Return value

Returns IW_ERROR (-1) if istream is not attached to a window; otherwise, returns IW_SUCCESS (1).


IWSaveImage

Saves the data stored in an image window to a file.

Synopsis (C)

int IWSaveImage(int istream, const char *f_name);

Synopsis (Fortran)

integer iwsaveimage(istream, f_name)
integer istream
character*(*) f_name

Description

Saves the data (header, extended header, and image data) in the image window attached istream as a modified MRC format file named f_name. Returns IW_SUCCESS (1) if successful, and IW_ERROR (-1) if not.


IWScaleImage

Scales the intensities in a 2D image to fall within the pseudocolor display range.

Synopsis (C)

int IWScaleImage(void *source_addr, const int xy[2], int mode, const float scl[4], IW_BYTE_MEM_PTR dest_addr);

Synopsis (Fortran)

integer function IWScaleImage(source_addr, xy, mode, scl, dest_addr)
integer xy(2), mode
real scale(4)
application-specific type source_addr
byte dest_addr(*)

Description

Scales each element of the image pointed to by source_addr to fall in a range representable by a byte. Pass the size of the x dimension (fastest varying) of the image as the first component of xy and the size fo the y dimension of the image as the second component of xy. IWScaleImage stores the result of the scaling in the location pointed to by dest_addr. The possible range of output values depends on the graphics hardware and Priism startup parameters. To determine the range of output values, use IWRtSclMinMax. Assuming that the possible output range is [rmin, rmax] and scl[1] is greater than scl[0], the formula for the result, r, given an input value, i, is

  r = rmin + (rmax - rmin) * ((i - scl[0]) / (scl[1] - scl[0])) ^ scl[2]
                     if i >= scl[0] and i <= scl[1]
  r = rmin           if i < scl[0]
  r = rmax           if scl[3] is not 1.0 and either i > scl[1] or
                     i is invalid
  r = rmin           if scl[3] is 1.0 and either i > scl[1] or
                     i is invalid

When scl[1] is less than scl[0] then the scaled result is essentially the negative image of the form given above (switch the roles of scl[0] and scl[1] in the formulas above to calculate r; then r', the scaled value when scl[1] is less than scl[0], is rmin + (rmax - r)).

When scl[1] is equal to scl[0], values less than or equal to scl[0] are mapped to rmin; values greater than scl[0] or invalid values are mapped to rmax is scl[3] is not 1.0 and mapped to rmin if scl[3] is 1.0

In applying these equations, if the values in scl are unreasonable, reasonable values are silently substituted. If either scl[1] or scl[0] is not a number (NaN), 0 and 4096 are used instead. Also, if scl[2] is less than or equal to 0, 1 is used in its place.

The mode argument specifies the data type of the input image and type-dependent scaling options. It is the bitwise or (or simple addition in Fortran) of up to three quantities. One of these quantities specifies the type and can be IW_BYTE (0), IW_SHORT (1), IW_USHORT (6), IW_LONG (7), IW_FLOAT (2), IW_COMPLEX_SHORT (3), or IW_COMPLEX (4). Another specifies how to convert complex data to a single floating point value for scaling; it can be IW_COMPLEX_AMPLITUDE (0x10000 hexadecimal), IW_COMPLEX_REAL (0x20000 hexadecimal), IW_COMPLEX_IMAGINARY (0x30000 hexadecimal), or IW_COMPLEX_PHASE (0x40000 hexadecimal) and need only be specified if the input type is complex. The last quantity specifies the fidelity for the scaling and can either be IW_SCALING_DONTCARE (0) or IW_SCALING_EXACT (0x1000000 hexadecimal). For IW_SCALING_DONTCARE, which is the default, a lookup table is used to speed the scaling process with the drawback that the scaling is not faithfully represented when floating point or complex data is scaled with an exponent that differs from one. Specifying IW_EXACT causes the lookup table to be bypassed for floating point or complex data.

The semantics of this call changed in the October 1998 release to clarify the handling of exceptional values for scl and to add support for the IW_SCALING_DONTCARE and IW_SCALING_EXACT modifiers. They were modified further in the June 1999 release to treat the case where scl[1] is less than scl[0] as a reversal of the scale and to handle the case where scl[0] and scl[1] are the same (before these cases were silently handled as if scl[0] was 0 and scl[1] was 4096).

Return Value

Returns IW_ERROR (-1) if any of the pointer parameters are invalid, the image dimensions aren't positive, or mode is invalid. Otherwise, returns IW_SUCCESS (1).


IWScaleImageExt

Scales the intensities in a 2D image to fall within a given range.

Synopsis (C)

int IWScaleImageExt(void *source_addr,const int xy[2], int mode, const float scl[4], int rmin, int rmax, IW_BYTE_MEM_PTR dest_addr);

Synopsis (Fortran)

integer function iwscaleimageext(source_addr, xy, mode, scl, rmin, rmax, dest_addr)
integer xy(2), mode, rmin, rmax
real scale(4)
application-specific type source_addr
byte dest_addr(*)

Description

Functions identically to IWScaleImage, but the range of possible scaled values is set by the caller with the rmin and rmax arguments.

IWScaleImageExt was added in 4.0.12.

Return Value

Returns IW_ERROR (-1) if any of the pointer parameters are invalid, the image dimensions aren't positive, or mode is invalid. Otherwise, returns IW_SUCCESS (1).


IWSetComplexNormalValue

Synopsis (C)

int IWSetComplexNormalValue(IW_COMPLEX_PTR complex_ptr, void* value_ptr, int value_mode);


IWTransformPartialDataType

Synopsis

int IWTransformPartialDataType(void *source,int width,int height,int mode, int xst,int new_width,int yst,int new_height,int new_mode,void *destination,int destination_stride);


IWUnlockSec_ZWT

Releases the hold on a section of data (the section is specified by its z, wave, and time indices) so that the section may be swapped out.

Synopsis (C)

int IWUnlockSec_ZWT(int istream, int iz, int iw, int it);

Synopsis (Fortran)

integer iwunlocksec_zwt(istream, iz, iw, it)
integer istream, iz, iw, it

Description

Marks a section previously accessed by IWLockSec_ZWT or IWLockSec as not currently in use so that, if necessary, the library's memory management routines can move it out of active memory. Returns IW_SUCCESS (1) if istream is attached to an image window; otherwise, returns IW_ERROR (-1).


IWUnlockSec

Releases the hold on a section of data (the section is specified by its position in the list) so that the section may be swapped out.

Synopsis (C)

int IWUnlockSec(int istream, int iz);

Synopsis (Fortran)

integer function iwunlocksec(istream, iz)
integer istream, iz

Description

Is identical to IWUnlockSec_ZWT except the section is specified by its position in the stack rather that its z, wave, and time indices.


IWUnmapWin

Iconifies an image window.

Synopsis (C)

int IWUnmapWin(int istream);

Synopsis (Fortran)

integer function iwunmapwin(istream)
integer istream

Description

If istream is attached to an image window that is not iconified, IWUnmapWin iconifies the window.

Return Value

Returns IW_SUCCESS if stream is attached to a window and the window is not iconified.

Returns IW_ERROR in all other cases.


IWUnregDisChg

Synopsis

int IWUnregDisChg(int istream, int ixwin);


IWUnregEvt

Synopsis

int IWUnregEvt(int istream, int ixwin);


IWUpd5DMod

Updates all the attached windows with the current model.

Synopsis

int IWUpd5DMod(float *pt, IW_GR_5D_MODEL_PTR mod_list, int *iwave, int itime, int flag);

Description


IWUSleep

Suspends execution of the caller for a given number of microseconds.

Synopsis (C)

void IWUSleep(unsigned int usecs);

Synopsis (Fortran)

subroutine iwusleep(usecs)
integer usecs

Description

Puts the process to sleep for usecs microseconds.


IWWinToData

Converts a list of window coordinates to data coordinates.

Synopsis (C)

int IWWinToData(int istream, int iwave, const int iwinpos[], int idatapos[], int npoint);

Synopsis (Fortran)

integer function iwwintodata(istream, iwave, iwinpos, idatapos, npoint)
integer istream, iwave, npoint
integer iwinpos(2 * npoint)
integer idatapos(2 * npoint)

Description

Converts npoint sets of window coordinates into data coordinates. Window coordinates range from (0,0) in the lower left corner of the image display area to (width-1,height-1) in the upper right corner, where width and height are the dimensions of the image display are (you can use IWRtDisArea to find the values of width and height). IWWinToData coerces the window coordinates passed to it to fall in that range. Data coordinates are the x and y indices into the image data; data coordinates which map to valid data locations range from (0,0) to (nx-1,ny-1) where nx and ny are the dimensions of a section of data.

IWWinToData reads the window coordinates from iwinpos, a 2 * npoint element array where the first and second elements of the array form one x and y window coordinate pair, the third and fourth elements another window coordinate pair, and so on. IWWinToData stores the converted coordinates in idatapos, another 2 * npoint element array. The first two elements of idatapos will contain the x and y data coordinates corresponding to the first two elements of iwinpos, the next two elements of idatapos will contain the x and y data coordinates for the third and fourth elements of iwinpos, and so on. iwave is the zero-based index for the wave to use when converting (translations of the images may depend on the wave so it is necessary to specify it).

Return Value

Returns IW_SUCCESS if istream is attached to an image window; otherwise, returns IW_ERROR.


Matrix and Vector Operations


IWAnglesFromMatrix

Given a transformation matrix that is a product of rotations, computes the rotation angles about the coordinate axes.

Synopsis (C)

void IWAnglesFromMatrix(float angle[3], float matrix[3][3]);

Synopsis (Fortran)

subroutine iwanglesfrommatrix(angle, matrix)
real matrix(3,3)
real angle(3)

Description

If matrix is a transformation matrix arising solely from a series of rotations, IWAnglesFromMatrix computes the equivalent transformation with is the product of a rotation about the z axis, followed by a rotation about the y axis, followed by a rotation about the x axis. IWAnglesFromMatrix stores the computed rotation angle about x as the first element of angle, the computed rotation angle about y as the second element of angle, and the computed rotation angle about z as the third element of angle. All the rotation angles are measured in degrees and follow the sign convention that a positive angle is a right-handed rotation (counterclockwise as you look towards the origin along the positive part of the coordinate axis).


IWInvertMatrix

Inverts a 3 x 3 floating-point matrix.

Synopsis (C)

int IWInvertMatrix(IW_MATRIX_PTR matrix,IW_MATRIX_PTR inv_matrix);

Synopsis (Fortran)

integer function iwinvertmatrix(matrix, inv_matrix)
real matrix(3,3)
real inv_matrix(3,3)

Description

Computes the multiplicative inverse of matrix and stores it in inv_matrix.

Return Value

Always returns zero.


IWMatrixFromAngles

Computes the transformation matrix corresponding to a series of rotations.

Synopsis (C)

void IWMatrixFromAngles(float angle[3], float matrix[3][3]);

Synopsis (Fortran)

subroutine iwmatrixfromangles(angle, matrix)
real angle(3)
real matrix(3,3)

Description

Computes the 3 x 3 transformation matrix corresponding to a rotation about the z axis of gamma degrees, followed by a rotation about the y axis of beta degrees, followed by a right-handed rotation about the x axis of alpha. A positive value for alpha, beta, or gamma is a right-handed rotation (counterclockwise as you look towards the origin along the positive part of the coordinate axis). alpha is the first element of angle, beta is the second element of angle, and gamma is the third element of angle.


IWVectorMatrixMult

Computes the product of a 3 x 3 matrix and a 3 element column vector.

Synopsis (C)

int IWVectorMatrixMult(IW_MATRIX matrix, IW_VECTOR vector, IW_VECTOR rtn_vector);

Synopsis (Fortran)

integer function iwvectormatrixmult(matrix, vector, vector_rtn)
real matrix(3,3), vector(3)
real vector_rtn(3)

Description

When the function returns, the product of matrix and vector has been stored in the three elements of vector_rtn.

Return Value

Always returns zero.


IWVectorVectorAdd

Adds two vectors with three elements.

Synopsis (C)

int IWVectorVectorAdd(IW_VECTOR vector1, IW_VECTOR vector2, IW_VECTOR rtn_vector);

Synopsis (Fortran)

integer function iwvectorvectoradd(vector1, vector2, rtn_vector)
real vector1(3), vector2(3)
real rtn_vector(3)

Description

Upon return, rtn_vector holds the vector sum of vector1 and vector2.

Return Value

Always returns zero.


IWVectorVectorSub

Subtracts two vectors with three elements.

Synopsis (C)

int IWVectorVectorSub(IW_VECTOR vector1, IW_VECTOR vector2, IW_VECTOR rtn_vector);

Synopsis (Fortran)

integer function iwvectorvectorsub(vector1, vector2, rtn_vector)
real vector1(3), vector2(3)
real rtn_vector(3)

Description

Upon return, rtn_vector holds the vector difference between vector1 and vector2.

Return Value

Always returns zero.