EPIX, Inc. Home Page

Image Processing Library V2.2
Reference Manual

Contents

 1.  Getting Started...........................................................................    4
     1.A   Installation........................................................................    4
     1.B   Organization........................................................................    4
     1.C   Compiling...........................................................................    5
           1.C.1  Stack........................................................................    7
           1.C.2  Heap.........................................................................    7
           1.C.3  Example: Microsoft C/C++.....................................................    7
           1.C.4  Example: Borland C/C++.......................................................    8
           1.C.5  Example: Watcom 32 Bit C/C++.................................................    8
           1.C.6  Example: TI TMS320C40 C......................................................    8
     1.D   Inclusions..........................................................................    9
     1.E   Common Types and Structures.........................................................    9
           1.E.1  Coordinates, Images, and Image Window Structures.............................   10
           1.E.2  Image Region Structures......................................................   12
     1.F   Running.............................................................................   12
           1.F.1  Error Codes..................................................................   12
           1.F.2  Multiple Imaging Boards &Their Buffers......................................   12
           1.F.3  Imaging Boards &Processing Speed............................................   13
           1.F.4  Math Coprocessors............................................................   13
           1.F.5  On Color(s)..................................................................   13

 2.  Support Functions.........................................................................   14
     User-Defined Premature Termination Functions - pxabortfunc_t..............................   14
     Get PXIMAGE: Access Imaging Board Buffer - pxd_defimage...................................   15
     Get PXIMAGE: Access Imaging Board Color Buffer - pxd_defimagecolor........................   15
     Construct PXIMAGE: Access Imaging Board Buffer - pxvid_setpximage.........................   17
     Construct PXIMAGE: Access Imaging Board Buffer - pxvid_setpximage2........................   17
     Construct PXIMAGE3: Access Imaging Board Buffers - pxvid_setpximage3......................   20
     Construct PXIMAGE: Access Image in Host Memory - pximage_memory...........................   21
     Construct PXIMAGE: Access Image in Malloc'ed Memory - pximage_memmalloc...................   23
     Construct PXIMAGE: Release Image in Malloc'ed Memory - pximage_memfree....................   23
     Construct PXIMAGE: Access Image in File - pximage_file....................................   24
     Construct PXIMAGE: Access Image in File, Done - pximage_filedone..........................   24
     Construct PXIMAGE: Slice of Color Image - pximage_colorslice..............................   26
     Errors: Translate Error Code to String - pxerrnomesg......................................   27

 3.  Contrast Enhancement &Threshold..........................................................   28
     Contrast Enhance - pxip8_pixcontrast......................................................   28
     Contrast Enhance By Percentile - pxip8_pixcontrastperc....................................   29
     Threshold Pixel Values - pxip8_pixthreshold...............................................   30
     Threshold Pixel Values - pxip8_pixthreshold2..............................................   30

 4.  Simple Pixel Operations...................................................................   32
     Set Pixel Values - pxip8_pixset...........................................................   32
     Set Color Pixel Values - pxip3_pixset.....................................................   33
     AND Pixels with Mask - pxip8_pixand.......................................................   33
     OR Pixels with Mask - pxip8_pixor.........................................................   33
     XOR Pixels with Mask - pxip8_pixxor.......................................................   33
     Complement Pixel Values - pxip8_pixneg....................................................   33
     Scale Pixel Values - pxip8_pixscale.......................................................   35
     Shift Pixel Values - pxip8_pixadd.........................................................   35
     Map Uchar Pixel Values - pxip8_pixmap.....................................................   36
     Map Ushort Pixel Values - pxip8_pixmaps...................................................   36
     Map Ulong Pixel Values - pxip8_pixmapl....................................................   36

 5.  Histograms &Computations.................................................................   38
     Compute Histogram - pxip8_histab..........................................................   38
     Compute Tabulated Histogram - pxip8_histab2...............................................   39
     Compute Histogram Statistics - pxip8_histstat.............................................   40
     Compute Histogram Statistics - pxip8_histstat2............................................   40
     Compute Histogram Statistics w. Interpretation - pxip8_histstatf..........................   40
     Compute Histogram Statistics w. Interpretation - pxip8_histstat2f.........................   40
     Count Pixels by Threshold - pxip8_pixthresholdcnt.........................................   42
     Compute Center of Mass - pxip8_masscenter.................................................   43
     Compute Moments - pxip8_moments...........................................................   44
     Compute Moments w. Interpretation - pxip8_momentsf........................................   46
     Compute Center of Mass, Binary Image - pxip8_binmasscenter................................   47

 6.  Filtering Operations......................................................................   49
     Filter, Low Pass, Weighted - pxip8_3x3lowpass.............................................   49
     Filter, Low Pass, Fixed - pxip8_3x3lowpassf...............................................   49
     Filter, Low Pass, Low Smear - pxip8_3x3lowpassmear........................................   50
     Filter, Sharpen, Laplacian - pxip8_3x3sharpenl............................................   51
     Filter, Median - pxip8_3x3median..........................................................   52
     Filter, Median, Weighted - pxip8_3x3medianw...............................................   53
     Filter, Median, Binary Images - pxip8_3x3binmedian........................................   54
     Filter, Rank Low (Erode) - pxip8_3x3ranklow...............................................   55
     Filter, Rank High (Dilate) - pxip8_3x3rankhigh............................................   55

 7.  Edge Detection Operations.................................................................   56
     Edge Detection, Kirsch - pxip8_3x3kirsch..................................................   56
     Edge Detection, Roberts - pxip8_2x2roberts................................................   56
     Edge Detection, Sobel - pxip8_3x3sobel....................................................   56
     Edge Detection, Sobel Absolute - pxip8_3x3sobela..........................................   56
     Edge Gradient, Thin - pxip8_3x3ksrthin....................................................   58

 8.  Image Pair Operations.....................................................................   60
     Contrast Match Image Pair - pxip8_contrastmatch...........................................   60
     Add Pixels of Image Pair - pxip8_pairadd..................................................   61
     Subtract Pixels of Image Pair - pxip8_pairsub.............................................   62
     Exclusive OR Pixels of Image Pair - pxip8_pairxor.........................................   63
     AND Pixels of Image Pair - pxip8_pairand..................................................   63
     OR Pixels of Image Pair - pxip8_pairor....................................................   63
     Average Pixels of Image Pair - pxip8_pairave..............................................   63
     Difference for Insert of Image Pair - pxip8_pairinsdiff...................................   64
     Insert of Differences of Image Pair - pxip8_pairinsert....................................   64
     Product of Pixels of Image Pair - pxip8_pairprod..........................................   65
     Ratio of Pixels of Image Pair - pxip8_pairratio...........................................   65

 9.  Morphological Operations..................................................................   68
     Morphology Erosion w. 3x3 Element - pxip8_morperode3x3....................................   68
     Morphology Dilation w. 3x3 Element - pxip8_morpdilate3x3..................................   68
     Morphology Erosion - pxip8_morperode......................................................   69
     Morphology Dilation - pxip8_morpdilate....................................................   69
     Morphology Open - pxip8_morpopen..........................................................   69
     Morphology Close - pxip8_morpclose........................................................   69
     Morphology Hit-Miss - pxip8_morphitmiss...................................................   69
     Medial Axis Thinning - pxip8_binmaxisthin.................................................   73

