2024年3月28日发(作者:蔚平莹)
北京环中睿驰科技有限公司
1 IGOR Pro - Overview
IGOR Pro is an interactive software environment for experimentation with scientific and
engineering data and for the production of publication-quality graphs and page layouts.
IGOR has been used by tens of thousands of technical professionals since its introduction
in 1989. Here are a few highlights.
IGOR Pro是为科学人员和数据工程师提供交互式软件实验环境,以及制作符合出版要求质
量的图形和页面布局。从1989年IGOR开发以来,已经有数万名专业科技人员使用。
IGOR Pro produces journal-quality scientific graphs and exports high-resolution graphics
formats such as Encapsulated PostScript (EPS) and PDF.
IGOR Pro可以生成符合学术期刊要求的高质量科学图像和高分辨率的图像格式,类似有
EPS格式跟PDF格式。
IGOR Pro handles large data sets very quickly.
IGOR Pro可以快速处理大数据集。
IGOR Pro includes a wide range of capabilities for scientific and engineering analysis and
graphing.
IGOR Pro可以为科研、工程分析和绘图需求提供大范围能处理能力。
IGOR Pro has special support for time-series or other evenly-spaced data.
IGOR Pro特别支持符合时间序列数据以及平均分割数据。
IGOR Pro includes a powerful suite of image processing operations for image filtering,
manipulation, and quantification.
IGOR Pro包含了强大图像处理套件,包括对图像的滤波、处理和量化。
IGOR Pro imports data in many formats, and can acquire data from hardware devices.
IGOR Pro支持多种数据格式的导入,并且能够从硬件设备中获取数据。
IGOR Pro is completely programmable via a built-in programming environment, and can
be extended by external code (XOPs) written in C.
IGOR Pro在嵌入式编程环境中完全支持再编程,以及可以使用由C语言编写的外部代码来
扩展。
IGOR Pro doesn't require any programming; most functionality is available using standard
menus, dialogs, and the mouse.
IGOR Pro不需要任何代码编写,大都功能仅需要标准的菜单、对话框和鼠标即可完成。
IGOR Pro runs on Macintosh and Windows computers, and IGOR's data files are
1
北京环中睿驰科技有限公司
cross-platform compatible.
IGOR Pro支持Macintosh和Windows系统,IGOR的数据文件是跨平台支持的。
IGOR Pro程序主要模块分为:
1、 数据导入模块,支持多种数据格式:
Delimited text.
Fixed-field (FORTRAN) text.
General Binary.
Excel spreadsheet.
HDF.
HDF5.
Matlab.
JCAMP.
Nicolet Instruments.
SDTS DEM and DLG.
National Instruments TDM (DIAdem).
2、 数据存储模块。
3、 如何创建图形。
4、 图形处理模块。
5、 数据分析,数据操作以及应用数学函数。
6、 图形数据的探测。
7、 用户扩展编程模块。
相关图片展示:
2
北京环中睿驰科技有限公司
图3 学术期刊图片页面布局
3
北京环中睿驰科技有限公司
2 IGOR Pro使用方法
2.1 数据导入方法
Igor Pro provides you with the ease and flexibility to import a wide variety of
data file formats so you can concentrate on the important aspects of analyzing
and displaying your data. The main data formats supported are:
•
•
•
•
•
•
•
•
•
•
•
Delimited text.
Fixed-field (FORTRAN) text.
General Binary.
Excel spreadsheet.
HDF.
HDF5.
Matlab.
JCAMP.
Nicolet Instruments.
SDTS DEM and DLG.
National Instruments TDM (DIAdem).
Igor Pro can import data as integer or single- or double-precision floating point
numbers, import data in various common date and time formats, or import
values simply as text.
Import a wide variety of image file formats to take full advantage of Igor
Pro's Image Analysis capabilities:
•
•
•
•
•
•
•
•
•
•
GIF.
PNG.
JPEG.
PICT.
TIFF.
BMP.
PhotoShop.
Silicon Graphics.
Sun Raster.
Targa.
For multimedia and sound analysis, you can import sound data encoded in the
following formats:
•
•
Audio Interchange File Format (AIFF & AIFF-C, Mac only).
Movie Audio Track (MooV, Mac only).
4
北京环中睿驰科技有限公司
•
•
•
MPEG Audio Layer 2 (MP2, Mac only).
MPEG Audio Layer 3 (MP3, Mac only).
Waveform Audio File Format (WAVE, Windows only).
With Apple's QuickTime installed, you can not only create movies but can also
extract individual frames.
You can also import data in Igor Pro's native file formats such as Igor Text and
Igor Binary. You can easily view data stored in other Igor Pro experiments,
using the Browse Experiment feature of the Data Browser, and import such data
directly into your current experiment file.
Importing Data
Igor Pro's file loaders are accessed via the Load Waves submenu, which includes
all of the built-in file loaders and other data importation facilities added
via Procedures or XOPs.
You can load most common text file formats using Igor Pro's Load Waves dialog.
5
北京环中睿驰科技有限公司
This dialog includes the Load Data Tweaks subdialog that you can use to specify
any unusual aspects of the data you are importing.
The Load Waves menu also includes shortcuts, such as the Load General Text
and Load Delimited Text items, that you can use to access the respective file
loading routines with default options.
6
北京环中睿驰科技有限公司
Programming Flexibility
If you need to go beyond the built-in file loaders and have a file format that Igor
Pro cannot already import, then you have the flexibility of creating your own
custom file loaders using Igor Pro's powerful built-in programminglanguage or
by creating an plug-in module using the optional XOP Toolkit.
If you have many data files to import into Igor Pro, you can save yourself much
time and effort by creating your own procedures to completely automate the
process. Igor Pro's manual and online help files include several detailed and
fully-described programming examples to help you write your own data import
procedures.
When creating data import procedures you have available a number of
programming operations such as LoadWave, ImageLoad, LoadData, LoadPICT,
Open, FReadLine, FBinRead, and Close.
Import Binary Files
With Igor Pro's Load General Binary dialog and GBLoadWave external operation,
you can import a wide variety of binary data file formats.
You can import binary data in the following numeric formats:
•
•
8 bit, 16 bit, or 32 bit signed or unsigned integers.
32 or 64 bit IEEE floating point numbers.
7
北京环中睿驰科技有限公司
•
32 or 64 bit VAX floating point numbers.
2.2 数据存储方法
IGOR Pro stores your data in named data objects called waves. Wave is short for
waveform and emphasizes IGOR's unique support for evenly spaced data. Here
are the properties of waves:
•
•
•
•
•
•
•
Size limited only by memory
Number of data objects limited only by memory
Up to four dimensions
Two floating-point and six integer formats, strings
Numeric formats may be real or complex
Special support for waveform (equally-spaced) data
Maintains additional information such as modification time, notes
IGOR also supports another class of named data objects that store just a single
number or string. Numeric variables may be real or complex and string
variables, like string waves, are unlimited in size and may contain binary data.
Unlike spreadsheet programs, IGOR's data objects need not clutter up your
screen by being displayed in a table.
You can efficiently organize your data into a hierarchy of IGOR's Data Folders in
much the same way that you organize files in a hierarchy of folders on your hard
drive. With IGOR's Data Browser window you can navigate through the different
levels of data folders, examine values of variables, strings and waves, and load
data objects from other Igor workspaces (called experiments).
8
北京环中睿驰科技有限公司
Experiments
Your data, graphs, tables, programs, notebooks and control panels for a given
project are organized in a workspace called an experiment. Experiments can be
stored in a single disk file which can be easily exchanged with colleagues. Data
and program files can also be external so that they may be shared among
experiments.
Data Formats
Numeric data in waves may be real or complex with the following number types:
•
•
•
Single precision floating point (32 bits)
Double precision floating point (64 bits)
Signed and unsigned 8, 16 and 32 bit integer
String data can be of unlimited size and there are no limits on what it may
contain, i.e., it may be binary.
Waveform Support
If you work with data with evenly spaced x values, you will appreciate IGOR's
unique support for waveform data. Normally, you would have to create a vector
of data that contains x values, but in IGOR, you can simply specify x-scaling for
a wave using two numbers. This not only saves memory and reduces clutter but
it also allows IGOR to automatically use the x-scaling as needed. For example,
the Fourier transform of a wave of time sampled data automatically creates a
result with the correct frequency x-scaling. See Signal Processing for an
example.
While x-scaling is handy for vector data, matrices and higher dimensional
objects can benefit from dimensional scaling as well. For example, image data
can have x and y-scaling in physical units such as meters or arcseconds. For an
example, see Images.
9
北京环中睿驰科技有限公司
2.3 如何创建图形
Creating Graphics
IGOR Pro is first and foremost a publication quality scientific and engineering
graphics program. Each element of a graph can be finely adjusted to meet your
(or your journal's) exacting requirements. For example, line thickness may be
specified as 1.35 Points -- not just 1 or 1.5. Not only are many dash patterns
provided, but you can also customize them with a graphical dash pattern editor.
Virtually any graph you see in your favorite scientific or engineering journal
could have been made using Igor -- and many of them have been.
Simultaneously, Igor's graphs are exploratory tools of the first order. Graph
updating is extremely fast allowing you to smoothly zoom in and out and pan in
all directions even with millions of data points. And unlike some competitors,
Igor always plots all of your data so you don't miss features that others may skip.
Igor's cursors provide live readouts of your xy or image data and can be used to
specify data subsets for analysis. You can compose fancy text annotations called
tags that dynamically update as the data changes or as you move a tag to a
different data point. Graphs automatically update to take full advantage of the
available space when you resize a graph window.
Igor's 2D graphs are exceedingly flexible. You can create graphs with an
unlimited number of traces, axes, contor plots, images and annotations. You
can embed graphs within other graphs and can compose page layouts with
multiple graphs, tables, annotations and pictures.
Speaking of flexible, Igor's image plots can use any data type from unsigned
byte to double precision complex (complex data is automatically presented as
10
北京环中睿驰科技有限公司
magnitude.) Pixels can even have uneven spacing as with a log axis or user
specified x or y values. Images can be true color or many different forms of false
color. You can even specify what happens for out-of-range data.
You can use Igor's powerful drawing tools to annotate your graphs or page
layouts with lines, arrows, rectangles, Bezier curves and many other types.
Multiple layers are provided and all tools may be used programatically. Unique
to Igor is the ability to specify the coordinate system for draw objects. For
example, you might specify the coordinates of a background shaded area to be
in terms of a pair of axes. This would allow you to zoom or otherwise adjust the
axis ranges but still have the shaded area remain in the correct location relative
to the data.
You can use Igor's annotation editor to create precise and sophisticated text
annotations. Igor goes way beyond simple sub- or superscripts with precise and
flexible layout. Annotations can be designed to automatically respond to
changes in font or size and can dynamically include data values.
You can create visually stunning 3D graphics using Igor's Gizmo and Surface
Plotter modules. Be sure to visit thegallery as well as the 3D graphics web pages
to see these "cool" graphics.
2D graphs
11
北京环中睿驰科技有限公司
IGOR Pro's 2D graph types include highly customizable X-Y (line, marker, area
and bar) plots, contour, image, and category plots. As illustrated by the graph
to the right, you can combine any or all of these forms in a single graph window.
IGOR places no limits on the number of graph objects or the size of your data.
In IGOR, as you expand or shrink a graph window, the graph automatically
takes full advantage of the available space, expanding or shrinking font, marker
and line thickness to optimum values approprate for the new size. Of course,
you can force a graph to specific size or aspect ratio and can override automatic
adjustments.
IGOR's annotation dialog enables you to create arbitrarily complex text boxes,
legends (including color scales) and dynamic tags that can automatically
present data values. Dynamic tags can not only be attached to points on an XY
plot but can even be attached to pixels on an image plot. Tags can be set to
automatically rotate tangent to the point on the curve to which they are
attached.
Graphics Speed
Dramatically faster than competing programs
Graphs refresh almost instantly
Special support for real-time data
Graphics Flexibility
Unlimited number of curves and axes on a graph
Unlimited number of graphs
Precise control of graph features
Customizable dashed lines
Full support for error bars
Text markers and 62 built-in marker symbols, arrows and wind barbs;
user-defined markers
72 fill patterns, positive and negative fills, and fill between curves
Display of date and time data in a wide variety of formats
Fully customizable axes, reciprocal axes
Text annotations with subscripts, superscripts, font and style changes
Text annotations with automatic readout of data values
High-resolution drawing tools
IGOR's graphics are publication-quality, and have graced the pages of
respected scientific journals. You can extensively "tune" the appearance of
graphs to meet the demanding requirements of scientific and engineering
publications.
12
北京环中睿驰科技有限公司
Page layouts
A page layout, or layout for short, is a type of window that you can use to
compose pages containing:
•
•
•
•
•
graphs
tables
annotations (textboxes and legends)
pictures
drawing elements (lines, arrows, rectangles, polygons, etc.)
Each layout represents one page. You can have as many layouts as memory
allows. Here is an example of a layout window.
13
北京环中睿驰科技有限公司
A page layout has a number of layers. One layer, the layout layer, is for graphs,
tables, annotations and pictures. The other layers are for drawing elements.
Here are the notable features of page layouts.
•
•
•
•
•
You can combine graphs, tables, pictures, annotations and drawing elements.
Graphs, tables and legends in layouts are updated automatically.
Complex graphs can be quickly and smoothly positioned.
Layouts print at the full resolution of the printer.
You can export all or part of a layout to another program.
There are two ways to add a graph or table to the layout layer:
•
•
By creating a graph or table object. An object is a representation of a separate
standalone graph or table window.
By creating an embedded graph or table subwindow. A subwindow is a
self-contained graph or table embedded in a layout window.
2.4 图形处理方法
Image Processing
IGOR Pro contains a full set of operations and functions for scientific image
analysis applications which make it an ideal cross-platform tool for image
acquisition, display and processing.
Image acquisition can be as simple as loading multi-dimensional data from disk
file or as complicated as using an XOP to grab live video frames to disk (see XOP
Toolkit for information on creating your own XOP). In both cases the images can
be displayed on the screen for visual inspection and analysis or they could be
automatically analyzed without user intervention. The processing and analysis
stage depends on the nature of the images and the information of interest.
The main component of the image processing tools are the ImageXXX
operations which are supplemented by the image processing procedure files.
The latter are combined as the Image Processing Package which you can load
from Analysis menu. In addition to the dedicated ImageXXX operations you can
also take advantage of general analysis functions such as FFT and curve fitting
in image processing applications. Rounding up the list of built-in operations is
MatrixOP which provides efficient means for formulating and performing
mathematical operations on images.
14
北京环中睿驰科技有限公司
Image display can be as simple as placing an RGB image in a graph window or
as complicated as creating an overlay of multiple images combined with contour
lines and legend. Being able to display images in false color or using a non-linear
level mapping is sometimes helpful when trying to visually analyze images.
The conventional approach to image processing involves the following steps:
(1) image transformations and color conversions where the acquired image is
converted into standard form in colorspace and in range.
(2) Image filtering (cleaning up the image to improve S/N ratio) can be
accomplished using localized filters or mathematical transforms.
(3) Threshold operation to convert the image from a gray-scale to a binary
form.
(4) Morphological filtering usually follows the threshold operations but some
morphological operations can actually precede the threshold step. Typical
morphological filters include: erosion/dilation, opening/closing, tophat and
watershed.
(5) Particle analysis is the operation where the filtered binary image is analyzed
by quantifying various spatial properties of different "particles" (i.e., spots or
regions) in the image. The spatial measurements include location, area,
perimeter and moments for calculating a fitting ellipse.
Image Transforms
Image transforms can be simple arithmetic operations on images or complex
mathematical operations which convert images from one representation to
another.
Mathematical Operations include simple image arithmetic, Fourier, fast Hartley
transform, Hough transform and Radon transform.
Histogram Modification include histogram equalization and adaptive histogram
equalization.
Image Interpolation includes various methods for scaling, Kriging, image
warping and radial aberration correction.
Image Registration is a tool for registering two 2D or 3D similar images and
finding an affine transformation that can be used to convert one into the other.
The operation is suitable for registering medical images of the same object.
15
北京环中睿驰科技有限公司
Background Removal is a process to correct an image for non-uniform
background or non-uniform illumination.
Image Rotation is a simple tool to rotate an image about its center by the
specified number of degrees.
Mathematical Transformations
Mathematical transformations of images may be as simple as image arithmetic
or as complex as an iterating Fourier transform. You can handle most image
arithmetic by executing IGOR commands. For example, to subtract a
background image:
Duplicate noisyImage,outputImage
outputImage=inputImage-backgroundImage
When working with images that are 8 or 16 bit per pixel you can perform level
mapping using
outputImage=LUT[inputImage[p][q]]
here LUT is a lookup table for the mapping. For example, LUT can be used for
Gamma correction using an expression like
LUT=p^(1/Gamma)
Most arithmetic operations are performed more efficiently using MatrixOP.
Fourier Transforms
The Fast Fourier Transform (FFT) can be used to decompose a grayscale image
into its spatial frequency components or to perform efficient 2D convolutions
and correlations (RGB images are usually handled on a channel by channel
basis).
In the following example we illustrate simple FFT filtering. We created an image
that consists of a one dimensional slow quadratic ramp and added single
frequency sinusoidal noise. The filter consists of a 2D constant wave with a
single null pixel. The filtering consists of a single command line:
MatrixOP/o filtered=IFFT(filter*FFT(inputImage,2),3)
16
北京环中睿驰科技有限公司
The input is shown on the top right, the filtered image is shown on the top-left.
The blue lines mark the position of measured line profiles which are displayed
below the images.
After an image has been filtered by convolution with some filter, it is not always
possible to recover the original from the filtered version. One approach for
deconvolution is known as a Wiener filter:
Create the Gaussian blur filter
Make/O/N=(512,512) blur=exp(-((x-255)/9)^2-((y-255)/9)^2)
Perform the convolution and add uniform noise
MatrixOP/O blurredImage=IFFT(FFT(lena,2)*FFT(blur,2),3)
ImageTransform swap blurredImage
blurredImage+=enoise(2)
17
北京环中睿驰科技有限公司
Lena's picture using a Gaussian blur and uniform additive noise.
The Wiener filter has the form:
Estimated Image = O*Hc/[H*Hc+ fn/fs]
where O is the Fourier transform of the convolved image, H is the Fourier
transform of the convolution filter, Hc is the complex conjugate of H, and fn/fs
is the ratio of the noise to signal power spectra. The Weiner filter is designed to
minimize the mean square error of a linear estimate. The difficulty of applying
the filter is in finding the appropriate values for fn/fs since the noise is not
usually known. In practice one can frequently replace fn/fs with a constant
value that applies over the whole image or try to estimate the value on a region
by region basis.
MatrixOP/O estimated=IFFT(FFT(blurredImage,2)*h/(h*hc+0.04),3)
ImageTransform swap estimated
18
北京环中睿驰科技有限公司
Recovered image using Wiener filtering.
The Wavelet Transform
The wavelet transform is used primarily for smoothing, noise reduction and
lossy compression. In all cases the procedure is to first perform a forward
wavelet transform, then perform some operation on the transformed image
followed by an inverse wavelet transform. In wavelet compression, for example,
the compressed image is the part of the transform that corresponds to the low
order coefficients in the transform (similar to low pass filtering in 2D Fourier
transform). The reconstructed image exhibits a number of compression-related
artifacts, but it is worth noting that unlike an FFT based low-pass filter, the
advantage of the wavelet transform is that the image contains a fair amount of
high-frequency content.
To illustrate the application of the wavelet transform to de-noising, we start
by adding artificial noise to an image:
Mri+=gnoise(10)
19
北京环中睿驰科技有限公司
To denoise the image we use:
DWT/D/N=20/P=1/T=1/V=0.3 Mri,dMri
denoising
// increase /V for more
The denoised image showing significant noise reduction at the cost of minor
wavelet transform artifacts.
Hough Transform
The Hough Transform is a mapping algorithm in which lines in image space map
to single points in the transform space. It is most often used for line detection.
Specifically, each point in the image space maps to a sinusoidal curve in the
transform space. If pixels in the image lie along a line, the sinusoidal curves
20
北京环中睿驰科技有限公司
associated with these pixels all intersect at a single point in the transform space.
By counting the number of sinusoids intersecting at each point in the transform
space, lines can be detected. Here is an example of an image that consists of
one line.
The source image shows a series of bright pixels in the center. The first and last
points are transformed into lines at 0 and 180 degrees. The second point from
the top corresponds to the line at 45 degrees and so on.
Hartley Transform
The Hartley transform is similar to the Fourier transform except that it uses only
real values. The transform is based on the cas kernel defined by:
cas(vx) = cos(vx) + sin(vx).
The discrete Hartley transform is given by
The Hartley transform has two interesting mathematical properties. First, the
inverse transform is identical to the forward transform, and second, the power
spectrum is given by the expression:
21
北京环中睿驰科技有限公司
The implementation of the Fast Hartley Transform is part of the
ImageTransform operation. It requires that the source wave is an image whose
dimensions are a power of 2.
2.5 数据分析方法
Data Analysis
"Data analysis" derives meaning or significance from raw data: it answers
questions like "how much?", "how high?", or "how often?". Since Igor aims to
serve a wide range of disciplines, it provides many analysis capabilities to
choose from. We present them here in our somewhat arbitrary categories:
Curve Fitting
Linear and non-linear fits
Built-in and user-defined functions
Multi-variate fits involving unlimited independent variables
Peak Analysis
Peak and level-crossing detection
Fitting multiple overlapping peaks
Baseline removal
Signal Processing
Multi-dimensional mixed-radix FFT, wavelet, Hough transforms
Integration and differentiation of data
Convolution and correlation
Smoothing and filtering
Statistics
Descriptive statistics such as mean, standard deviation and higher
central moments
22
北京环中睿驰科技有限公司
Statistical Tests
Probability Distribution Functions, Cumulative Distribution
Functions and Inverse CDFs
Histograms, Sorting, Resampling, Correlations and Linear Regression
2.6 数据操作和数学方法
Data Manipulation and Math
IGOR provides an extensive library of math and data manipulation routines and
IGOR's array-oriented arithmetic make complex operations a snap.
IGOR provides all the mathematical operators and functions you would expect --
and then some. You can quickly find the desired function or operation using
IGOR's handy help browser as illustrated to the right.
Many of IGOR's algorithms are from Numerical Recipes and the LAPACK
numerical library.
Array arithmetic is the most flexible and powerful part of Igor's analysis
capability. It allows you to write assignment statements that work on an entire
Array or on a subset of an Array much as you would write an assignment to a
single variable in a standard programming language.
23
北京环中睿驰科技有限公司
You can access all of the most common operations via easy-to-use dialogs.
Later, as you learn from watching as the dialogs synthesize commands, you can
type directly on IGOR's command line or write routines to perform specialized
operations.
By way of example, here are the command lines that create the data and the
image plot shown on the right:
Make/N=(150,150) data1 // create a 150x150 array
SetScale x,-1.5,1.5, data1 // set x and ...
SetScale y,-1.5,1.5, data1 // ... y scaling
data1= exp(-(x^2 + y^2)) // operation on entire array
NewImage data1 // display the results
ModifyImage data1 ctab= {*,*,Rainbow,0}
The dialog that created the last command can be viewed here.
In addition to array arithmetic, IGOR also provides a matrix math facility that
makes it easy to perform matrix manipulations such as matrix multiply and dot
product using a natural syntax.
Here are some of the data manipulation methods provided in IGOR:
Interpolation
Igor has a number of interpolation tools that are designed for different
applications. One dimensional data (vectors) can be interpolated
using linear, cubic spline and smoothing spline methods. 2D (matrix)
data can use bilinear, splines, Kriging and Voroni while 3D (volume)
data can be treated with trilinear and barycentric methods.
Integration and Differentiation
The Differentiate and Integrate operations provide a number of
algorithms for operation on one-dimensional waveform and XY data.
These operations can either replace the original data or create a new
data set with the results. The easiest way to use these operations is via
dialogs available from the Analysis menu. These handy dialogs even
24
北京环中睿驰科技有限公司
provide for graphing the results.
Sorting
Sort operation sorts one or more 1D numeric or text data sets in
ascending or descending order. Multiple sort keys are supported (for
cases where the first key has identical values). MakeIndex and
IndexSort are also provided for extra flexibility.
Extraction
The Extract operation makes it easy to extract subsets of data that
correspond to specific criteria. For example,
Extract/O source,dest,source>10 && source<20
creates a new data set named dest containing values from soruce that
are between 10 and 20. You can also find the index values where the
expression is true so you can access the subset in place.
Smoothing
Igor has three built-in algorithms. Each one effectively precomputes
smoothing coefficients according to the smoothing parameters, and
then replaces each data wave with the convolution of the wave with
the coefficients. The bulit-in methods are:
•
Binomial Smoothing: The Binomial smoothing operation is a Gaussian
filter. It is the sharpest filter that will not cause ringing on a step or
impulse.
•
Savitzky-Golay Smoothing: Savitzky-Golay smoothing uses a different
set of precomputed coefficients popular in the field of chemistry. It is a
type of Least Squares Polynomial smoothing. The amount of smoothing
is controlled by two parameters: the polynomial order and the number of
points used to compute each smoothed output value.
•
Box Smoothing: Box smoothing is similar to a moving average, except
that an equal number of points before and after the smoothed value are
averaged together with the smoothed value.
In addition to built-in smoothing, you can perform smoothing (or any
other finite impulse response type filter) using your own coefficients with
the SmoothCustom operation. Each smooth type, including
SmoothCustom, can pick from several end-effect algorithms
2.7 数据分析函数
Igor includes several operations that work on functions rather than discrete
data points. These operations include
25
北京环中睿驰科技有限公司
Plotting of functions
Making a graph of a
function in Igor is easy. For
simple expressions, use
arithmetic expressions
entered on the command
line. Igor's programming
language allows arbitrarily
complex non-linear
functions expressed as
user-defined functions that
can be used to make a
graph.
Differential Equations
Numerically solve ordinary
differential equations,
making possible
simulations of dynamic
systems.
Optimization
Use the Optimize operation to find minima and maxima of functions expressed
using Igor's built-in language. Optimize functions of any number of dimensions,
using a choice of methods including simulated annealing.
Function Roots
Use the FindRoots operation to find roots of functions expressed using Igor's
built-in language. You can use Igor to find N-dimensional roots of systems of
equations.
The FindRoots operation can also be used to find complex roots of polynomials.
Integration of Functions
Find numeric integrals of continuous functions using a choice of methods. By
nesting integrations, you can integrate an N-dimensional function.
26
北京环中睿驰科技有限公司
2.8 图形数据探测(Exploration)
Because IGOR's 2D graphs are so fast, you can quickly explore large data sets
by zooming in and out on portions of a graph. You can drag a marqee selection
around an area of interest and then click in the center to access a popup menu
to expand or contract about that area. Here is an example:
And here is the result after choosing expand:
27
北京环中睿驰科技有限公司
Before choosing the popup menu, you can adjust the selection by dragging the
marquee's handles. After zooming in on a region of interest, you can pan around
in all directions.
Starting with version 6.1, you can hover your mouse over a point on an axis and
use the mouse wheel to zoom in or zoom out about that point.
An even zippier tool is provided as a bulit-in procedure package that makes an
copy of your graph with an expanded view of your data that follows the cursor
as you move the mouse pointer over the original graph. You can experience the
quickness of this tool for yourself by downloading the demo version of IGOR
(anonymous download -- no registration or forms to fill out) and then following
these instructions:
1. Start IGOR and either:
a. Load and graph your own data or
b. Load any of the example experiments with graphs of large data sets
or
c. Create synthetic data by copying
d. Make/N=10000 data1;SetScale x,0,10e-3,"s",data1
e. data1= 2+2*cos(x*300)+10*exp(-(1e4*(x-3e-3))^2) +
1*exp(-(1e4*(x-6e-3))^2) + 0.3*exp(-(1e4*(x-6.2e-3))^2) +
gnoise(0.03)
f. Display data1
...and then executing them in IGOR. In IGOR, type CTRL-J (Windows,
cmd-J Mac) to bring the command window forward, paste and then
press return.
2. With the graph frontmost, from the menu bar, choose
Graph->Packages->Graph Magnifier.
3. In the resulting control panel, click Do It.
4. Move your mouse over the data in the original graph.
5. When finished exploring, click the Done button that was added to your
original graph.
Info Box and Cursors
You can put an information box on a graph by choosing Show Info from the
Graph menu while the graph is the target window. An info box displays a precise
readout of values and also provides a convenient way to specify a region of
interest for operations such as curve fitting.
28
北京环中睿驰科技有限公司
Here is an example of the Info box and cursors on an XY plot:
And the following example shows that cursors can also be placed on image
plots:
When cursors are placed on image or waterfall plots, z and delta-z values are
added to the info box.
29
北京环中睿驰科技有限公司
A variety of cursor styles are provided. Cursors may be attached to data points
or may be free to roam throughout the plot area.
You can move cursors in several ways. In addition to the slider control shown in
the examples, you can use the mouse to drag cursors to different points or
different traces or images. Each graph window can have its own info box and
cursors.
2.9 用户再编程
Programming
IGOR Pro includes a powerful and full-featured structured programming
language that you can use for automation of data import, file I/O, analysis, data
acquisition, graphing, drawing, printing, and just about anything you can think
of. You can add menus to the program and create control panels containing
buttons, checkboxes, popup menus, and other controls to set parameters or
display results.
IGOR Pro aids you in your programming tasks with syntax coloring< and a
symbolic debugger that will help you efficiently troubleshoot your code.
IGOR Pro ships with many examples illustrating (among other things) peak
fitting, signal processing, data acquisition, test automation, and graphing
techniques.
Programmability
Complete built-in structured programming language
Over 450 built-in functions and 400 built-in operations
Many additional functions and operations supplied by XOPs and
WaveMetrics-authored user procedures
Symbolic debugger
User-definable math and string functions
All aspects of IGOR Pro can be programmed
Controllable by external scripting systems
Syntax coloring in procedures
Integrated help and documentation
Search across multiple program source files
30
北京环中睿驰科技有限公司
2.10 用户接口
You can easily create custom interfaces to accomplish specialized tasks. Igor´s
dialogs and contextual menus make it easy to construct a user interface to
specialized analysis code.
Available Customizations
•
•
•
•
Create control panels and graphs with controls that implement custom
behavior using Igor´s built-in programming language.
Add your own menus or modify Igor´s menus.
Create custom help for other users.
Write "external operations" in C or C++ to add special windows to Igor or to
control or acquire data from instruments.
Examples of custom interfaces are shipped with Igor. You can find them in the
File->Examples menu. Some major features of Igor are implemented using a
custom interface like the ones you can build, among them the Image Processing
and Polar Graphs packages:
31
北京环中睿驰科技有限公司
32
2024年3月28日发(作者:蔚平莹)
北京环中睿驰科技有限公司
1 IGOR Pro - Overview
IGOR Pro is an interactive software environment for experimentation with scientific and
engineering data and for the production of publication-quality graphs and page layouts.
IGOR has been used by tens of thousands of technical professionals since its introduction
in 1989. Here are a few highlights.
IGOR Pro是为科学人员和数据工程师提供交互式软件实验环境,以及制作符合出版要求质
量的图形和页面布局。从1989年IGOR开发以来,已经有数万名专业科技人员使用。
IGOR Pro produces journal-quality scientific graphs and exports high-resolution graphics
formats such as Encapsulated PostScript (EPS) and PDF.
IGOR Pro可以生成符合学术期刊要求的高质量科学图像和高分辨率的图像格式,类似有
EPS格式跟PDF格式。
IGOR Pro handles large data sets very quickly.
IGOR Pro可以快速处理大数据集。
IGOR Pro includes a wide range of capabilities for scientific and engineering analysis and
graphing.
IGOR Pro可以为科研、工程分析和绘图需求提供大范围能处理能力。
IGOR Pro has special support for time-series or other evenly-spaced data.
IGOR Pro特别支持符合时间序列数据以及平均分割数据。
IGOR Pro includes a powerful suite of image processing operations for image filtering,
manipulation, and quantification.
IGOR Pro包含了强大图像处理套件,包括对图像的滤波、处理和量化。
IGOR Pro imports data in many formats, and can acquire data from hardware devices.
IGOR Pro支持多种数据格式的导入,并且能够从硬件设备中获取数据。
IGOR Pro is completely programmable via a built-in programming environment, and can
be extended by external code (XOPs) written in C.
IGOR Pro在嵌入式编程环境中完全支持再编程,以及可以使用由C语言编写的外部代码来
扩展。
IGOR Pro doesn't require any programming; most functionality is available using standard
menus, dialogs, and the mouse.
IGOR Pro不需要任何代码编写,大都功能仅需要标准的菜单、对话框和鼠标即可完成。
IGOR Pro runs on Macintosh and Windows computers, and IGOR's data files are
1
北京环中睿驰科技有限公司
cross-platform compatible.
IGOR Pro支持Macintosh和Windows系统,IGOR的数据文件是跨平台支持的。
IGOR Pro程序主要模块分为:
1、 数据导入模块,支持多种数据格式:
Delimited text.
Fixed-field (FORTRAN) text.
General Binary.
Excel spreadsheet.
HDF.
HDF5.
Matlab.
JCAMP.
Nicolet Instruments.
SDTS DEM and DLG.
National Instruments TDM (DIAdem).
2、 数据存储模块。
3、 如何创建图形。
4、 图形处理模块。
5、 数据分析,数据操作以及应用数学函数。
6、 图形数据的探测。
7、 用户扩展编程模块。
相关图片展示:
2
北京环中睿驰科技有限公司
图3 学术期刊图片页面布局
3
北京环中睿驰科技有限公司
2 IGOR Pro使用方法
2.1 数据导入方法
Igor Pro provides you with the ease and flexibility to import a wide variety of
data file formats so you can concentrate on the important aspects of analyzing
and displaying your data. The main data formats supported are:
•
•
•
•
•
•
•
•
•
•
•
Delimited text.
Fixed-field (FORTRAN) text.
General Binary.
Excel spreadsheet.
HDF.
HDF5.
Matlab.
JCAMP.
Nicolet Instruments.
SDTS DEM and DLG.
National Instruments TDM (DIAdem).
Igor Pro can import data as integer or single- or double-precision floating point
numbers, import data in various common date and time formats, or import
values simply as text.
Import a wide variety of image file formats to take full advantage of Igor
Pro's Image Analysis capabilities:
•
•
•
•
•
•
•
•
•
•
GIF.
PNG.
JPEG.
PICT.
TIFF.
BMP.
PhotoShop.
Silicon Graphics.
Sun Raster.
Targa.
For multimedia and sound analysis, you can import sound data encoded in the
following formats:
•
•
Audio Interchange File Format (AIFF & AIFF-C, Mac only).
Movie Audio Track (MooV, Mac only).
4
北京环中睿驰科技有限公司
•
•
•
MPEG Audio Layer 2 (MP2, Mac only).
MPEG Audio Layer 3 (MP3, Mac only).
Waveform Audio File Format (WAVE, Windows only).
With Apple's QuickTime installed, you can not only create movies but can also
extract individual frames.
You can also import data in Igor Pro's native file formats such as Igor Text and
Igor Binary. You can easily view data stored in other Igor Pro experiments,
using the Browse Experiment feature of the Data Browser, and import such data
directly into your current experiment file.
Importing Data
Igor Pro's file loaders are accessed via the Load Waves submenu, which includes
all of the built-in file loaders and other data importation facilities added
via Procedures or XOPs.
You can load most common text file formats using Igor Pro's Load Waves dialog.
5
北京环中睿驰科技有限公司
This dialog includes the Load Data Tweaks subdialog that you can use to specify
any unusual aspects of the data you are importing.
The Load Waves menu also includes shortcuts, such as the Load General Text
and Load Delimited Text items, that you can use to access the respective file
loading routines with default options.
6
北京环中睿驰科技有限公司
Programming Flexibility
If you need to go beyond the built-in file loaders and have a file format that Igor
Pro cannot already import, then you have the flexibility of creating your own
custom file loaders using Igor Pro's powerful built-in programminglanguage or
by creating an plug-in module using the optional XOP Toolkit.
If you have many data files to import into Igor Pro, you can save yourself much
time and effort by creating your own procedures to completely automate the
process. Igor Pro's manual and online help files include several detailed and
fully-described programming examples to help you write your own data import
procedures.
When creating data import procedures you have available a number of
programming operations such as LoadWave, ImageLoad, LoadData, LoadPICT,
Open, FReadLine, FBinRead, and Close.
Import Binary Files
With Igor Pro's Load General Binary dialog and GBLoadWave external operation,
you can import a wide variety of binary data file formats.
You can import binary data in the following numeric formats:
•
•
8 bit, 16 bit, or 32 bit signed or unsigned integers.
32 or 64 bit IEEE floating point numbers.
7
北京环中睿驰科技有限公司
•
32 or 64 bit VAX floating point numbers.
2.2 数据存储方法
IGOR Pro stores your data in named data objects called waves. Wave is short for
waveform and emphasizes IGOR's unique support for evenly spaced data. Here
are the properties of waves:
•
•
•
•
•
•
•
Size limited only by memory
Number of data objects limited only by memory
Up to four dimensions
Two floating-point and six integer formats, strings
Numeric formats may be real or complex
Special support for waveform (equally-spaced) data
Maintains additional information such as modification time, notes
IGOR also supports another class of named data objects that store just a single
number or string. Numeric variables may be real or complex and string
variables, like string waves, are unlimited in size and may contain binary data.
Unlike spreadsheet programs, IGOR's data objects need not clutter up your
screen by being displayed in a table.
You can efficiently organize your data into a hierarchy of IGOR's Data Folders in
much the same way that you organize files in a hierarchy of folders on your hard
drive. With IGOR's Data Browser window you can navigate through the different
levels of data folders, examine values of variables, strings and waves, and load
data objects from other Igor workspaces (called experiments).
8
北京环中睿驰科技有限公司
Experiments
Your data, graphs, tables, programs, notebooks and control panels for a given
project are organized in a workspace called an experiment. Experiments can be
stored in a single disk file which can be easily exchanged with colleagues. Data
and program files can also be external so that they may be shared among
experiments.
Data Formats
Numeric data in waves may be real or complex with the following number types:
•
•
•
Single precision floating point (32 bits)
Double precision floating point (64 bits)
Signed and unsigned 8, 16 and 32 bit integer
String data can be of unlimited size and there are no limits on what it may
contain, i.e., it may be binary.
Waveform Support
If you work with data with evenly spaced x values, you will appreciate IGOR's
unique support for waveform data. Normally, you would have to create a vector
of data that contains x values, but in IGOR, you can simply specify x-scaling for
a wave using two numbers. This not only saves memory and reduces clutter but
it also allows IGOR to automatically use the x-scaling as needed. For example,
the Fourier transform of a wave of time sampled data automatically creates a
result with the correct frequency x-scaling. See Signal Processing for an
example.
While x-scaling is handy for vector data, matrices and higher dimensional
objects can benefit from dimensional scaling as well. For example, image data
can have x and y-scaling in physical units such as meters or arcseconds. For an
example, see Images.
9
北京环中睿驰科技有限公司
2.3 如何创建图形
Creating Graphics
IGOR Pro is first and foremost a publication quality scientific and engineering
graphics program. Each element of a graph can be finely adjusted to meet your
(or your journal's) exacting requirements. For example, line thickness may be
specified as 1.35 Points -- not just 1 or 1.5. Not only are many dash patterns
provided, but you can also customize them with a graphical dash pattern editor.
Virtually any graph you see in your favorite scientific or engineering journal
could have been made using Igor -- and many of them have been.
Simultaneously, Igor's graphs are exploratory tools of the first order. Graph
updating is extremely fast allowing you to smoothly zoom in and out and pan in
all directions even with millions of data points. And unlike some competitors,
Igor always plots all of your data so you don't miss features that others may skip.
Igor's cursors provide live readouts of your xy or image data and can be used to
specify data subsets for analysis. You can compose fancy text annotations called
tags that dynamically update as the data changes or as you move a tag to a
different data point. Graphs automatically update to take full advantage of the
available space when you resize a graph window.
Igor's 2D graphs are exceedingly flexible. You can create graphs with an
unlimited number of traces, axes, contor plots, images and annotations. You
can embed graphs within other graphs and can compose page layouts with
multiple graphs, tables, annotations and pictures.
Speaking of flexible, Igor's image plots can use any data type from unsigned
byte to double precision complex (complex data is automatically presented as
10
北京环中睿驰科技有限公司
magnitude.) Pixels can even have uneven spacing as with a log axis or user
specified x or y values. Images can be true color or many different forms of false
color. You can even specify what happens for out-of-range data.
You can use Igor's powerful drawing tools to annotate your graphs or page
layouts with lines, arrows, rectangles, Bezier curves and many other types.
Multiple layers are provided and all tools may be used programatically. Unique
to Igor is the ability to specify the coordinate system for draw objects. For
example, you might specify the coordinates of a background shaded area to be
in terms of a pair of axes. This would allow you to zoom or otherwise adjust the
axis ranges but still have the shaded area remain in the correct location relative
to the data.
You can use Igor's annotation editor to create precise and sophisticated text
annotations. Igor goes way beyond simple sub- or superscripts with precise and
flexible layout. Annotations can be designed to automatically respond to
changes in font or size and can dynamically include data values.
You can create visually stunning 3D graphics using Igor's Gizmo and Surface
Plotter modules. Be sure to visit thegallery as well as the 3D graphics web pages
to see these "cool" graphics.
2D graphs
11
北京环中睿驰科技有限公司
IGOR Pro's 2D graph types include highly customizable X-Y (line, marker, area
and bar) plots, contour, image, and category plots. As illustrated by the graph
to the right, you can combine any or all of these forms in a single graph window.
IGOR places no limits on the number of graph objects or the size of your data.
In IGOR, as you expand or shrink a graph window, the graph automatically
takes full advantage of the available space, expanding or shrinking font, marker
and line thickness to optimum values approprate for the new size. Of course,
you can force a graph to specific size or aspect ratio and can override automatic
adjustments.
IGOR's annotation dialog enables you to create arbitrarily complex text boxes,
legends (including color scales) and dynamic tags that can automatically
present data values. Dynamic tags can not only be attached to points on an XY
plot but can even be attached to pixels on an image plot. Tags can be set to
automatically rotate tangent to the point on the curve to which they are
attached.
Graphics Speed
Dramatically faster than competing programs
Graphs refresh almost instantly
Special support for real-time data
Graphics Flexibility
Unlimited number of curves and axes on a graph
Unlimited number of graphs
Precise control of graph features
Customizable dashed lines
Full support for error bars
Text markers and 62 built-in marker symbols, arrows and wind barbs;
user-defined markers
72 fill patterns, positive and negative fills, and fill between curves
Display of date and time data in a wide variety of formats
Fully customizable axes, reciprocal axes
Text annotations with subscripts, superscripts, font and style changes
Text annotations with automatic readout of data values
High-resolution drawing tools
IGOR's graphics are publication-quality, and have graced the pages of
respected scientific journals. You can extensively "tune" the appearance of
graphs to meet the demanding requirements of scientific and engineering
publications.
12
北京环中睿驰科技有限公司
Page layouts
A page layout, or layout for short, is a type of window that you can use to
compose pages containing:
•
•
•
•
•
graphs
tables
annotations (textboxes and legends)
pictures
drawing elements (lines, arrows, rectangles, polygons, etc.)
Each layout represents one page. You can have as many layouts as memory
allows. Here is an example of a layout window.
13
北京环中睿驰科技有限公司
A page layout has a number of layers. One layer, the layout layer, is for graphs,
tables, annotations and pictures. The other layers are for drawing elements.
Here are the notable features of page layouts.
•
•
•
•
•
You can combine graphs, tables, pictures, annotations and drawing elements.
Graphs, tables and legends in layouts are updated automatically.
Complex graphs can be quickly and smoothly positioned.
Layouts print at the full resolution of the printer.
You can export all or part of a layout to another program.
There are two ways to add a graph or table to the layout layer:
•
•
By creating a graph or table object. An object is a representation of a separate
standalone graph or table window.
By creating an embedded graph or table subwindow. A subwindow is a
self-contained graph or table embedded in a layout window.
2.4 图形处理方法
Image Processing
IGOR Pro contains a full set of operations and functions for scientific image
analysis applications which make it an ideal cross-platform tool for image
acquisition, display and processing.
Image acquisition can be as simple as loading multi-dimensional data from disk
file or as complicated as using an XOP to grab live video frames to disk (see XOP
Toolkit for information on creating your own XOP). In both cases the images can
be displayed on the screen for visual inspection and analysis or they could be
automatically analyzed without user intervention. The processing and analysis
stage depends on the nature of the images and the information of interest.
The main component of the image processing tools are the ImageXXX
operations which are supplemented by the image processing procedure files.
The latter are combined as the Image Processing Package which you can load
from Analysis menu. In addition to the dedicated ImageXXX operations you can
also take advantage of general analysis functions such as FFT and curve fitting
in image processing applications. Rounding up the list of built-in operations is
MatrixOP which provides efficient means for formulating and performing
mathematical operations on images.
14
北京环中睿驰科技有限公司
Image display can be as simple as placing an RGB image in a graph window or
as complicated as creating an overlay of multiple images combined with contour
lines and legend. Being able to display images in false color or using a non-linear
level mapping is sometimes helpful when trying to visually analyze images.
The conventional approach to image processing involves the following steps:
(1) image transformations and color conversions where the acquired image is
converted into standard form in colorspace and in range.
(2) Image filtering (cleaning up the image to improve S/N ratio) can be
accomplished using localized filters or mathematical transforms.
(3) Threshold operation to convert the image from a gray-scale to a binary
form.
(4) Morphological filtering usually follows the threshold operations but some
morphological operations can actually precede the threshold step. Typical
morphological filters include: erosion/dilation, opening/closing, tophat and
watershed.
(5) Particle analysis is the operation where the filtered binary image is analyzed
by quantifying various spatial properties of different "particles" (i.e., spots or
regions) in the image. The spatial measurements include location, area,
perimeter and moments for calculating a fitting ellipse.
Image Transforms
Image transforms can be simple arithmetic operations on images or complex
mathematical operations which convert images from one representation to
another.
Mathematical Operations include simple image arithmetic, Fourier, fast Hartley
transform, Hough transform and Radon transform.
Histogram Modification include histogram equalization and adaptive histogram
equalization.
Image Interpolation includes various methods for scaling, Kriging, image
warping and radial aberration correction.
Image Registration is a tool for registering two 2D or 3D similar images and
finding an affine transformation that can be used to convert one into the other.
The operation is suitable for registering medical images of the same object.
15
北京环中睿驰科技有限公司
Background Removal is a process to correct an image for non-uniform
background or non-uniform illumination.
Image Rotation is a simple tool to rotate an image about its center by the
specified number of degrees.
Mathematical Transformations
Mathematical transformations of images may be as simple as image arithmetic
or as complex as an iterating Fourier transform. You can handle most image
arithmetic by executing IGOR commands. For example, to subtract a
background image:
Duplicate noisyImage,outputImage
outputImage=inputImage-backgroundImage
When working with images that are 8 or 16 bit per pixel you can perform level
mapping using
outputImage=LUT[inputImage[p][q]]
here LUT is a lookup table for the mapping. For example, LUT can be used for
Gamma correction using an expression like
LUT=p^(1/Gamma)
Most arithmetic operations are performed more efficiently using MatrixOP.
Fourier Transforms
The Fast Fourier Transform (FFT) can be used to decompose a grayscale image
into its spatial frequency components or to perform efficient 2D convolutions
and correlations (RGB images are usually handled on a channel by channel
basis).
In the following example we illustrate simple FFT filtering. We created an image
that consists of a one dimensional slow quadratic ramp and added single
frequency sinusoidal noise. The filter consists of a 2D constant wave with a
single null pixel. The filtering consists of a single command line:
MatrixOP/o filtered=IFFT(filter*FFT(inputImage,2),3)
16
北京环中睿驰科技有限公司
The input is shown on the top right, the filtered image is shown on the top-left.
The blue lines mark the position of measured line profiles which are displayed
below the images.
After an image has been filtered by convolution with some filter, it is not always
possible to recover the original from the filtered version. One approach for
deconvolution is known as a Wiener filter:
Create the Gaussian blur filter
Make/O/N=(512,512) blur=exp(-((x-255)/9)^2-((y-255)/9)^2)
Perform the convolution and add uniform noise
MatrixOP/O blurredImage=IFFT(FFT(lena,2)*FFT(blur,2),3)
ImageTransform swap blurredImage
blurredImage+=enoise(2)
17
北京环中睿驰科技有限公司
Lena's picture using a Gaussian blur and uniform additive noise.
The Wiener filter has the form:
Estimated Image = O*Hc/[H*Hc+ fn/fs]
where O is the Fourier transform of the convolved image, H is the Fourier
transform of the convolution filter, Hc is the complex conjugate of H, and fn/fs
is the ratio of the noise to signal power spectra. The Weiner filter is designed to
minimize the mean square error of a linear estimate. The difficulty of applying
the filter is in finding the appropriate values for fn/fs since the noise is not
usually known. In practice one can frequently replace fn/fs with a constant
value that applies over the whole image or try to estimate the value on a region
by region basis.
MatrixOP/O estimated=IFFT(FFT(blurredImage,2)*h/(h*hc+0.04),3)
ImageTransform swap estimated
18
北京环中睿驰科技有限公司
Recovered image using Wiener filtering.
The Wavelet Transform
The wavelet transform is used primarily for smoothing, noise reduction and
lossy compression. In all cases the procedure is to first perform a forward
wavelet transform, then perform some operation on the transformed image
followed by an inverse wavelet transform. In wavelet compression, for example,
the compressed image is the part of the transform that corresponds to the low
order coefficients in the transform (similar to low pass filtering in 2D Fourier
transform). The reconstructed image exhibits a number of compression-related
artifacts, but it is worth noting that unlike an FFT based low-pass filter, the
advantage of the wavelet transform is that the image contains a fair amount of
high-frequency content.
To illustrate the application of the wavelet transform to de-noising, we start
by adding artificial noise to an image:
Mri+=gnoise(10)
19
北京环中睿驰科技有限公司
To denoise the image we use:
DWT/D/N=20/P=1/T=1/V=0.3 Mri,dMri
denoising
// increase /V for more
The denoised image showing significant noise reduction at the cost of minor
wavelet transform artifacts.
Hough Transform
The Hough Transform is a mapping algorithm in which lines in image space map
to single points in the transform space. It is most often used for line detection.
Specifically, each point in the image space maps to a sinusoidal curve in the
transform space. If pixels in the image lie along a line, the sinusoidal curves
20
北京环中睿驰科技有限公司
associated with these pixels all intersect at a single point in the transform space.
By counting the number of sinusoids intersecting at each point in the transform
space, lines can be detected. Here is an example of an image that consists of
one line.
The source image shows a series of bright pixels in the center. The first and last
points are transformed into lines at 0 and 180 degrees. The second point from
the top corresponds to the line at 45 degrees and so on.
Hartley Transform
The Hartley transform is similar to the Fourier transform except that it uses only
real values. The transform is based on the cas kernel defined by:
cas(vx) = cos(vx) + sin(vx).
The discrete Hartley transform is given by
The Hartley transform has two interesting mathematical properties. First, the
inverse transform is identical to the forward transform, and second, the power
spectrum is given by the expression:
21
北京环中睿驰科技有限公司
The implementation of the Fast Hartley Transform is part of the
ImageTransform operation. It requires that the source wave is an image whose
dimensions are a power of 2.
2.5 数据分析方法
Data Analysis
"Data analysis" derives meaning or significance from raw data: it answers
questions like "how much?", "how high?", or "how often?". Since Igor aims to
serve a wide range of disciplines, it provides many analysis capabilities to
choose from. We present them here in our somewhat arbitrary categories:
Curve Fitting
Linear and non-linear fits
Built-in and user-defined functions
Multi-variate fits involving unlimited independent variables
Peak Analysis
Peak and level-crossing detection
Fitting multiple overlapping peaks
Baseline removal
Signal Processing
Multi-dimensional mixed-radix FFT, wavelet, Hough transforms
Integration and differentiation of data
Convolution and correlation
Smoothing and filtering
Statistics
Descriptive statistics such as mean, standard deviation and higher
central moments
22
北京环中睿驰科技有限公司
Statistical Tests
Probability Distribution Functions, Cumulative Distribution
Functions and Inverse CDFs
Histograms, Sorting, Resampling, Correlations and Linear Regression
2.6 数据操作和数学方法
Data Manipulation and Math
IGOR provides an extensive library of math and data manipulation routines and
IGOR's array-oriented arithmetic make complex operations a snap.
IGOR provides all the mathematical operators and functions you would expect --
and then some. You can quickly find the desired function or operation using
IGOR's handy help browser as illustrated to the right.
Many of IGOR's algorithms are from Numerical Recipes and the LAPACK
numerical library.
Array arithmetic is the most flexible and powerful part of Igor's analysis
capability. It allows you to write assignment statements that work on an entire
Array or on a subset of an Array much as you would write an assignment to a
single variable in a standard programming language.
23
北京环中睿驰科技有限公司
You can access all of the most common operations via easy-to-use dialogs.
Later, as you learn from watching as the dialogs synthesize commands, you can
type directly on IGOR's command line or write routines to perform specialized
operations.
By way of example, here are the command lines that create the data and the
image plot shown on the right:
Make/N=(150,150) data1 // create a 150x150 array
SetScale x,-1.5,1.5, data1 // set x and ...
SetScale y,-1.5,1.5, data1 // ... y scaling
data1= exp(-(x^2 + y^2)) // operation on entire array
NewImage data1 // display the results
ModifyImage data1 ctab= {*,*,Rainbow,0}
The dialog that created the last command can be viewed here.
In addition to array arithmetic, IGOR also provides a matrix math facility that
makes it easy to perform matrix manipulations such as matrix multiply and dot
product using a natural syntax.
Here are some of the data manipulation methods provided in IGOR:
Interpolation
Igor has a number of interpolation tools that are designed for different
applications. One dimensional data (vectors) can be interpolated
using linear, cubic spline and smoothing spline methods. 2D (matrix)
data can use bilinear, splines, Kriging and Voroni while 3D (volume)
data can be treated with trilinear and barycentric methods.
Integration and Differentiation
The Differentiate and Integrate operations provide a number of
algorithms for operation on one-dimensional waveform and XY data.
These operations can either replace the original data or create a new
data set with the results. The easiest way to use these operations is via
dialogs available from the Analysis menu. These handy dialogs even
24
北京环中睿驰科技有限公司
provide for graphing the results.
Sorting
Sort operation sorts one or more 1D numeric or text data sets in
ascending or descending order. Multiple sort keys are supported (for
cases where the first key has identical values). MakeIndex and
IndexSort are also provided for extra flexibility.
Extraction
The Extract operation makes it easy to extract subsets of data that
correspond to specific criteria. For example,
Extract/O source,dest,source>10 && source<20
creates a new data set named dest containing values from soruce that
are between 10 and 20. You can also find the index values where the
expression is true so you can access the subset in place.
Smoothing
Igor has three built-in algorithms. Each one effectively precomputes
smoothing coefficients according to the smoothing parameters, and
then replaces each data wave with the convolution of the wave with
the coefficients. The bulit-in methods are:
•
Binomial Smoothing: The Binomial smoothing operation is a Gaussian
filter. It is the sharpest filter that will not cause ringing on a step or
impulse.
•
Savitzky-Golay Smoothing: Savitzky-Golay smoothing uses a different
set of precomputed coefficients popular in the field of chemistry. It is a
type of Least Squares Polynomial smoothing. The amount of smoothing
is controlled by two parameters: the polynomial order and the number of
points used to compute each smoothed output value.
•
Box Smoothing: Box smoothing is similar to a moving average, except
that an equal number of points before and after the smoothed value are
averaged together with the smoothed value.
In addition to built-in smoothing, you can perform smoothing (or any
other finite impulse response type filter) using your own coefficients with
the SmoothCustom operation. Each smooth type, including
SmoothCustom, can pick from several end-effect algorithms
2.7 数据分析函数
Igor includes several operations that work on functions rather than discrete
data points. These operations include
25
北京环中睿驰科技有限公司
Plotting of functions
Making a graph of a
function in Igor is easy. For
simple expressions, use
arithmetic expressions
entered on the command
line. Igor's programming
language allows arbitrarily
complex non-linear
functions expressed as
user-defined functions that
can be used to make a
graph.
Differential Equations
Numerically solve ordinary
differential equations,
making possible
simulations of dynamic
systems.
Optimization
Use the Optimize operation to find minima and maxima of functions expressed
using Igor's built-in language. Optimize functions of any number of dimensions,
using a choice of methods including simulated annealing.
Function Roots
Use the FindRoots operation to find roots of functions expressed using Igor's
built-in language. You can use Igor to find N-dimensional roots of systems of
equations.
The FindRoots operation can also be used to find complex roots of polynomials.
Integration of Functions
Find numeric integrals of continuous functions using a choice of methods. By
nesting integrations, you can integrate an N-dimensional function.
26
北京环中睿驰科技有限公司
2.8 图形数据探测(Exploration)
Because IGOR's 2D graphs are so fast, you can quickly explore large data sets
by zooming in and out on portions of a graph. You can drag a marqee selection
around an area of interest and then click in the center to access a popup menu
to expand or contract about that area. Here is an example:
And here is the result after choosing expand:
27
北京环中睿驰科技有限公司
Before choosing the popup menu, you can adjust the selection by dragging the
marquee's handles. After zooming in on a region of interest, you can pan around
in all directions.
Starting with version 6.1, you can hover your mouse over a point on an axis and
use the mouse wheel to zoom in or zoom out about that point.
An even zippier tool is provided as a bulit-in procedure package that makes an
copy of your graph with an expanded view of your data that follows the cursor
as you move the mouse pointer over the original graph. You can experience the
quickness of this tool for yourself by downloading the demo version of IGOR
(anonymous download -- no registration or forms to fill out) and then following
these instructions:
1. Start IGOR and either:
a. Load and graph your own data or
b. Load any of the example experiments with graphs of large data sets
or
c. Create synthetic data by copying
d. Make/N=10000 data1;SetScale x,0,10e-3,"s",data1
e. data1= 2+2*cos(x*300)+10*exp(-(1e4*(x-3e-3))^2) +
1*exp(-(1e4*(x-6e-3))^2) + 0.3*exp(-(1e4*(x-6.2e-3))^2) +
gnoise(0.03)
f. Display data1
...and then executing them in IGOR. In IGOR, type CTRL-J (Windows,
cmd-J Mac) to bring the command window forward, paste and then
press return.
2. With the graph frontmost, from the menu bar, choose
Graph->Packages->Graph Magnifier.
3. In the resulting control panel, click Do It.
4. Move your mouse over the data in the original graph.
5. When finished exploring, click the Done button that was added to your
original graph.
Info Box and Cursors
You can put an information box on a graph by choosing Show Info from the
Graph menu while the graph is the target window. An info box displays a precise
readout of values and also provides a convenient way to specify a region of
interest for operations such as curve fitting.
28
北京环中睿驰科技有限公司
Here is an example of the Info box and cursors on an XY plot:
And the following example shows that cursors can also be placed on image
plots:
When cursors are placed on image or waterfall plots, z and delta-z values are
added to the info box.
29
北京环中睿驰科技有限公司
A variety of cursor styles are provided. Cursors may be attached to data points
or may be free to roam throughout the plot area.
You can move cursors in several ways. In addition to the slider control shown in
the examples, you can use the mouse to drag cursors to different points or
different traces or images. Each graph window can have its own info box and
cursors.
2.9 用户再编程
Programming
IGOR Pro includes a powerful and full-featured structured programming
language that you can use for automation of data import, file I/O, analysis, data
acquisition, graphing, drawing, printing, and just about anything you can think
of. You can add menus to the program and create control panels containing
buttons, checkboxes, popup menus, and other controls to set parameters or
display results.
IGOR Pro aids you in your programming tasks with syntax coloring< and a
symbolic debugger that will help you efficiently troubleshoot your code.
IGOR Pro ships with many examples illustrating (among other things) peak
fitting, signal processing, data acquisition, test automation, and graphing
techniques.
Programmability
Complete built-in structured programming language
Over 450 built-in functions and 400 built-in operations
Many additional functions and operations supplied by XOPs and
WaveMetrics-authored user procedures
Symbolic debugger
User-definable math and string functions
All aspects of IGOR Pro can be programmed
Controllable by external scripting systems
Syntax coloring in procedures
Integrated help and documentation
Search across multiple program source files
30
北京环中睿驰科技有限公司
2.10 用户接口
You can easily create custom interfaces to accomplish specialized tasks. Igor´s
dialogs and contextual menus make it easy to construct a user interface to
specialized analysis code.
Available Customizations
•
•
•
•
Create control panels and graphs with controls that implement custom
behavior using Igor´s built-in programming language.
Add your own menus or modify Igor´s menus.
Create custom help for other users.
Write "external operations" in C or C++ to add special windows to Igor or to
control or acquire data from instruments.
Examples of custom interfaces are shipped with Igor. You can find them in the
File->Examples menu. Some major features of Igor are implemented using a
custom interface like the ones you can build, among them the Image Processing
and Polar Graphs packages:
31
北京环中睿驰科技有限公司
32