Skip to main content

ImageInfo

ImageInfo (graphNameStr, imageWaveNameStr, instanceNumber)

The ImageInfo function returns a string containing a semicolon-separated list of information about the specified image in the named graph window or subwindow.

Parameters

graphNameStr can be "" to refer to the top graph.

When identifying a subwindow with graphNameStr, see Subwindow Syntax for details on forming the window hierarchy.

imageWaveNameStr contains either the name of a wave displayed as an image in the named graph, or an image instance name (wave name with "#n" appended to distinguish the nth image of the wave in the graph). You might get an image instance name from the ImageNameList function.

If imageWaveNameStr contains a wave name, instanceNumber identifies which instance you want information about. instanceNumber is usually 0 because there is normally only one instance of a wave displayed as an image in a graph. Set instanceNumber to 1 for information about the second image of the wave, etc. If imageWaveNameStr is "", then information is returned on the instanceNumberth image in the graph.

If imageWaveNameStr is an instance name, and instanceNumber is zero, the instance is taken from imageWaveNameStr. If instanceNumber is greater than zero, the wave name is extracted from imageWaveNameStr, and information is returned concerning the instanceNumberth instance of the wave.

Details

The string contains several groups of information. Each group is prefaced by a keyword and colon, and terminated with the semicolon for ease of use with StringByKey. The keywords are as follows:

KeywordInformation Following Keyword
AXISFLAGSFlags used to specify the axes. Usually blank because /L and /B (left and bottom axes) are the defaults.
COLORMODEA number indicating how the image colors are derived:
1:Color table (see Color Tables).
2:Scaled color index wave (see Indexed Color Details).
3:Point-scaled color index (See Example: Point-scaled Color Index Wave).
4:Direct color (see Direct Color Details).
5:Explicit mode (see ModifyImage explicit keyword).
6:Color table wave (see Color Table Waves).
LAYEREither 0 or 1 indicating that the image is in Layer 0 (below traces and axes) or in Layer 1 (above traces and axes).
RECREATIONSemicolon-separated list of keyword=modifyParameters commands for the ModifyImage command.
XAXISX axis name.
XWAVEX wave name if any, else blank.
XWAVEDFThe full path to the data folder containing the X wave or blank if there is no X wave.
YAXISY axis name.
YWAVEY wave name if any, else blank.
YWAVEDFThe full path to the data folder containing the Y wave or blank if there is no Y wave.
ZWAVEName of wave containing Z data from which the image plot was calculated.
ZWAVEDFThe full path to the data folder containing the Z data wave.

The format of the RECREATION list is designed so that (once you extract the list) you can extract one keyword command from the list using StringByKey and append it to "ModifyImage " followed by the name of an image plot ("data#1" for instance) and then Execute the resultant string as a command.

A helpful routine for extracting the RECREATION list from ImageInfo's return value is WMGetRECREATIONFromInfo in the "Graph Utility Procs" WaveMetrics procedure file (see WaveMetrics Procedures).

Example 1

This example gets the image information for the second image plot of the wave "jack" (which has an instance number of 1) and applies its ModifyImage settings to the first image plot.

#include <Graph Utility Procs>, version>=6.1    // For WMGetRECREATIONFromInfo

// Make two image plots of the same data on different left and right axes
Make/O/N=(20,20) jack=sin(x/5)+cos(y/4)
Display;AppendImage jack // bottom and left axes
AppendImage/R jack // bottom and right axes

// Put image plot jack#0 above jack#1
ModifyGraph axisEnab(left)={0.5,1},axisEnab(right)={0,0.5}

// Set jack#1 to use the Rainbow color table instead of the default Grays
ModifyImage jack#1 ctab={*,*,Rainbow,0}

Now we peek at some of the image information for the second image plot of the wave "jack" (which has an instance number of 1) displayed in the top graph:

Print ImageInfo("","jack",1)[69,148]            // Just the interesting stuff
;ZWAVE:jack;ZWAVEDF:root:;COLORMODE:1;RECREATION:ctab= {*,*,Rainbow,0};plane= 0;

// Apply the color table, etc from jack#1 to jack:
String info= WMGetRECREATIONFromInfo(ImageInfo("","jack",1))
info= RemoveEnding(info) // Remove trailing semicolon

// Use comma instead of semicolon separators
String text = ReplaceString(";", info, ",")
Execute "ModifyImage jack " + text

Example 2

This example gets the full path to the wave containing the Z data from which the first image plot in the top graph was calculated.

String info= ImageInfo("","",0)		// 0 is index of first image plot
String pathToZ= StringByKey("ZWAVEDF",info)+StringByKey("ZWAVE",info)
Print pathToZ
root:jack

See Also

ModifyImage, AppendImage, NewImage, Execute

Image Plots, Image Instance Names