10.  Image Sequence Operations.................................................................   75
     Integrate Image Sequence - pxip8_integratebufs............................................   75
     Average Image Sequence - pxip8_averagebufs................................................   75
     Tile Image Sequence - pxip8_seqtile.......................................................   76

11.  File Load and Saves.......................................................................   78
     Save Image to File - pxio8_binwrite.......................................................   78
     Load Image from File - pxio8_binread......................................................   78
     Save Image to File, 1 Bit/Pixel - pxio8_bin1write.........................................   79
     Load Image from File, 1 Bit/Pixel - pxio8_bin1read........................................   79
     Save Image to File, Hex ASCII - pxio8_hexwrite............................................   81
     Load Image from File, Hex ASCII - pxio8_hexread...........................................   81
     Save Image to TIFF File - pxio8_tiffwrite.................................................   82
     Load Image from TIFF File - pxio8_tiffread................................................   82
     Load Image from TIFF File and Resize - pxio8_tiffreadrsz..................................   82
     Obtain Information about TIFF Image - pxio8_tiffparm......................................   86
     Release Information about TIFF Image - pxio8_tiffparmr....................................   86

12.  NxN Neighborhood Operations...............................................................   88
     NxN Convolution, Integer - pxip8_NxNconvolve..............................................   88
     NxN Convolution, Real - pxip8_NxNconvolvef................................................   88
     NxN Dynamic Threshold - pxip8_NxNdynthreshold.............................................   90
     NxN Inverse Contrast Ratio Mapping - pxip8_NxNcontrastinvert..............................   91

13.  Image Copy &Resize.......................................................................   93
     Copy Image Buffer - pxip8_copy............................................................   93
     Copy Image Buffer with Reversal - pxip8_copyreverse.......................................   94
     Copy Image Buffer with Shift - pxip8_copyshift............................................   95
     Copy &Exchange Image Buffers - pxip8_copyexchange........................................   96
     Copy &Bilinear Interpolation w. Orientation - pxip8_copyinterpbilinear...................   96
     Copy &Nearest Neighbor Interpolation w. Orientation - pxip8_copyinterpnearest............   96
     Copy &Area Interpolation - pxip8_copyinterpolate.........................................   98
     Copy Image with Rotation - pxip8_geotranrotate............................................   99
     Copy Image with Warping - pxip8_geotranwarp...............................................  101
     Copy &Skew Image Left/Right - pxip8_copyskewlr...........................................  102
     Copy &Skew Image Up/Down - pxip8_copyskewud..............................................  102
     Copy &Spatial Replicate - pxip8_spatialreplic............................................  103

14.  Transform Operations......................................................................  105
     Transform Image: FFT - pxip8_fft..........................................................  105
     Transform Image: Inverse FFT - pxip8_ffti.................................................  106
     Log Magnitude Plot of Freq. Domain - pxip8_fftlogmag......................................  107
     Scale Freq. Domain by Log Magnitude Plot - pxip8_fftlmagscale.............................  108
     Filter Frequency Domain - pxip8_fftfilterz................................................  109
     Get Dimensions of Freq. Domain Representation - pxip8_fftsizes............................  111
     Construct PXIMAGE: Access Freq. Domain Complex Image - pxip8_fftcimage....................  111

15.  Correlation Operations....................................................................  113
     Correlation Profile - pxip8_correlateprof.................................................  113

16.  Interlace Shuffle Operations..............................................................  115
     Field Interlaced Image Line Shuffle - pxip8_ilacelinetofield..............................  115
     Field Interlaced Image Line UnShuffle - pxip8_ilacefieldtoline............................  115
     De-Flicker Interlace: Line Pair Average - pxip8_ilacepairave..............................  117
     De-Flicker Interlace: Modify Singularities - pxip8_ilacemodsingular.......................  118
     Swap Line or Column Pairs - pxip8_ilacepairswap...........................................  119
     Line Pair Pixel Shuffle - pxip8_xlaceshuffle..............................................  121
     Line Pair Pixel UnShuffle - pxip8_xlaceunshuffle..........................................  121

17.  Imaging Board Specific Operations.........................................................  123
     Windows: Waterfall Image Buffer Line on Device Context - pxio8_WaterfallToDevice..........  123

18.  Nonrectangular Regions - Support Functions................................................  125
     PXIMREGION: NonRectangular Image Region Specification - struct pximregion.................  125
     Modify Region Definition: Rectangle to Polygon - pxirp_xlaterecttopoly....................  130
     Translate Region Definition to Scan List - pxirp_xlatetoscanlist..........................  130
     Translate Region Definition to Path - pxirp_xlatetopath...................................  131
     Find Region's Enclosing Window - pxirp_regionbounds.......................................  132
     Find Region's Enclosed Area - pxirp_regionarea............................................  133
     Free Region - pxrip_regionfree............................................................  134
     Scan, Connect, Collect Region by Table - pxirp8_connectregion.............................  134
     Scan, Connect, Collect Region by Value - pxirp8_connectregionv............................  134
     Follow and Collect Region Boundary by Value - pxirp8_followregionv........................  136
     Initialize Region Path - pxirp_pathcreate.................................................  138
     Extend Region Path - pxirp_pathextend.....................................................  138
     Extend Region Path - pxirp_pathextend1....................................................  138
     Compress Region Path - pxirp_pathcompress.................................................  139

19.  Nonrectangular Regions - Draw &Paint.....................................................  141
     Draw Region Boundary - pxirp8_drawboundary................................................  141
     Paint within Region - pxirp8_paintregion..................................................  142
     Draw Region Path - pxirp8_drawpath........................................................  144

20.  Nonrectangular Regions - Contrast Enhancement &Threshold.................................  146
     Contrast Enhance Region - pxirp8_pixcontrast..............................................  146
     Contrast Enhance Region By Percentile - pxip8_pixcontrastperc.............................  147
     Threshold Pixel Values in Region - pxirp8_pixthreshold....................................  148
     Threshold Pixel Values in Region - pxirp8_pixthreshold2...................................  148

21.  Nonrectangular Regions - Simple Pixel &Copy Operations...................................  150
     Set Pixel Values in Region - pxirp8_pixset................................................  150
     AND Pixels in Region with Mask - pxirp8_pixand............................................  151
     OR Pixels in Region with Mask - pxirp8_pixor..............................................  151
     XOR Pixels in Region with Mask - pxirp8_pixxor............................................  151
     Complement Pixel Values in Region - pxirp8_pixneg.........................................  151
     Scale Pixel Values in Region - pxirp8_pixscale............................................  152
     Shift Pixel Values in Region - pxirp8_pixadd..............................................  152
     Map Uchar Pixel Values in Region - pxirp8_pixmap..........................................  153
     Map Ushort Pixel Values in Region - pxirp8_pixmaps........................................  153
     Map Ulong Pixel Values in Region - pxirp8_pixmapl.........................................  153
     Copy Image Buffer Region - pxirp8_copy....................................................  154

22.  Nonrectangular Regions - Histograms &Computations........................................  156
     Compute Histogram on Region - pxirp8_histab...............................................  156
     Compute Histogram on Region - pxirp8_histab...............................................  157
     Count Region Pixels by Threshold - pxirp8_pixthresholdcnt.................................  158
     Compute Center of Mass of Region - pxirp8_masscenter......................................  159
     Compute Moments of Region - pxirp8_moments................................................  160
     Compute Moments of Region w. Interpretation - pxirp8_momentsf.............................  160
     Compute Center of Mass, Binary Image Region - pxirp8_binmasscenter........................  161
     Compute Shape Statistics of Image Region - pxirp_regionshapef.............................  162

23.  Nonrectangular Regions - Find Blobs.......................................................  165
     Find Blobs and List - pxip8_bloblist......................................................  165
     Find Blobs, Analyze and List - pxip8_bloblist2............................................  168

24.  Characters, Lines, Icons &Patterns.......................................................  170
     Draw Line of Characters - pxip8_drawchars.................................................  170
     Load PCL Font - pxip8_pclfontload.........................................................  172
     Draw Line of PCL Font Characters - pxip8_pclfontdraw......................................  173
     Obtain PCL Font Information - pxip8_pclfontinfo...........................................  177
     Obtain PCL Font Character Info - pxip8_pclfontcinfo.......................................  177
     Unload PCL Font - pxip8_pclfontunload.....................................................  178
     Draw Icon or Cursor - pxip8_drawicon......................................................  178
     Draw Line Segment - pxip8_drawline........................................................  180
     Draw Box - pxip8_drawbox..................................................................  180
     Draw Curved Line defined as Bezier Polynomial - pxip8_drawbezier..........................  182
     Draw Ellipse - pxip8_drawellipse..........................................................  183
     Draw Alignment Pattern - pxip8_patternalign...............................................  185
     Draw 2-D Separable Patterns - pxip8_patterns..............................................  186
     Draw 2-D Cosine Product Pattern - pxip8_patterncos........................................  187
     Draw 2-D Gaussian Pattern - pxip8_patterngaussian.........................................  188
     Draw 2-D Fiducial Pattern - pxip8_patternfiducial.........................................  189
     Draw Arrow - pxip8_drawarrow..............................................................  190

25.  Spatial and Intensity Calibration.........................................................  193
     Calibrate Spatial Mapping - pxip_calibxyhv................................................  193
     Release Spatial Mapping State - pxip_calibxyhvdone........................................  194
     Perform Spatial Mapping - pxip_calibxyhvmap...............................................  194
     Perform Inverse Spatial Mapping - pxip_calibhvxymap.......................................  194
     Calibrate Intensity/Density Mapping - pxip_calibzi........................................  195
     Release Intensity/Density Mapping State - pxip_calibzidone................................  197
     Perform Intensity/Density Mapping - pxip_calibzimap.......................................  197

26.  Image Normalizations......................................................................  199
     Spatial Intensity Normalization - pxip8_normalizeintensity................................  199
     Normalize Image as per Background Image - pxip8_normalizebackground.......................  200
     Correct Image as per Speckle Mask - pxip8_normalizespecklemask............................  201
     Histogram Equalization - pxip8_histfit....................................................  202
     Normalize Lines' Mean - pxip8_normalizelinemean...........................................  203
     Normalize Columns' Mean - pxip8_normalizecolmmean.........................................  203

27.  Miscellaneous Operations..................................................................  205
     Spatial Quantization &Shrink - pxip8_spatialquantize.....................................  205
     Dither Pixels, Uniform - pxip8_dither.....................................................  206
     Dither Pixels, Normal - pxip8_dithernormal................................................  206
     Halftone by Black/White Sum - pxip8_halftsum..............................................  207
     Decode SMPTE Vertical Interval Time Code - pxip8_smptevitcdecode..........................  208
     Search for Pixel by Table - pxip8_findpixel...............................................  210
     Search for Pixel by Value - pxip8_findpixelv..............................................  210
     Subpixel Edge Measurement - pxip_fractedges...............................................  212
     Track Particle Motion - pxip_particleflow.................................................  214
     Print Image - pxio8_print.................................................................  217
     Windows: Copy Image to Device Context - pxio8_CopyToDevice................................  221
     Windows: Get Image to Device Context Coordinates - pxio8_CopyToDeviceCoord................  221

28.  Bound COC40 Operations....................................................................  224
     28.A  Compiling...........................................................................  224
     COC40: Count Pixels by Threshold - m4c40ip8_pixthresholdcnt...............................  225
     COC40: Compute Histogram - m4c40ip8_histab................................................  226
     COC40: Compute Tabulated Histogram - m4c40ip8_histab2.....................................  226
     COC40: Compute Center of Mass - m4c40ip8_masscenter.......................................  227
     COC40: Compute Center of Mass, Binary Image - m4c40ip8_binmasscenter......................  227
     COC40: Compute Moments - m4c40ip8_moments.................................................  228
     COC40: Compute Moments w. Interpretation - m4c40ip8_momentsf..............................  228
     COC40: Threshold Pixel Values - m4c4ip8_pixthreshold2.....................................  229
     COC40: Normalize Image as per Background Image - m4c40ip8_normalizebackground.............  230
     COC40: Copy &Bilinear Interpolation w. Orientation - m4c40ip8_copyinterpbilinear.........  231
     COC40: Copy &Nearest Neighbor Interpolation w. Orientation - m4c40ip8_copyinterpnearest..  231
     COC40: Find and List Blobs - m4c40ip8_bloblist............................................  232
     COC40: NxN Convolution, Integer - m4c40ip8_NxNconvolve....................................  233
     COC40: NxN Convolution, Real - m4c40ip8_NxNconvolvef......................................  233
     COC40: Edge Detection, Kirsch - m4c40ip8_3x3kirsch........................................  234
     COC40: Edge Detection, Roberts - m4c40ip8_2x2roberts......................................  234
     COC40: Edge Detection, Sobel - m4c40ip8_3x3sobel..........................................  234
     COC40: Edge Detection, Sobel Absolute - m4c40ip8_3x3sobela................................  234
     COC40: Edge Gradient, Thin - m4c40ip8_3x3ksrthin..........................................  234
     COC40: Correlation Profile - m4c4ip8_correlateprof........................................  235
     COC40: Transform Image: FFT - m4c40ip8_fft................................................  236
     COC40: Transform Image: Inverse FFT - m4c40ip8_ffti.......................................  236
     COC40: Log Magnitude Plot of Freq. Domain - m4c40ip8_fftlogmag............................  236
     COC40: Scale Freq. Domain by Log Magnitude Plot - m4c40ip8_fftlmagscale...................  236
     COC40: Filter Frequency Domain - m4c40ip8_fftfilterz......................................  236
     COC40: Get Dimensions of Freq. Domain Representation - m4c40ip8_fftsizes..................  237
     COC40: Convert Freq. Domain to/from Host Format - m4c40ip8_fftieee........................  238
     COC40: Copy Image with Rotation - m4c40ip8_geotranrotate..................................  239
     COC40: Spatial Quantization &Shrink - m4c40ip8_spatialquantize...........................  240
     COC40: Histogram Equalization - m4c40ip8_histfit..........................................  241
     COC40: Spatial Intensity Normalization - m4c40ip8_normalizeintensity......................  242
     COC40: Filter, Low Pass, Weighted - m4c40ip8_3x3lowpass...................................  243
     COC40: Filter, Low Pass, Fixed - m4c40ip8_3x3lowpassf.....................................  243
     COC40: Filter, Sharpen, Laplacian - m4c40ip8_3x3sharpenl..................................  243
     COC40: Filter, Low Pass, Low Smear - m4c40ip8_3x3lowpassmear..............................  243
     COC40: Contrast Match Image Pair - m4c40ip8_contrastmatch.................................  244
     COC40: Filter, Median - m4c40ip8_3x3median................................................  244
     COC40: Filter, Median, Weighted - m4c40ip8_3x3medianw.....................................  244
     COC40: Filter, Median, Binary Images - m4c40ip8_3x3binmedian..............................  244
     COC40: Morphology Erosion w. 3x3 Element - m4c40ip8_morperode3x3..........................  245
     COC40: Morphology Dilation w. 3x3 Element - m4c40ip8_morpdilate3x3........................  245
     COC40: Filter, Rank Low (Erode) - m4c40ip8_3x3ranklow.....................................  246
     COC40: Filter, Rank High (Dilate) - m4c40ip8_3x3rankhigh..................................  246
     COC40: Add Pixels of Image Pair - m4c40ip8_pairadd........................................  247
     COC40: Subtract Pixels of Image Pair - m4c40ip8_pairsub...................................  247
     COC40: Product of Pixels of Image Pair - m4c40ip8_pairprod................................  248
     COC40: Ratio of Pixels of Image Pair - m4c40ip8_pairratio.................................  248
     COC40: Exclusive OR Pixels of Image Pair - m4c40ip8_pairxor...............................  249
     COC40: AND Pixels of Image Pair - m4c40ip8_pairand........................................  249
     COC40: OR Pixels of Image Pair - m4c40ip8_pairor..........................................  249
     COC40: Average Pixels of Image Pair - m4c40ip8_pairave....................................  249
     COC40: Integrate Image Sequence - m4c40ip8_integratebufs..................................  250
     COC40: Average Image Sequence - m4c40ip8_averagebufs......................................  250

29.  Primitive Operations......................................................................  252
     Draw Icon Primitive, Initialize - pxip8_drawiconinit......................................  252
     Draw Icon Primitive, Modify Pixels - pxip8_drawiconhit....................................  254
     Draw Icon Primitive, Test Completion - pxip8_drawiconhitw.................................  255
     Draw Icon Primitive, Free Resources - pxip8_drawiconfree..................................  256

30.  Release Notes.............................................................................  257

31.  Distribution Contents.....................................................................  267

32.  Index.....................................................................................  269

Back to EPIX Products

Back to the EPIX home page

Image Processing Products For Research and Industry