Woolz Image Processing Version 1.4.0
WlzType.h
Go to the documentation of this file.
00001 #ifndef WLZ_TYPE_H
00002 #define WLZ_TYPE_H
00003 #if defined(__GNUC__)
00004 #ident "University of Edinburgh $Id: 9db1f1507b55e66da73721063d40698470bca0a7 $"
00005 #else
00006 static char _WlzType_h[] = "University of Edinburgh $Id: 9db1f1507b55e66da73721063d40698470bca0a7 $";
00007 #endif
00008 /*!
00009 * \file         libWlz/WlzType.h
00010 * \author       Bill Hill
00011 * \date         April 2001
00012 * \version      $Id: 9db1f1507b55e66da73721063d40698470bca0a7 $
00013 * \par
00014 * Address:
00015 *               MRC Human Genetics Unit,
00016 *               MRC Institute of Genetics and Molecular Medicine,
00017 *               University of Edinburgh,
00018 *               Western General Hospital,
00019 *               Edinburgh, EH4 2XU, UK.
00020 * \par
00021 * Copyright (C), [2012],
00022 * The University Court of the University of Edinburgh,
00023 * Old College, Edinburgh, UK.
00024 * 
00025 * This program is free software; you can redistribute it and/or
00026 * modify it under the terms of the GNU General Public License
00027 * as published by the Free Software Foundation; either version 2
00028 * of the License, or (at your option) any later version.
00029 *
00030 * This program is distributed in the hope that it will be
00031 * useful but WITHOUT ANY WARRANTY; without even the implied
00032 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00033 * PURPOSE.  See the GNU General Public License for more
00034 * details.
00035 *
00036 * You should have received a copy of the GNU General Public
00037 * License along with this program; if not, write to the Free
00038 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00039 * Boston, MA  02110-1301, USA.
00040 * \brief        Defines the Woolz types. These are enumerations and
00041 *               structures which have been typedef'd.
00042 * \ingroup      Wlz
00043 */
00044 
00045 #ifndef WLZ_EXT_BIND
00046 #ifdef  __cplusplus
00047 extern "C" {
00048 #endif /* __cplusplus */
00049 #endif /* WLZ_EXT_BIND */
00050 
00051 /*!
00052 * \typedef      WlzUByte
00053 * \ingroup      WlzType
00054 * \brief        An eight bit unsigned integer.
00055 */
00056 typedef unsigned char WlzUByte;
00057 
00058 /*!
00059 * \typedef      WlzUInt
00060 * \ingroup      WlzType
00061 * \brief        A 32 bit unsigned integer.
00062 */
00063 typedef unsigned int  WlzUInt;
00064 
00065 /*!
00066 * \typedef      WlzLong
00067 * \ingroup      WlzType
00068 * \brief        A 64 bit integer.
00069 */
00070 #ifdef WLZ_EXT_BIND
00071 typedef long  WlzLong;
00072 #else /* WLZ_EXT_BIND */
00073 typedef long long  WlzLong;
00074 #endif /* WLZ_EXT_BIND */
00075 
00076 /*!
00077 * \enum         _WlzGreyType
00078 * \ingroup      WlzType
00079 * \brief        The valid grey value types.
00080 *               Typedef: ::WlzGreyType.
00081 */
00082 typedef enum _WlzGreyType
00083 {
00084   WLZ_GREY_LONG                 = 0,    /*!< Signed WlzLong integer. */
00085   WLZ_GREY_INT                  = 1,    /*!< Signed integer. */
00086   WLZ_GREY_SHORT                = 2,    /*!< Signed short. */
00087   WLZ_GREY_UBYTE                = 3,    /*!< Unsigned WlzUByte integer. */
00088   WLZ_GREY_FLOAT                = 4,    /*!< Single precision floating
00089                                              point. */
00090   WLZ_GREY_DOUBLE               = 5,    /*!< Double precision floating
00091                                              point. */
00092   WLZ_GREY_BIT                  = 6,    /*!< Single bit. */
00093   WLZ_GREY_RGBA                 = 7,    /*!< Eight bit red, green, blue and
00094                                              alpha components packed into an
00095                                              unsigned 32 bit integer, with:
00096                                              v = r|(g<<8)|(b<<16)|(a<<24),
00097                                              where r, g, b and a are the
00098                                              unsigned byte red, green, blue
00099                                              and alpha components of the
00100                                              value. */
00101   WLZ_GREY_ERROR                        /*!< An invalid grey type used to
00102                                              return error conditions.
00103                                              Always the last enumerator! */
00104 } WlzGreyType;
00105 
00106 /*!
00107 * \enum         _WlzObjectType
00108 * \ingroup      WlzType
00109 * \brief        The Woolz object types.
00110 *               Many of the integer enumeration values are required for
00111 *               historical reasons but, with the execption of WLZ_NULL,
00112 *               the numerical value should never be used explicitly.
00113 *
00114 *               The base grey table types are used to form explicit
00115 *               grey table types which include the grey type. The functions
00116 *               for extracting and synthesising these types should be
00117 *               used: These are WlzGreyTableType(),
00118 *               WlzGreyTableTypeToGreyType() and
00119 *               WlzGreyTableTypeToTableType().
00120 *               Typedef: ::WlzObjectType.
00121 */
00122 typedef enum _WlzObjectType
00123 {
00124   /**********************************************************************
00125   * Top level Woolz object types.
00126   **********************************************************************/
00127   WLZ_NULL                      = 0,    /*!< The NULL object is an invalid
00128                                              object used to return an error
00129                                              condition. */
00130   WLZ_2D_DOMAINOBJ              = 1,    /*!< 2D spatial domain object. */
00131   WLZ_3D_DOMAINOBJ              = 2,    /*!< 3D spatial domain object. */
00132   WLZ_TRANS_OBJ                 = 3,    /*!< Object in which the domain is
00133                                              a transformation and the values
00134                                              are an object. */
00135   WLZ_3D_WARP_TRANS             = 4,    /*!< 3D finite element warp
00136                                              transformation. */
00137   WLZ_2D_POLYGON                = 10,   /*!< 2D polygon. */
00138   WLZ_BOUNDLIST                 = 11,   /*!< Boundary tree. */
00139   WLZ_CONV_HULL                 = 12,   /*!< Convex hull. */
00140   WLZ_HISTOGRAM                 = 13,   /*!< Histogram. */
00141   WLZ_3D_POLYGON                = 14,   /*!< 3D polygon. */
00142   WLZ_CONTOUR                   = 15,   /*!< Contour in either 2D or 3D. */
00143   WLZ_CMESH_2D                  = 16,   /*!< Constrained mesh with triangular
00144                                              elements in 2D. */
00145   WLZ_CMESH_3D                  = 17,   /*!< Constrained mesh with tetrahedral
00146                                              elements in 3D. */
00147   WLZ_CMESH_2D5                 = 18,   /*!< Constrained mesh with triangular
00148                                              elements in 3D. */
00149   WLZ_RECTANGLE                 = 20,   /*!< Rectangle. */
00150   WLZ_POINTS                    = 21,   /*!< Points. */
00151   WLZ_CONVOLVE_INT              = 50,   /*!< Integer convolution. */
00152   WLZ_CONVOLVE_FLOAT            = 51,   /*!< Floating point convolution. */
00153   WLZ_AFFINE_TRANS              = 63,   /*!< Affine transform, either 2D or
00154                                             3D. */
00155   WLZ_WARP_TRANS                = 64,   /*!< A finite element warp
00156                                              transformation. */
00157   WLZ_FMATCHOBJ                 = 65,   /*!< Matched features for finite
00158                                              element warps. */
00159   WLZ_TEXT                      = 70,   /*!< Simple ascii text. */
00160   WLZ_COMPOUND_ARR_1            = 80,   /*!< Compound array of objects
00161                                              with same type. */
00162   WLZ_COMPOUND_ARR_2            = 81,   /*!< Compound array of objects
00163                                              with differnt type. */
00164   WLZ_COMPOUND_LIST_1           = 82,   /*!< Linked list of objects
00165                                              with same type. */
00166   WLZ_COMPOUND_LIST_2           = 83,   /*!< Linked list of objects
00167                                              with different type. */
00168   WLZ_LUT                       = 90,   /*!< Simple look up table. */
00169   WLZ_PROPERTY_OBJ              = 110,  /*!< An object which only has a
00170                                              property list. */
00171   WLZ_EMPTY_OBJ                 = 127,  /*!< Empty object: An object which
00172                                              occupies no space and has no
00173                                              values. */
00174   WLZ_MESH_TRANS                = 128,  /*!< Mesh transform. */
00175   WLZ_CMESH_TRANS               = 129,  /*!< Constrained mesh transform,
00176                                              either 2D or 3D. */
00177 
00178   WLZ_EMPTY_DOMAIN,                     /*!< Empty domain: A domain which
00179                                              occupies no space. */
00180   WLZ_EMPTY_VALUES,                     /*!< Empty values: A values which
00181                                              has no values! */
00182   /**********************************************************************
00183   * Plane domain types.
00184   **********************************************************************/
00185   WLZ_INTERVALDOMAIN_INTVL      = 1,    /*!< Spatial domain defined by
00186                                              a collection of intervals. */
00187   WLZ_INTERVALDOMAIN_RECT       = 2,    /*!< Spatial domain defined by an
00188                                              axis aligned rectangle. */
00189   WLZ_LBTDOMAIN_2D              = 3,    /*!< 2D linear binary tree domain. */
00190   WLZ_LBTDOMAIN_3D              = 4,    /*!< 3D linear binary tree domain. */
00191   WLZ_PLANEDOMAIN_DOMAIN        = WLZ_2D_DOMAINOBJ, /*!< 3D spatial domain
00192                                              composed of 2D spatial domains. */
00193   WLZ_PLANEDOMAIN_POLYGON       = WLZ_2D_POLYGON, /*!< 3D polygon domain
00194                                              composed of 2D polygon domains. */
00195   WLZ_PLANEDOMAIN_BOUNDLIST     = WLZ_BOUNDLIST, /*!< 3D boundary domain
00196                                              composed of 2D boundary
00197                                              domains. */
00198   WLZ_PLANEDOMAIN_CONV_HULL     = WLZ_CONV_HULL, /*!< 3D convex hull
00199                                              composed of 2D convex hulls. */
00200   WLZ_PLANEDOMAIN_HISTOGRAM     = WLZ_HISTOGRAM, /*!< 3D histogram domain
00201                                              composed of 2D histogram
00202                                              domains. */
00203   WLZ_PLANEDOMAIN_AFFINE        = WLZ_AFFINE_TRANS, /*!< 3D affine domain
00204                                              composed of 2D affine transform
00205                                              domains. */
00206   WLZ_PLANEDOMAIN_WARP          = WLZ_WARP_TRANS, /*!< 3D warp domain
00207                                              composed of 2D warp domains. */
00208   /**********************************************************************
00209   * Value table types.
00210   **********************************************************************/
00211   WLZ_GREY_TAB_RAGR             = 0,    /*!< Base ragged rectangle grey value
00212                                              table. */
00213   WLZ_GREY_TAB_RECT             = 1,    /*!< Base rectangular grey value
00214                                              table. */
00215   WLZ_GREY_TAB_INTL             = 2,    /*!< Base interval grey value table. */
00216   WLZ_POINT_VALUES              = 3,    /*!< Values defined at points. */
00217   WLZ_INDEXED_VALUES            = 4,    /*!< Indexed value table. */
00218   WLZ_FEAT_TAB_RAGR             = 5,    /*!< Base ragged rectangle feature
00219                                              table. */
00220   WLZ_FEAT_TAB_RECT             = 6,    /*!< Base rectangular feature table. */
00221   WLZ_GREY_TAB_TILED            = 7,    /*!< Tiled grey value table. */
00222   WLZ_VALUETABLE_RAGR_INT       = ((10 * WLZ_GREY_TAB_RAGR) + WLZ_GREY_INT),
00223                                         /*!< Ragged rectangle int value
00224                                              table. */
00225   WLZ_VALUETABLE_RAGR_SHORT     = ((10 * WLZ_GREY_TAB_RAGR) + WLZ_GREY_SHORT),
00226                                         /*!< Ragged rectangle short value
00227                                              table. */
00228   WLZ_VALUETABLE_RAGR_UBYTE     = ((10 * WLZ_GREY_TAB_RAGR) + WLZ_GREY_UBYTE),
00229                                         /*!< Ragged rectangle unsigned byte
00230                                              value table. */
00231   WLZ_VALUETABLE_RAGR_FLOAT     = ((10 * WLZ_GREY_TAB_RAGR) + WLZ_GREY_FLOAT),
00232                                         /*!< Ragged rectangle single precision
00233                                              floating point value table. */
00234   WLZ_VALUETABLE_RAGR_DOUBLE    = ((10 * WLZ_GREY_TAB_RAGR) + WLZ_GREY_DOUBLE),
00235                                         /*!< Ragged rectangle double precision
00236                                              floating point value table. */
00237   WLZ_VALUETABLE_RAGR_BIT       = ((10 * WLZ_GREY_TAB_RAGR) + WLZ_GREY_BIT),
00238                                         /*!< Ragged rectangle single bit (packed
00239                                              in unsigned bytes) value table. */
00240   WLZ_VALUETABLE_RAGR_RGBA      = ((10 * WLZ_GREY_TAB_RAGR) + WLZ_GREY_RGBA),
00241                                         /*!< Ragged rectangle red, green, blue,
00242                                              alpha value table. */
00243   WLZ_VALUETABLE_RECT_INT       = ((10 * WLZ_GREY_TAB_RECT) + WLZ_GREY_INT),
00244                                         /*!< Rectangular int value
00245                                              table. */
00246   WLZ_VALUETABLE_RECT_SHORT     = ((10 * WLZ_GREY_TAB_RECT) + WLZ_GREY_SHORT),
00247                                         /*!< Rectangular short value
00248                                              table. */
00249   WLZ_VALUETABLE_RECT_UBYTE     = ((10 * WLZ_GREY_TAB_RECT) + WLZ_GREY_UBYTE),
00250                                         /*!< Rectangular unsigned byte value
00251                                              table. */
00252   WLZ_VALUETABLE_RECT_FLOAT     = ((10 * WLZ_GREY_TAB_RECT) + WLZ_GREY_FLOAT),
00253                                         /*!< Rectangular single precision
00254                                              floating point value table. */
00255   WLZ_VALUETABLE_RECT_DOUBLE    = ((10 * WLZ_GREY_TAB_RECT) + WLZ_GREY_DOUBLE),
00256                                         /*!< Rectangular double precision
00257                                              floating point value table. */
00258   WLZ_VALUETABLE_RECT_BIT       = ((10 * WLZ_GREY_TAB_RECT) + WLZ_GREY_BIT),
00259                                         /*!< Rectangular single bit (packed in
00260                                              unsigned bytes) value table. */
00261   WLZ_VALUETABLE_RECT_RGBA      = ((10 * WLZ_GREY_TAB_RECT) + WLZ_GREY_RGBA),
00262                                         /*!< Rectangular red, green, blue,
00263                                              alpha value table.  */ 
00264   WLZ_VALUETABLE_INTL_INT       = ((10 * WLZ_GREY_TAB_INTL) + WLZ_GREY_INT),
00265                                         /*!< Interval coded int value
00266                                              table. */
00267   WLZ_VALUETABLE_INTL_SHORT     = ((10 * WLZ_GREY_TAB_INTL) + WLZ_GREY_SHORT),
00268                                         /*!< Interval coded short value
00269                                              table. */
00270   WLZ_VALUETABLE_INTL_UBYTE     = ((10 * WLZ_GREY_TAB_INTL) + WLZ_GREY_UBYTE),
00271                                         /*!< Interval coded unsigned byte value
00272                                              table. */
00273   WLZ_VALUETABLE_INTL_FLOAT     = ((10 * WLZ_GREY_TAB_INTL) + WLZ_GREY_FLOAT),
00274                                         /*!< Interval coded single precision
00275                                              floating point value table. */
00276   WLZ_VALUETABLE_INTL_DOUBLE    = ((10 * WLZ_GREY_TAB_INTL) + WLZ_GREY_DOUBLE),
00277                                         /*!< Interval coded double precision
00278                                              floating point value table. */
00279   WLZ_VALUETABLE_INTL_BIT       = ((10 * WLZ_GREY_TAB_INTL) + WLZ_GREY_BIT),
00280                                         /*!< Interval coded single bit (packed
00281                                              unsigned bytes) value table. */
00282   WLZ_VALUETABLE_INTL_RGBA      = ((10 * WLZ_GREY_TAB_INTL) + WLZ_GREY_RGBA),
00283                                         /*!< Interval coded red, green, blue,
00284                                              alpha value table.  */
00285   WLZ_VALUETABLE_TILED_INT      = ((10 * WLZ_GREY_TAB_TILED) + WLZ_GREY_INT),
00286                                         /*!< Tiled int value
00287                                              table. */
00288   WLZ_VALUETABLE_TILED_SHORT    = ((10 * WLZ_GREY_TAB_TILED) + WLZ_GREY_SHORT),
00289                                         /*!< Tiled short value
00290                                              table. */
00291   WLZ_VALUETABLE_TILED_UBYTE    = ((10 * WLZ_GREY_TAB_TILED) + WLZ_GREY_UBYTE),
00292                                         /*!< Tiled unsigned byte value
00293                                              table. */
00294   WLZ_VALUETABLE_TILED_FLOAT    = ((10 * WLZ_GREY_TAB_TILED) + WLZ_GREY_FLOAT),
00295                                         /*!< Tiled single precision
00296                                              floating point value table. */
00297   WLZ_VALUETABLE_TILED_DOUBLE   = ((10 * WLZ_GREY_TAB_TILED) + WLZ_GREY_DOUBLE),
00298                                         /*!< Tiled double precision
00299                                              floating point value table. */
00300   WLZ_VALUETABLE_TILED_BIT      = ((10 * WLZ_GREY_TAB_TILED) + WLZ_GREY_BIT),
00301                                         /*!< Tiled single bit (packed
00302                                              unsigned bytes) value table. */
00303   WLZ_VALUETABLE_TILED_RGBA     = ((10 * WLZ_GREY_TAB_TILED) + WLZ_GREY_RGBA),
00304                                         /*!< Tiled red, green, blue,
00305                                              table. */
00306   WLZ_FEATVALUETABLE_RAGR       = 50,   /*!< Ragged rectangle features
00307                                              value table. */
00308   WLZ_FEATVALUETABLE_RECT       = 60,   /*!< Rectangular features
00309                                              value table. */
00310   WLZ_VOXELVALUETABLE_GREY      = 1,    /*!< Grey value voxel value table. */
00311   WLZ_VOXELVALUETABLE_CONV_HULL,        /*!< Convex hull voxel value table. */
00312   /**********************************************************************
00313   * Polygon domain types.                                       
00314   **********************************************************************/
00315   WLZ_POLYGON_INT               = 1,    /*!< Integer polygon domain. */
00316   WLZ_POLYGON_FLOAT             = 2,    /*!< Single precision floating point
00317                                              polygon domain. */
00318   WLZ_POLYGON_DOUBLE            = 3,    /*!< Double precision floating point
00319                                              polygon domain. */
00320   /**********************************************************************
00321   * Boundary list types.                                        
00322   **********************************************************************/
00323   WLZ_BOUNDLIST_PIECE           = 0,    /*!< Piece contains foreground. */
00324   WLZ_BOUNDLIST_HOLE            = 1,    /*!< Piece contains background. */
00325   /**********************************************************************
00326   * Convex hull types.                                          
00327   **********************************************************************/
00328   WLZ_CONVHULL_VALUES           = 1,    /*!< Convex hull values. */
00329   /**********************************************************************
00330   * Histogram domain types. WLZ_HISTOGRAMDOMAIN_OLD_INT and     
00331   * WLZ_HISTOGRAMDOMAIN_OLD_FLOAT exist only to allow old files to be
00332   * read, they should not be used anywhere else.                
00333   **********************************************************************/
00334   WLZ_HISTOGRAMDOMAIN_OLD_INT   = 1,    /*!< Historical compatability. */
00335   WLZ_HISTOGRAMDOMAIN_OLD_FLOAT = 2,    /*!< Historical compatability. */
00336   WLZ_HISTOGRAMDOMAIN_INT       = 3,    /*!< Integer histogram domain. */
00337   WLZ_HISTOGRAMDOMAIN_FLOAT     = 4,    /*!< Floating point histogram
00338                                              domain. */
00339   /**********************************************************************
00340   * Rectangle object domain types.                              
00341   **********************************************************************/
00342   WLZ_RECTANGLE_DOMAIN_INT      = 1,    /*!< Integer rectangle domain. */
00343   WLZ_RECTANGLE_DOMAIN_FLOAT    = 2,    /*!< Floating point rectangle
00344                                              domain. */
00345   /**********************************************************************
00346   * 3D view structure types (also used for object and domain type).
00347   **********************************************************************/
00348   WLZ_3D_VIEW_STRUCT            = 160,  /*!< 3D view structure. */
00349   /**********************************************************************
00350   * Property list types.                                        
00351   **********************************************************************/
00352   WLZ_PROPERTYLIST              = 170,  /*! A property list which contains
00353                                             a linked list of properties. */
00354   /**********************************************************************
00355   * Property types.                                     
00356   **********************************************************************/
00357   WLZ_PROPERTY_SIMPLE           = 180,  /*!< Simple property. */
00358   WLZ_PROPERTY_EMAP             = 181,  /*!< EMAP property. */
00359   WLZ_PROPERTY_NAME             = 182,  /*!< Ascii name property. */
00360   WLZ_PROPERTY_GREY             = 183,  /*!< Grey value property. */
00361   WLZ_PROPERTY_TEXT             = 184,  /*!< Text property. */
00362   /**********************************************************************
00363   * Points domain types.
00364   **********************************************************************/
00365   WLZ_POINTS_2I                 = 21,   /*!< Integer 2D points domain. */
00366   WLZ_POINTS_2D                 = 22,   /*!< Integer 2D points domain. */
00367   WLZ_POINTS_3I                 = 23,    /*!< Double precision floating point
00368                                               2D points domain. */
00369   WLZ_POINTS_3D                 = 24,    /*!< Double precision floating point
00370                                               3D points domain. */
00371   /**********************************************************************
00372   * WLZ_DUMMY_ENTRY is not an object type.                      
00373   * Keep it the last enumerator!                                
00374   **********************************************************************/
00375   WLZ_DUMMY_ENTRY                       /*!< Not a Woolz object type.
00376                                              Keep it the last enumerator! */
00377 } WlzObjectType;
00378 
00379 
00380 /*! 
00381 * \enum         _WlzEMAPPropertyType
00382 * \ingroup      WlzProperty
00383 * \brief        Sub types of EMAP properties
00384 *               Typedef: ::WlzEMAPPropertyType.
00385 */
00386 typedef enum _WlzEMAPPropertyType
00387 {
00388   WLZ_EMAP_PROPERTY_GREY_MODEL = 1,     /*!< Reference Model */
00389   WLZ_EMAP_PROPERTY_GREY_OTHER,         /*!< Grey object e.g. derived from model */
00390   WLZ_EMAP_PROPERTY_DOMAIN_ANATOMY,     /*!< Anatomy Domain */
00391   WLZ_EMAP_PROPERTY_DOMAIN_OTHER,       /*!< Other Domain */
00392   WLZ_EMAP_PROPERTY_TRANSFORM,          /*!< woolz transform for EMAP models */
00393   WLZ_EMAP_PROPERTY_DUMMY               /*!< Dummy property */
00394 } WlzEMAPPropertyType;
00395 
00396 /*!
00397 * \enum         _WlzRasterDir
00398 * \ingroup      WlzAccess
00399 * \brief        Raster scan directions as used by WlzIntervalWSpace
00400 *               and WlzIterateWSpace. These are built using bit masks
00401 *               with bits set for decreasing in each of the directions.
00402 *               Typedef: ::WlzRasterDir.
00403 */
00404 typedef enum _WlzRasterDir
00405 {
00406   WLZ_RASTERDIR_DC    = (1),            /*!< Used to build directions . */
00407   WLZ_RASTERDIR_DL    = (1 << 1),       /*!< Used to build directions. */
00408   WLZ_RASTERDIR_DP    = (1 << 2),       /*!< Used to build directions. */
00409   WLZ_RASTERDIR_ILIC  = (0),            /*!< Increasing lines, increasing
00410                                              columns. */
00411   WLZ_RASTERDIR_ILDC  = WLZ_RASTERDIR_DC,
00412                                         /*!< Increasing lines, decreasing
00413                                              columns. */
00414   WLZ_RASTERDIR_DLIC  = WLZ_RASTERDIR_DL,
00415                                         /*!< Decreasing lines, increasing
00416                                              columns. */
00417   WLZ_RASTERDIR_DLDC  = (WLZ_RASTERDIR_DL | WLZ_RASTERDIR_DC),
00418                                         /*!< Decreasing lines, decreasing
00419                                              columns. */
00420   WLZ_RASTERDIR_IPILIC  = WLZ_RASTERDIR_ILIC,
00421                                         /*!< Increasing planes,
00422                                              increasing lines, increasing
00423                                              columns. */
00424   WLZ_RASTERDIR_IPILDC  = WLZ_RASTERDIR_ILDC,
00425                                         /*!< Increasing planes,
00426                                              increasing lines, decreasing
00427                                              columns. */
00428   WLZ_RASTERDIR_IPDLIC  = WLZ_RASTERDIR_DLIC,
00429                                         /*!< Increasing planes,
00430                                              decreasing lines, increasing
00431                                              columns. */
00432   WLZ_RASTERDIR_IPDLDC  = WLZ_RASTERDIR_DLDC,
00433                                         /*!< Increasing planes,
00434                                              decreasing lines, decreasing
00435                                              columns. */
00436   WLZ_RASTERDIR_DPILIC  = (WLZ_RASTERDIR_DP | WLZ_RASTERDIR_ILIC),
00437                                         /*!< Decreasing planes,
00438                                              increasing lines, increasing
00439                                              columns. */
00440   WLZ_RASTERDIR_DPILDC  = (WLZ_RASTERDIR_DP | WLZ_RASTERDIR_ILDC),
00441                                         /*!< Decreasing planes,
00442                                              increasing lines, decreasing
00443                                              columns. */
00444   WLZ_RASTERDIR_DPDLIC  = (WLZ_RASTERDIR_DP | WLZ_RASTERDIR_DLIC),
00445                                         /*!< Decreasing planes,
00446                                              decreasing lines, increasing
00447                                              columns. */
00448   WLZ_RASTERDIR_DPDLDC  = (WLZ_RASTERDIR_DP | WLZ_RASTERDIR_DLDC)
00449                                         /*!< Decreasing planes,
00450                                              decreasing lines, decreasing
00451                                              columns. */
00452 } WlzRasterDir;
00453 
00454 /*!
00455 * \enum         _WlzDirection
00456 * \ingroup      WlzType
00457 * \brief        Basic directions.
00458 */
00459 typedef enum _WlzDirection
00460 {
00461   WLZ_DIRECTION_IC,             /*!< Increasing columns, ++x, east. */
00462   WLZ_DIRECTION_IL,             /*!< Increasing lines, ++y, south. */
00463   WLZ_DIRECTION_IP,             /*!< Increasing planes, ++z, up. */
00464   WLZ_DIRECTION_DC,             /*!< Decreasing columns, --x, west. */
00465   WLZ_DIRECTION_DL,             /*!< Decreasing lines, --y, north. */
00466   WLZ_DIRECTION_DP              /*!< Decreasing planes, --z, down. */
00467 } WlzDirection;
00468 
00469 /*!
00470 * \enum         _WlzTransformType
00471 * \ingroup      WlzTransform
00472 * \brief        Types of spatial transformation.
00473 *               Typedef: ::WlzTransformType.
00474 */
00475 typedef enum _WlzTransformType
00476 {
00477   WLZ_TRANSFORM_EMPTY = 0,              /*!< Undefined transform. */
00478   WLZ_TRANSFORM_2D_AFFINE = 1,          /*!< General 2D affine transform. */
00479   WLZ_TRANSFORM_2D_REG,                 /*!< 2D affine but only rotation
00480                                              and translation. */
00481   WLZ_TRANSFORM_2D_TRANS,               /*!< 2D affine but only translation. */
00482   WLZ_TRANSFORM_2D_NOSHEAR,             /*!< 2D affine but no shear. */
00483   WLZ_TRANSFORM_3D_AFFINE,              /*!< General 3D affine transform. */
00484   WLZ_TRANSFORM_3D_REG,                 /*!< 3D affine but only rotation
00485                                              and translation. */
00486   WLZ_TRANSFORM_3D_TRANS,               /*!< 3D affine but only translation. */
00487   WLZ_TRANSFORM_3D_NOSHEAR,             /*!< 3D affine but no shear. */
00488   WLZ_TRANSFORM_2D_BASISFN,             /*!< 2D basis function transform. */
00489   WLZ_TRANSFORM_2D5_BASISFN,            /*!< 2.5D (plane wise) basis function
00490                                              transform. */
00491   WLZ_TRANSFORM_3D_BASISFN,             /*!< 3D basis function transform. */
00492   WLZ_TRANSFORM_2D_MESH,                /*!< 2D triangular mesh transform. */
00493   WLZ_TRANSFORM_2D5_MESH,               /*!< 2.5D (plane wise) triangular
00494                                              mesh transform. */
00495   WLZ_TRANSFORM_3D_MESH,                /*!< 3D tetrahedral mesh transform. */
00496   WLZ_TRANSFORM_2D_CMESH = WLZ_CMESH_2D, /*!< 2D conforming triangular mesh
00497                                               transform. */
00498   WLZ_TRANSFORM_2D5_CMESH = WLZ_CMESH_2D5, /*!< 3D conforming triangular mesh
00499                                                 transform. */
00500   WLZ_TRANSFORM_3D_CMESH = WLZ_CMESH_3D /*!< 3D conforming tetrahedral mesh
00501                                              transform. */
00502 } WlzTransformType;
00503 
00504 /*!
00505 * \enum         _WlzMeshElemType
00506 * \ingroup      WlzTransform
00507 * \brief        Mesh transform element types.
00508 *               Typedef: ::WlzMeshElemType.
00509 */
00510 typedef enum _WlzMeshElemType
00511 {
00512   WLZ_MESH_ELEM_TRILINEAR,
00513   WLZ_MESH_ELEM_TRIINCOMPRESSIBLE,
00514   WLZ_MESH_ELEM_TRICOMPRESSIBLE
00515 } WlzMeshElemType;
00516 
00517 /*!
00518 * \enum         _WlzMeshElemFlags
00519 * \ingroup      WlzTransform
00520 * \brief        Mesh transform element flag bit masks.
00521 *               Typedef: ::WlzMeshElemFlags.
00522 */
00523 typedef enum _WlzMeshElemFlags
00524 {
00525   WLZ_MESH_ELEM_FLAGS_NONE      = (0),
00526   WLZ_MESH_ELEM_FLAGS_NBR_0     = (1),    /*!< Neighbour on side 0 exists */
00527   WLZ_MESH_ELEM_FLAGS_NBR_1     = (1<<1), /*!< Neighbour on side 1 exists */
00528   WLZ_MESH_ELEM_FLAGS_NBR_2     = (1<<2), /*!< Neighbour on side 2 exists */
00529   WLZ_MESH_ELEM_FLAGS_ZOMBIE    = (1<<3), /*!< Dead, awaiting replacement */
00530   WLZ_MESH_ELEM_FLAGS_REFINE    = (1<<4), /*!< Available for refinement */
00531   WLZ_MESH_ELEM_FLAGS_OUTSIDE   = (1<<5)  /*!< Outside object's domain */
00532 } WlzMeshElemFlags;
00533 
00534 /*!
00535 * \enum         _WlzMeshNodeFlags
00536 * \ingroup      WlzTransform
00537 * \brief        Mesh transform node flag masks.
00538 *               Typedef: ::WlzMeshNodeFlags.
00539 */
00540 typedef enum _WlzMeshNodeFlags
00541 {
00542   WLZ_MESH_NODE_FLAGS_NONE      = (0),
00543   WLZ_MESH_NODE_FLAGS_BBOX      = (1),    /*!< Created from bounding box. */
00544   WLZ_MESH_NODE_FLAGS_BLOCK     = (1<<1), /*!< Created by block fill. */
00545   WLZ_MESH_NODE_FLAGS_IDOM      = (1<<2), /*!< Created to fill interval
00546                                                domain */
00547   WLZ_MESH_NODE_FLAGS_POLY      = (1<<3), /*!< Created along polygon domain */
00548   WLZ_MESH_NODE_FLAGS_ZOMBIE    = (1<<4)  /*!< Dead, awaiting replacement */
00549 } WlzMeshNodeFlags;
00550 
00551 /*!
00552 * \enum         _WlzMeshGenMethod
00553 * \ingroup      WlzTransform
00554 * \brief        Mesh generation methods.
00555 *               Typedef: ::WlzMeshGenMethod.
00556 */
00557 typedef enum _WlzMeshGenMethod
00558 {
00559   WLZ_MESH_GENMETHOD_BLOCK,             /*!< Uniform (triangulated) block
00560                                              grid. */
00561   WLZ_MESH_GENMETHOD_GRADIENT,          /*!< Triangulated grid based on image
00562                                              gradient. */
00563   WLZ_MESH_GENMETHOD_CONFORM            /*!< Mesh conforming to domain. */
00564 } WlzMeshGenMethod;
00565 
00566 /*!
00567 * \enum         _WlzMeshError
00568 * \ingroup      WlzTransform
00569 * \brief        Mesh error bit masks.
00570 *               Typedef: ::WlzMeshError.
00571 */
00572 typedef enum _WlzMeshError
00573 {
00574   WLZ_MESH_ERR_NONE             = (0),    /*!< No error, mesh valid */
00575   WLZ_MESH_ERR_ELEM_CW          = (1),    /*!< Element not CCW */
00576   WLZ_MESH_ERR_ELEM_INDEX       = (1<<1), /*!< Element index invalid */
00577   WLZ_MESH_ERR_ELEM_NODE        = (1<<2), /*!< Element node invalid */
00578   WLZ_MESH_ERR_ELEM_ZOMBIE      = (1<<3), /*!< Element is a zombie */
00579   WLZ_MESH_ERR_DELEM_CW         = (1<<4), /*!< Displaced element not CCW */
00580   WLZ_MESH_ERR_NELEM_INDEX      = (1<<5), /*!< Neighbour index invalid */
00581   WLZ_MESH_ERR_NELEM_NODE       = (1<<6), /*!< Neighbour node invalid */
00582   WLZ_MESH_ERR_NELEM_NOTNBR     = (1<<7), /*!< Neighbour not a neighbour */
00583   WLZ_MESH_ERR_NELEM_ZOMBIE     = (1<<8)  /*!< Neighbour is a zombie */
00584 } WlzMeshError;
00585 
00586 /*!
00587 * \enum         _WlzConnectType
00588 * \ingroup      WlzType
00589 * \brief        Connectivity in a 2D or 3D digital space.
00590 *               Typedef: ::WlzConnectType.
00591 */
00592 typedef enum _WlzConnectType
00593 {
00594   WLZ_0_CONNECTED               = 0,
00595   WLZ_8_CONNECTED,
00596   WLZ_4_CONNECTED,
00597   WLZ_6_CONNECTED,
00598   WLZ_18_CONNECTED,
00599   WLZ_26_CONNECTED
00600 } WlzConnectType;
00601 
00602 /*!
00603 * \enum         _WlzDistanceType
00604 * \ingroup      WlzType
00605 * \brief        Distance metrics in a 2D or 3D digital space.
00606 *               Typedef: ::WlzDistanceType.
00607 */
00608 typedef enum _WlzDistanceType
00609 {
00610   WLZ_8_DISTANCE                = WLZ_8_CONNECTED,
00611   WLZ_4_DISTANCE                = WLZ_4_CONNECTED,
00612   WLZ_6_DISTANCE                = WLZ_6_CONNECTED,
00613   WLZ_18_DISTANCE               = WLZ_18_CONNECTED,
00614   WLZ_26_DISTANCE               = WLZ_26_CONNECTED,
00615   WLZ_OCTAGONAL_DISTANCE,
00616   WLZ_EUCLIDEAN_DISTANCE,
00617   WLZ_APX_EUCLIDEAN_DISTANCE            /*! Approximate Euclidean. */
00618 } WlzDistanceType;
00619 
00620 /*!
00621 * \enum         _WlzRegConRCC8
00622 * \ingroup      WlzType
00623 * \brief        The dicrete Region Connected Calculus 8 (RCC8) clasification
00624 *               of a pair of spatial regions.
00625 *               Typedef: ::WlzRegConRCC8
00626 *               \verbatim
00627                 RCC8           X = ---------,  Y = _________
00628                 DC(X,Y)        ---------       _________
00629                 EC(X,Y)        ---------_________
00630                 EQ(X,Y)        =========
00631                 PO(X,Y)        ------===______
00632                 TPP(X,Y)       ____=====
00633                 NTPP(X,Y)      __=====__
00634                 TPPI(X,Y)      -----====
00635                 NTPPI(X,Y)     --=====--
00636                 \endverbatim
00637 */
00638 typedef enum _WlzRegConRCC8
00639 {
00640   WLZ_REGCON_RCC8_DC    = 0,    /*!< Diconnected. */
00641   WLZ_REGCON_RCC8_EC,           /*!< External Connected. */
00642   WLZ_REGCON_RCC8_EQ,           /*!< Equal. */
00643   WLZ_REGCON_RCC8_PO,           /*!< Partial Overlap. */
00644   WLZ_REGCON_RCC8_TPP,          /*!< Tangential Proper Part. */
00645   WLZ_REGCON_RCC8_NTPP,         /*!< Non-Tangential Proper Part. */
00646   WLZ_REGCON_RCC8_TPPI,         /*!< Tangential Proper Part Inverse. */
00647   WLZ_REGCON_RCC8_NTPPI         /*!< Non-Tangential Proper Part
00648                                      Inverse. */
00649 } WlzRegConRCC8;
00650 
00651 /*!
00652 * \enum         _WlzSpecialStructElmType
00653 * \ingroup      WlzMorphologyOps
00654 * \brief        Special structuring elements for morphological operations.
00655 *               Typedef: ::WlzSpecialStructElmType.
00656 */
00657 typedef enum _WlzSpecialStructElmType
00658 {
00659   WLZ_SPEC_STRUCT_ELM_H4,
00660   WLZ_SPEC_STRUCT_ELM_EX4,
00661   WLZ_SPEC_STRUCT_ELM_A8,
00662   WLZ_SPEC_STRUCT_ELM_H6,
00663   WLZ_SPEC_STRUCT_ELM_H5,
00664   WLZ_SPEC_STRUCT_ELM_H7,
00665   WLZ_SPEC_STRUCT_ELM_A3,
00666   WLZ_SPEC_STRUCT_ELM_E1,
00667   WLZ_SPEC_STRUCT_ELM_E2,
00668   WLZ_SPEC_STRUCT_ELM_V2
00669 } WlzSpecialStructElmType;
00670 
00671 /*!
00672 * \enum         _WlzBinaryOperatorType
00673 * \ingroup      WlzArithmetic
00674 * \brief         Binary operators.                                              
00675 *               Typedef: ::WlzBinaryOperatorType.
00676 */
00677 typedef enum _WlzBinaryOperatorType
00678 {
00679   WLZ_BO_ADD            = 0,
00680   WLZ_BO_SUBTRACT,
00681   WLZ_BO_MULTIPLY,
00682   WLZ_BO_DIVIDE,
00683   WLZ_BO_MODULUS,
00684   WLZ_BO_EQ,
00685   WLZ_BO_NE,
00686   WLZ_BO_GT,
00687   WLZ_BO_GE,
00688   WLZ_BO_LT,
00689   WLZ_BO_LE,
00690   WLZ_BO_AND,
00691   WLZ_BO_OR,
00692   WLZ_BO_XOR,
00693   WLZ_BO_MAX,
00694   WLZ_BO_MIN,
00695   WLZ_BO_MAGNITUDE
00696 } WlzBinaryOperatorType;
00697 
00698 /*!
00699 * \enum         _WlzCompThreshType
00700 * \ingroup      WlzThreshold
00701 * \brief        Automatic threshold computation methods.                        
00702 *               The histogram may need to be smoothed for these algorithms
00703 *               to work.
00704                 Typedef: ::WlzCompThreshType.
00705 */
00706 typedef enum _WlzCompThreshType
00707 {
00708   WLZ_COMPTHRESH_FOOT,  /*!< Can not determine threshold type.
00709                            The threshold value is intercept of a line fitted
00710                            to the upper slope of the histogram main peak with
00711                            the abscissa.  */
00712   WLZ_COMPTHRESH_DEPTH, /*!< Can not determine threshold type.
00713                            The threshold value is that point to the right of
00714                            the histogram peak that is maximally distant from
00715                            the chord joining the peak and the histogram right
00716                            hand end point.
00717                            The histogram may need to be smoothed for this
00718                            algorithm to work.  */
00719   WLZ_COMPTHRESH_GRADIENT, /*!< Can not determine threshold type.
00720                            The threshold value is the first point to the
00721                            right of the histogram main peak at which the
00722                            gradient falls to zero (cf finding a minimum).
00723                            To find the slope of the histogram at some
00724                            point a straight line is fitted through the
00725                            point \f$\pm\f$ a fixed number of points to
00726                            either side. */
00727   WLZ_COMPTHRESH_FRACMIN, /*!< The threshold type is determined from the
00728                            position of the histogram's maximum and the
00729                            threshold value is the minimum following
00730                            the specified fraction of the values.  */
00731   WLZ_COMPTHRESH_SMOOTHSPLIT /*!< The threshold value is found by
00732                            heavily smoothing the histogram and looking
00733                            for the minimum. Successively lesser smmothing
00734                            values are then applied and at each itteration
00735                            the minimum closest to the previous is found. */
00736 } WlzCompThreshType;
00737 
00738 /*!
00739 * \enum         _WlzInterpolationType
00740 * \ingroup      WlzType
00741 * \brief        Interpolation methods.
00742 *               Typedef: ::WlzInterpolationType.
00743 */
00744 typedef enum _WlzInterpolationType
00745 {
00746   WLZ_INTERPOLATION_NEAREST     = 0,    /*!< Nearest neighbour. */
00747   WLZ_INTERPOLATION_LINEAR,             /*!< Linear or tri-linear. */
00748   WLZ_INTERPOLATION_CLASSIFY_1,         /*!< Classification by probability. */
00749   WLZ_INTERPOLATION_CALLBACK,           /*!< Callback function computes
00750                                              each interpolated value. */
00751   WLZ_INTERPOLATION_ORDER_2,            /*!< Second order interpolation. */
00752   WLZ_INTERPOLATION_BARYCENTRIC,        /*!< Barycentric mesh interpolation. */
00753   WLZ_INTERPOLATION_KRIG                /*!< Kriging mesh interpolation. */
00754 } WlzInterpolationType;
00755 
00756 /*!
00757 * \enum         _WlzThresholdType
00758 * \ingroup      WlzThreshold
00759 * \brief        Threshold value selection.
00760 *               Typedef: ::WlzThresholdType.
00761 */
00762 typedef enum _WlzThresholdType
00763 {
00764   WLZ_THRESH_LOW                = 0, /*!< Threshold <  given value */
00765   WLZ_THRESH_HIGH,                   /*!< Threshold >= given value */
00766   WLZ_THRESH_EQUAL                   /*!< Threshold == given value */
00767 } WlzThresholdType;
00768 
00769 
00770 /*!
00771 * \enum         _WlzRGBAThresholdType
00772 * \ingroup      WlzThreshold
00773 * \brief        Colour threshold type selection.
00774 *               Typedef: ::WlzRGBAThresholdType.
00775 */
00776 typedef enum _WlzRGBAThresholdType
00777 {
00778   WLZ_RGBA_THRESH_NONE,
00779   WLZ_RGBA_THRESH_SINGLE,
00780   WLZ_RGBA_THRESH_MULTI,
00781   WLZ_RGBA_THRESH_PLANE,
00782   WLZ_RGBA_THRESH_SLICE,
00783   WLZ_RGBA_THRESH_BOX,
00784   WLZ_RGBA_THRESH_SPHERE
00785 } WlzRGBAThresholdType;
00786 
00787 /*!
00788 * \enum         _WlzRGBAColorSpace
00789 * \ingroup      WlzValueUtils
00790 * \brief        Colour space (i.e. rgb, hsb, grey etc.) selection.
00791 *               Typedef: ::WlzRGBAColorSpace.
00792 */
00793 typedef enum _WlzRGBAColorSpace
00794 {
00795   WLZ_RGBA_SPACE_GREY,
00796   WLZ_RGBA_SPACE_RGB,
00797   WLZ_RGBA_SPACE_HSB,
00798   WLZ_RGBA_SPACE_CMY
00799 } WlzRGBAColorSpace;
00800 
00801 /*!
00802 * \enum         _WlzRGBAColorChannel
00803 * \ingroup      WlzValueUtils
00804 * \brief        Colour channel selection.
00805 *               Typedef: ::WlzRGBAColorChannel.
00806 */
00807 typedef enum _WlzRGBAColorChannel
00808 {
00809   WLZ_RGBA_CHANNEL_GREY,
00810   WLZ_RGBA_CHANNEL_RED,
00811   WLZ_RGBA_CHANNEL_GREEN,
00812   WLZ_RGBA_CHANNEL_BLUE,
00813   WLZ_RGBA_CHANNEL_HUE,
00814   WLZ_RGBA_CHANNEL_SATURATION,
00815   WLZ_RGBA_CHANNEL_BRIGHTNESS,
00816   WLZ_RGBA_CHANNEL_CYAN,
00817   WLZ_RGBA_CHANNEL_MAGENTA,
00818   WLZ_RGBA_CHANNEL_YELLOW,
00819   WLZ_RGBA_CHANNEL_DUMMY
00820 } WlzRGBAColorChannel;
00821 
00822 /*!
00823 * \enum         _WlzPolyFillMode        
00824 * \ingroup      WlzPolyline
00825 * \brief        Polygon fill modes.
00826 *               Typedef: ::WlzPolyFillMode.
00827 */
00828 typedef enum _WlzPolyFillMode
00829 {
00830   WLZ_SIMPLE_FILL,      /*!< Fill all pixels with winding number > 0 */
00831   WLZ_EVEN_ODD_FILL,    /*!< Fill all pixels with odd winding number */
00832   WLZ_VERTEX_FILL       /*!< Fill all pixels lying under the polyline */
00833 } WlzPolyFillMode;
00834 
00835 /*!
00836 * \enum         _WlzGreyTransformType   
00837 * \ingroup      WlzTransform
00838 * \brief        Grey-level transform types.
00839 *               Typedef: ::WlzGreyTransformType.
00840 */
00841 typedef enum _WlzGreyTransformType {
00842   WLZ_GREYTRANSFORMTYPE_IDENTITY,       /*!< No value change. */
00843   WLZ_GREYTRANSFORMTYPE_LINEAR,         /*!< Linear interpolation. */
00844   WLZ_GREYTRANSFORMTYPE_GAMMA,          /*!< Gamma function. */
00845   WLZ_GREYTRANSFORMTYPE_SIGMOID         /*!< Sigmoid function. */
00846 } WlzGreyTransformType;
00847 
00848 /*!
00849 * \enum         _WlzThreeDStdViews
00850 * \ingroup      WlzSectionTransform
00851 * \brief        Standard 3D views.
00852                 Typedef: ::WlzThreeDStdViews.
00853 */
00854 typedef enum _WlzThreeDStdViews
00855 {
00856   WLZ_X_Y_VIEW,
00857   WLZ_Y_Z_VIEW,
00858   WLZ_Z_X_VIEW,
00859   WLZ_ARBITRARY_VIEW
00860 } WlzThreeDStdViews;
00861 
00862 /*!
00863 * \enum         _WlzThreeDViewMode
00864 * \ingroup      WlzSectionTransform
00865 * \brief        3D viewing modes which determine the angle at which the plane
00866 *               is cut through a 3D volume.
00867 *               Typedef: ::WlzThreeDViewMode.
00868 */
00869 typedef enum _WlzThreeDViewMode
00870 {
00871   WLZ_STATUE_MODE,                      /*!< Corresponds to "walking around a
00872                                              statue" so that if the view is say
00873                                              from the left-hand side then the
00874                                              section will have the top of the
00875                                              statue to the left. */
00876   WLZ_UP_IS_UP_MODE,                    /*!< The projection of the vector up
00877                                              onto the section image will be
00878                                              "up". This is ill-defined if the
00879                                              viewing direction is very close to
00880                                              "up". */
00881   WLZ_FIXED_LINE_MODE,
00882   WLZ_ZERO_ZETA_MODE,
00883   WLZ_ZETA_MODE
00884 } WlzThreeDViewMode;
00885 
00886 /*!
00887 * \enum         _WlzWindowFnType
00888 * \ingroup      WlzValuesFilters
00889 * \brief        Types of window functions.
00890 *               Window functions are used to weight the grey values of Woolz
00891 *               domain objects according to the spatial distribution.
00892 *               Typedef: WlzWindowFnType.
00893 *
00894 *               The window functions are defined as:
00895 *                 \f[
00896                     blackman(r,R) = 0.42 +
00897                                     0.50 \cos{(\frac{2.00 \pi r}{R - 1.00})} +
00898                                     0.08 \cos{(\frac{4.00 \pi r}{R - 1.00})}
00899                   \f]
00900                   \f[
00901                     hamming(r,R) = 0.54 +
00902                                    0.46 \cos{(\frac{2.00 \pi r}{R - 1.00})}
00903                   \f]
00904                   \f[
00905                     hanning(r,R) = 0.50 +
00906                                    0.50 \cos{(\frac{2.00 \pi r}{R - 1.00})}
00907                   \f]
00908                   \f[
00909                     parzen(r,R) = 1.00 - 
00910                                   |frac{2.00 r - (R - 1.00)}{R + 1.00}|
00911                   \f]
00912                   \f[
00913                     welch(r,R) = 1.00 -
00914                                  {(\frac{2.00 r - (R - 1.00)}{R + 1.00})}^2
00915                   \f]
00916                   \f[
00917                     rectangle(r,R) = \left\{
00918                                      \begin{array}{ll}
00919                                      1.00 & |r_x| \leq R, |r_y| \leq R \\
00920                                      0.00 & |r_x| > R, |r_y| > R
00921                                      \end{array}
00922                                      \right.
00923                   \f]
00924 *               Where \f$R\f$ is the window radius and \f$r\f$ the radial
00925 *               distance from the centre of the window.
00926 */
00927 typedef enum _WlzWindowFnType
00928 {
00929   WLZ_WINDOWFN_NONE,                    /*!< No window function. */
00930   WLZ_WINDOWFN_BLACKMAN,                /*!< Blackman window. */
00931   WLZ_WINDOWFN_HAMMING,                 /*!< Hanning window. */
00932   WLZ_WINDOWFN_HANNING,
00933   WLZ_WINDOWFN_PARZEN,                  /*!< Parzen window. */
00934   WLZ_WINDOWFN_RECTANGLE,               /*!< Rectangular window. */
00935   WLZ_WINDOWFN_WELCH,                   /*!< Welch window. */
00936   WLZ_WINDOWFN_UNSPECIFIED              /*!< Not a window function also has
00937                                              a value equal to the number of
00938                                              window functions defined because
00939                                              it is the last in the enum. */
00940 } WlzWindowFnType;
00941 
00942 /*!
00943 * \enum         _WlzSampleFn
00944 * \ingroup      WlzTransform
00945 * \brief        Sampling functions.                                             
00946 *               Typedef: ::WlzSampleFn.
00947 */
00948 typedef enum _WlzSampleFn
00949 {
00950   WLZ_SAMPLEFN_NONE,                    /*!< No sampling function */
00951   WLZ_SAMPLEFN_POINT,                   /*!< Point sampling */
00952   WLZ_SAMPLEFN_MEAN,                    /*!< Mean value sample of data */
00953   WLZ_SAMPLEFN_GAUSS,                   /*!< Gaussian weighted sample of data */
00954   WLZ_SAMPLEFN_MIN,                     /*!< Minimum value sampling */
00955   WLZ_SAMPLEFN_MAX,                     /*!< Maximum value sampling */
00956   WLZ_SAMPLEFN_MEDIAN                   /*!< Median value sampling */
00957 } WlzSampleFn;
00958 
00959 /*!
00960 * \enum         _WlzScalarFeatureType
00961 * \ingroup      WlzFeatures
00962 * \brief        Scalar features of objects.
00963 */
00964 typedef enum _WlzScalarFeatureType
00965 {
00966   WLZ_SCALARFEATURE_VALUE,              /*!< Grey value. */
00967   WLZ_SCALARFEATURE_GRADIENT            /*!< Gradient of grey values. */
00968 } WlzScalarFeatureType;
00969 
00970 /*!
00971 * \enum         _WlzVertexType
00972 * \ingroup      WlzType
00973 * \brief        2D and 3D vertex types.
00974 *               Typedef: ::WlzVertexType.
00975 */
00976 typedef enum _WlzVertexType
00977 {
00978   WLZ_VERTEX_I2         = 1,            /*!< 2D integer vertex. */
00979   WLZ_VERTEX_F2,                        /*!< 2D single precision floating
00980                                              point vertex. */
00981   WLZ_VERTEX_D2,                        /*!< 2D double precision floating
00982                                              point vertex. */
00983   WLZ_VERTEX_I3,                        /*!< 3D integer vertex. */
00984   WLZ_VERTEX_F3,                        /*!< 3D single precision floating
00985                                              point vertex. */
00986   WLZ_VERTEX_D3                         /*!< 3D double precision floating
00987                                              point vertex. */
00988 } WlzVertexType;
00989 
00990 /*!
00991 * \struct       _WlzIVertex2
00992 * \ingroup      WlzType
00993 * \brief        2D integer vertex.
00994 *               Typedef: ::WlzIVertex2.
00995 */
00996 typedef struct _WlzIVertex2
00997 {
00998   int           vtY;
00999   int           vtX;
01000 } WlzIVertex2;
01001 
01002 /*!
01003 * \struct       _WlzFVertex2
01004 * \ingroup      WlzType
01005 * \brief        2D single precision float point vertex.
01006 *               Typedef: ::WlzFVertex2.
01007 */
01008 typedef struct _WlzFVertex2
01009 {
01010   float         vtY;
01011   float         vtX;
01012 } WlzFVertex2;
01013 
01014 /*!
01015 * \struct       _WlzDVertex2
01016 * \ingroup      WlzType
01017 * \brief        2D double precision float point vertex.
01018 *               Typedef: ::WlzDVertex2.
01019 */
01020 typedef struct _WlzDVertex2
01021 {
01022   double        vtY;
01023   double        vtX;
01024 } WlzDVertex2;
01025 
01026 
01027 /*!
01028 * \struct       _WlzIVertex3
01029 * \ingroup      WlzType
01030 * \brief        3D integer vertex.
01031 *               Typedef: ::WlzIVertex3.
01032 */
01033 typedef struct _WlzIVertex3
01034 {
01035   int           vtX;
01036   int           vtY;
01037   int           vtZ;
01038 } WlzIVertex3;
01039 
01040 /*!
01041 * \struct       _WlzFVertex3
01042 * \ingroup      WlzType
01043 * \brief        3D single precision float point vertex.
01044 *               Typedef: ::WlzFVertex3.
01045 */
01046 typedef struct _WlzFVertex3
01047 {
01048   float         vtX;
01049   float         vtY;
01050   float         vtZ;
01051 } WlzFVertex3;
01052 
01053 /*!
01054 * \struct       _WlzDVertex3
01055 * \ingroup      WlzType
01056 * \brief        3D double precision float point vertex.
01057 *               Typedef: ::WlzDVertex3.
01058 */
01059 typedef struct _WlzDVertex3
01060 {
01061   double        vtX;
01062   double        vtY;
01063   double        vtZ;
01064 } WlzDVertex3;
01065 
01066 /*!
01067 * \union        _WlzVertexP
01068 * \ingroup      WlzType
01069 * \brief        Union of vertex pointers.
01070 *               Typedef: ::WlzVertexP.
01071 */
01072 typedef union _WlzVertexP
01073 {
01074   void          *v;
01075   WlzIVertex2   *i2;
01076   WlzFVertex2   *f2;
01077   WlzDVertex2   *d2;
01078   WlzIVertex3   *i3;
01079   WlzFVertex3   *f3;
01080   WlzDVertex3   *d3;
01081 } WlzVertexP;
01082 
01083 /*!
01084 * \union        _WlzVertex
01085 * \ingroup      WlzType
01086 * \brief        Union of vertex values.
01087 *               Typedef: ::WlzVertex.
01088 */
01089 typedef union _WlzVertex
01090 {
01091   WlzIVertex2   i2;
01092   WlzFVertex2   f2;
01093   WlzDVertex2   d2;
01094   WlzIVertex3   i3;
01095   WlzFVertex3   f3;
01096   WlzDVertex3   d3;
01097 } WlzVertex;
01098 
01099 /*!
01100 * \struct       _WlzIBox2
01101 * \ingroup      WlzType
01102 * \brief        2D integer axis aligned rectangle (box).
01103 *               Typedef: ::WlzIBox2.
01104 */
01105 typedef struct _WlzIBox2
01106 {
01107   int           xMin;
01108   int           yMin;
01109   int           xMax;
01110   int           yMax;
01111 } WlzIBox2;
01112 
01113 /*!
01114 * \struct       _WlzDBox2
01115 * \ingroup      WlzType
01116 * \brief        2D double precision floating point axis aligned rectangle
01117 *               (box).
01118 *               Typedef: ::WlzDBox2.
01119 */
01120 typedef struct _WlzDBox2
01121 {
01122   double        xMin;
01123   double        yMin;
01124   double        xMax;
01125   double        yMax;
01126 } WlzDBox2;
01127 
01128 /*!
01129 * \struct       _WlzFBox2
01130 * \ingroup      WlzType
01131 * \brief        2D single precision floating point axis aligned rectangle
01132 *               (box).
01133 *               Typedef: ::WlzFBox2.
01134 */
01135 typedef struct _WlzFBox2
01136 {
01137   float         xMin;
01138   float         yMin;
01139   float         xMax;
01140   float         yMax;
01141 } WlzFBox2;
01142 
01143 /*!
01144 * \struct       _WlzIBox3
01145 * \ingroup      WlzType
01146 * \brief        3D integer axis aligned cubiod (box).
01147 *               Typedef: ::WlzIBox3.
01148 */
01149 typedef struct _WlzIBox3
01150 {
01151   int           xMin;
01152   int           yMin;
01153   int           zMin;
01154   int           xMax;
01155   int           yMax;
01156   int           zMax;
01157 } WlzIBox3;
01158 
01159 /*!
01160 * \struct       _WlzDBox3
01161 * \ingroup      WlzType
01162 * \brief        3D double precision floating point axis aligned cubiod (box).
01163 *               Typedef: ::WlzDBox3.
01164 */
01165 typedef struct _WlzDBox3
01166 {
01167   double        xMin;
01168   double        yMin;
01169   double        zMin;
01170   double        xMax;
01171   double        yMax;
01172   double        zMax;
01173 } WlzDBox3;
01174 
01175 /*!
01176 * \struct       _WlzFBox3
01177 * \ingroup      WlzType
01178 * \brief        3D single precision floating point axis aligned cubiod (box).
01179 *               Typedef: ::WlzFBox3.
01180 */
01181 typedef struct _WlzFBox3
01182 {
01183   float         xMin;
01184   float         yMin;
01185   float         zMin;
01186   float         xMax;
01187   float         yMax;
01188   float         zMax;
01189 } WlzFBox3;
01190 
01191 /*!
01192 * \union        _WlzBoxP
01193 * \ingroup      WlzType
01194 * \brief        Union of axis aligned box pointers.
01195 *               Typedef: ::WlzBoxP.
01196 */
01197 typedef union _WlzBoxP
01198 {
01199   void          *v;
01200   WlzIBox2      *i2;
01201   WlzFBox2      *f2;
01202   WlzDBox2      *d2;
01203   WlzIBox3      *i3;
01204   WlzFBox3      *f3;
01205   WlzDBox3      *d3;
01206 } WlzBoxP;
01207 
01208 /*!
01209 * \union        _WlzBox
01210 * \ingroup      WlzType
01211 * \brief        Union of axis aligned boxes.
01212 *               Typedef: ::WlzBox.
01213 */
01214 typedef union _WlzBox
01215 {
01216   WlzIBox2      i2;
01217   WlzFBox2      f2;
01218   WlzDBox2      d2;
01219   WlzIBox3      i3;
01220   WlzFBox3      f3;
01221   WlzDBox3      d3;
01222 } WlzBox;
01223 
01224 /************************************************************************
01225 * Grey values.
01226 ************************************************************************/
01227 
01228 /*!
01229 * \union        _WlzGreyP
01230 * \ingroup      WlzType
01231 * \brief        A union of pointers to grey values.
01232 *               Typedef: ::WlzGreyP.
01233 */
01234 typedef union _WlzGreyP
01235 {
01236   void          *v;                     /*!< Can save a cast when assigning. */
01237   WlzLong       *lnp;
01238   int           *inp;
01239   short         *shp;
01240   WlzUByte      *ubp;
01241   float         *flp;
01242   double        *dbp;
01243   WlzUInt       *rgbp;
01244   char          **bytes;
01245   unsigned char **ubytes;
01246 } WlzGreyP;
01247 
01248 /*!
01249 * \union        _WlzGreyV
01250 * \ingroup      WlzType
01251 * \brief        A union of grey values.
01252 *               Typedef: ::WlzGreyV.
01253 */
01254 typedef union _WlzGreyV
01255 {
01256   void          *v;                     /*!< Can save a cast when assigning. */
01257   WlzLong       lnv;
01258   int           inv;
01259   short         shv;
01260   WlzUByte      ubv;
01261   float         flv;
01262   double        dbv;
01263   WlzUInt       rgbv;
01264   char          bytes[8];
01265   unsigned char ubytes[8];
01266 } WlzGreyV;
01267 
01268 /*!
01269 * \struct       _WlzPixelV
01270 * \ingroup      WlzType
01271 * \brief        A typed grey value.
01272 *               Typedef: ::WlzPixelV.
01273 */
01274 typedef struct _WlzPixelV
01275 {
01276   WlzGreyType   type;                   /*!< Type of grey value. */
01277   WlzGreyV      v;                      /*!< The grey value. */
01278 } WlzPixelV;
01279 
01280 /*!
01281 * \struct       _WlzPixelP
01282 * \ingroup      WlzType
01283 * \brief        A typed grey value pointer.
01284 *               Typedef: ::WlzPixelP.
01285 */
01286 typedef struct _WlzPixelP
01287 {
01288   WlzGreyType   type;                   /*!< Type of grey value. */
01289   WlzGreyP      p;                      /*!< Pointer to the grey value(s). */
01290 } WlzPixelP;
01291 
01292 /*!
01293 * \struct       _WlzGreyTransformParam
01294 * \ingroup      WlzTransform
01295 * \brief        Grey-level transform parameters.
01296 *               Typedef: ::WlzGreyTransformParam.
01297 */
01298 typedef struct _WlzGreyTransformParam
01299 {
01300   WlzGreyTransformType type;            /*!< Grey transform type. */
01301   WlzPixelV     il;                     /*!< Input minimum grey value. */
01302   WlzPixelV     iu;                     /*!< Input maximum grey value. */
01303   WlzPixelV     ol;                     /*!< Output minimum grey value. */
01304   WlzPixelV     ou;                     /*!< Output maximum grey value. */
01305   double        p0;                     /*!< First parameter, used for
01306                                              gamma (\f$\gamma\f$) or
01307                                              sigmoid (\f$\mu\f$). */
01308   double        p1;                     /*!< Second parameter, used for
01309                                              sigmoid (\f$\sigma\f$). */
01310 } WlzGreyTransformParam;
01311 
01312 /************************************************************************
01313 * Markers.
01314 ************************************************************************/
01315 /*!
01316 * \enum         _WlzMarkerType
01317 * \ingroup      WlzType
01318 * \brief        Basic markers.
01319 *               Typedef: ::WlzMarkerType.
01320 */
01321 typedef enum _WlzMarkerType
01322 {
01323   WLZ_MARKER_NONE       = 0,            /*!< No marker. */
01324   WLZ_MARKER_POINT,                     /*!< Single point, pixel or voxel. */
01325   WLZ_MARKER_SPHERE                     /*!< Circle or sphere. */
01326 } WlzMarkerType;
01327 
01328 
01329 /************************************************************************
01330 * Data structures for geometric models.
01331 ************************************************************************/
01332 
01333 /*!
01334 * \def          WLZ_GM_TOLERANCE
01335 * \ingroup      WlzGeoModel
01336 * \brief        Tolerance for geometric queries in geometric models.
01337 */
01338 #define WLZ_GM_TOLERANCE        (1.0e-06)
01339 
01340 /*!
01341 * \def          WLZ_GM_TOLERANCE_SQ
01342 * \ingroup      WlzGeoModel
01343 * \brief        Square of tolerance for geometric queries in geometric models.
01344 */
01345 #define WLZ_GM_TOLERANCE_SQ     (WLZ_GM_TOLERANCE * WLZ_GM_TOLERANCE)
01346 
01347 /*!
01348 * \enum         _WlzGMModelType
01349 * \ingroup      WlzGeoModel
01350 * \brief        Types of geometric models.
01351 *               Typedef: WlzGMModelType.
01352 */
01353 typedef enum _WlzGMModelType
01354 {
01355   WLZ_GMMOD_2I = 1,
01356   WLZ_GMMOD_2D,
01357   WLZ_GMMOD_3I,
01358   WLZ_GMMOD_3D,
01359   WLZ_GMMOD_2N,
01360   WLZ_GMMOD_3N
01361 } WlzGMModelType;
01362 
01363 /*!
01364 * \enum         _WlzGMElemType
01365 * \ingroup      WlzGeoModel
01366 * \brief        Types of geometric model elements.
01367 *               Typedef: ::WlzGMElemType.
01368 */
01369 typedef enum _WlzGMElemType
01370 {
01371   WLZ_GMELM_NONE = 0,
01372   WLZ_GMELM_VERTEX,
01373   WLZ_GMELM_VERTEX_G2I,
01374   WLZ_GMELM_VERTEX_G2D,
01375   WLZ_GMELM_VERTEX_G2N,
01376   WLZ_GMELM_VERTEX_G3I,
01377   WLZ_GMELM_VERTEX_G3D,
01378   WLZ_GMELM_VERTEX_G3N,
01379   WLZ_GMELM_VERTEX_T,
01380   WLZ_GMELM_DISK_T,
01381   WLZ_GMELM_EDGE,
01382   WLZ_GMELM_EDGE_T,
01383   WLZ_GMELM_FACE,
01384   WLZ_GMELM_LOOP_T,
01385   WLZ_GMELM_SHELL,
01386   WLZ_GMELM_SHELL_G2I,
01387   WLZ_GMELM_SHELL_G2D,
01388   WLZ_GMELM_SHELL_G3I,
01389   WLZ_GMELM_SHELL_G3D
01390 } WlzGMElemType;
01391 
01392 /*!
01393 * \enum         _WlzGMElemTypeFlags
01394 * \ingroup      WlzGeoModel
01395 * \brief        Bit masks for the types of geometric model elements.
01396 *               Typedef: ::WlzGMElemTypeFlags.
01397 */
01398 typedef enum _WlzGMElemTypeFlags
01399 {
01400   WLZ_GMELMFLG_VERTEX =     (1 << 0),
01401   WLZ_GMELMFLG_VERTEX_G =   (1 << 1),
01402   WLZ_GMELMFLG_VERTEX_T =   (1 << 2),
01403   WLZ_GMELMFLG_DISK_T =     (1 << 3),
01404   WLZ_GMELMFLG_EDGE =       (1 << 4),
01405   WLZ_GMELMFLG_EDGE_T =     (1 << 5),
01406   WLZ_GMELMFLG_FACE =       (1 << 6),
01407   WLZ_GMELMFLG_LOOP_T =     (1 << 7),
01408   WLZ_GMELMFLG_SHELL =      (1 << 8),
01409   WLZ_GMELMFLG_SHELL_G =    (1 << 9)
01410 } WlzGMElemTypeFlags;
01411 
01412 /*!
01413 * \union        _WlzGMElemP
01414 * \ingroup      WlzGeoModel
01415 * \brief        A union of pointers to all the valid geometric model
01416 *               elements.
01417 *               Typedef: ::WlzGMElemP.
01418 */
01419 typedef union _WlzGMElemP
01420 {
01421   struct _WlzGMCore *core;
01422   struct _WlzGMVertex *vertex;
01423   struct _WlzGMVertexG2I *vertexG2I;
01424   struct _WlzGMVertexG2D *vertexG2D;
01425   struct _WlzGMVertexG2N *vertexG2N;
01426   struct _WlzGMVertexG3I *vertexG3I;
01427   struct _WlzGMVertexG3D *vertexG3D;
01428   struct _WlzGMVertexG3N *vertexG3N;
01429   struct _WlzGMVertexT *vertexT;
01430   struct _WlzGMDiskT    *diskT;
01431   struct _WlzGMEdge     *edge;
01432   struct _WlzGMEdgeT    *edgeT;
01433   struct _WlzGMFace     *face;
01434   struct _WlzGMLoopT    *loopT;
01435   struct _WlzGMShell    *shell;
01436   struct _WlzGMShellG2I *shellG2I;
01437   struct _WlzGMShellG2D *shellG2D;
01438   struct _WlzGMShellG3I *shellG3I;
01439   struct _WlzGMShellG3D *shellG3D;
01440 } WlzGMElemP;
01441 
01442 /*!
01443 * \struct       _WlzGMCore
01444 * \ingroup      WlzGeoModel
01445 * \brief        The core geometric model element from which all
01446 *               geometric modeling elements inherit the type and
01447 *               index fields.
01448 *               Typedef: ::WlzGMCore.
01449 */
01450 typedef struct _WlzGMCore
01451 {
01452   WlzGMElemType type;                   /*!< Any WlzGMElemType */
01453   int           idx;                    /*!< Unique identifier for the
01454                                              instance of this type in it's
01455                                              model. */
01456 } WlzGMCore;
01457 
01458 /*!
01459 * \struct       _WlzGMVertexG2I
01460 * \ingroup      WlzGeoModel
01461 * \brief        The position of a point in 2D integer space.
01462 *               Typedef: ::WlzGMVertexG2I.
01463 */
01464 typedef struct _WlzGMVertexG2I
01465 {
01466   WlzGMElemType type;                   /*!< WLZ_GMELM_VERTEX_G2I */
01467   int           idx;                    /*!< Unique identifier for the
01468                                              vertex geometry. */
01469   WlzIVertex2   vtx;                    /*!< Where the point lies in space. */
01470 } WlzGMVertexG2I;
01471 
01472 /*!
01473 * \struct       _WlzGMVertexG2D
01474 * \ingroup      WlzGeoModel
01475 * \brief        The position of a point in 2D double precision space.
01476 *               Typedef: ::WlzGMVertexG2D.
01477 */
01478 typedef struct _WlzGMVertexG2D
01479 {
01480   WlzGMElemType type;                   /*!< WLZ_GMELM_VERTEX_G2D */
01481   int           idx;                    /*!< Unique identifier for vertex
01482                                              geometry. */
01483   WlzDVertex2   vtx;                    /*!< Where the point lies in space. */
01484 } WlzGMVertexG2D;
01485 
01486 /*!
01487 * \struct       _WlzGMVertexG2N
01488 * \ingroup      WlzGeoModel
01489 * \brief        The position of a point in 2D double precision space
01490 *               and the normal vector at that point.
01491 *               Note that the data structure is the same as ::WlzGMVertexG2D
01492 *               until the normal, this is important as it allows the type,
01493 *               index and position to be established without knowing whether
01494 *               the vertex geometry is ::WlzGMVertexG2D or ::WlzGMVertexG2N.
01495 *               Typedef: ::WlzGMVertexG2N.
01496 */
01497 typedef struct _WlzGMVertexG2N
01498 {
01499   WlzGMElemType type;                   /*!< WLZ_GMELM_VERTEX_G2N */
01500   int           idx;                    /*!< Unique identifier for vertex
01501                                              geometry */
01502   WlzDVertex2   vtx;                    /*!< Where the point lies in space */
01503   WlzDVertex2   nrm;                    /*!< Normal at the point. */
01504 } WlzGMVertexG2N;
01505 
01506 /*!
01507 * \struct       _WlzGMVertexG3I
01508 * \ingroup      WlzGeoModel
01509 * \brief        The position of a point in 3D integer space.
01510 *               Typedef: ::WlzGMVertexG3I.
01511 */
01512 typedef struct _WlzGMVertexG3I
01513 {
01514   WlzGMElemType type;                   /*!< WLZ_GMELM_VERTEX_G3I */
01515   int           idx;                    /*!< Unique identifier for vertex
01516                                              geometry. */
01517   WlzIVertex3   vtx;                    /*!< Where the point lies in space. */
01518 } WlzGMVertexG3I;
01519 
01520 /*!
01521 * \struct       _WlzGMVertexG3D
01522 * \ingroup      WlzGeoModel
01523 * \brief        The position of a point in 3D double precision space.
01524 *               Typedef: ::WlzGMVertexG3D.
01525 */
01526 typedef struct _WlzGMVertexG3D
01527 {
01528   WlzGMElemType type;                   /*!< WLZ_GMELM_VERTEX_G3D */
01529   int           idx;                    /*!< Unique identifier for vertex
01530                                              geometry */
01531   WlzDVertex3   vtx;                    /*!< Where the point lies in space */
01532 } WlzGMVertexG3D;
01533 
01534 /*!
01535 * \struct       _WlzGMVertexG3N
01536 * \ingroup      WlzGeoModel
01537 * \brief        The position of a point in 3D double precision space
01538 *               and the normal vector at that point.
01539 *               Note that the data structure is the same as ::WlzGMVertexG3D
01540 *               until the normal, this is important as it allows the type,
01541 *               index and position to be established without knowing whether
01542 *               the vertex geometry is ::WlzGMVertexG3D or ::WlzGMVertexG3N.
01543 *               Typedef: ::WlzGMVertexG3N.
01544 */
01545 typedef struct _WlzGMVertexG3N
01546 {
01547   WlzGMElemType type;                   /*!< WLZ_GMELM_VERTEX_G3N */
01548   int           idx;                    /*!< Unique identifier for vertex
01549                                              geometry */
01550   WlzDVertex3   vtx;                    /*!< Where the point lies in space */
01551   WlzDVertex3   nrm;                    /*!< Normal at the point. */
01552 } WlzGMVertexG3N;
01553 
01554 /*!
01555 * \union        _WlzGMVertexGU
01556 * \ingroup      WlzGeoModel
01557 * \brief        A union of pointers to the geometric properties of a point.
01558 *               Typedef: ::WlzGMVertexGU.
01559 */
01560 typedef union _WlzGMVertexGU
01561 {
01562   WlzGMCore     *core;
01563   WlzGMVertexG2I *vg2I;
01564   WlzGMVertexG2D *vg2D;
01565   WlzGMVertexG2N *vg2N;
01566   WlzGMVertexG3I *vg3I;
01567   WlzGMVertexG3D *vg3D;
01568   WlzGMVertexG3N *vg3N;
01569 } WlzGMVertexGU;
01570 
01571 /*!
01572 * \struct       _WlzGMVertexT
01573 * \ingroup      WlzGeoModel
01574 * \brief        The topological properties of a point in space.
01575 *               The ordering of the linked list of vertex topology elements
01576 *               formed by the 'next' and 'prev' pointers is not significant.
01577 *               Typedef: ::WlzGMVertexT.
01578 */
01579 typedef struct _WlzGMVertexT
01580 {
01581   WlzGMElemType type;                   /*!< WLZ_GMELM_VERTEX_T */
01582   int           idx;                    /*!< Unique identifier for vertex
01583                                              topology element. */
01584   struct _WlzGMVertexT *next;           /*!< Next vertexT in disk. */
01585   struct _WlzGMVertexT *prev;           /*!< Previous vertexT in disk. */
01586   struct _WlzGMDiskT *diskT;            /*!< The disk topology element that
01587                                              this vertex topology element
01588                                              is in. */
01589   struct _WlzGMEdgeT *parent;           /*!< Parent of this vertex topology
01590                                              element. */
01591 } WlzGMVertexT;
01592 
01593 /*!
01594 * \struct       _WlzGMVertex
01595 * \ingroup      WlzGeoModel
01596 * \brief        A single point in space defined in terms of both it's
01597 *               geometry and it's topology.
01598 *               Typedef: ::WlzGMVertex.
01599 */
01600 typedef struct _WlzGMVertex
01601 {
01602   WlzGMElemType type;                   /*!< WLZ_GMELM_VERTEX */
01603   int           idx;                    /*!< Unique identifier for vertex. */
01604   struct _WlzGMDiskT *diskT;            /*!< A disk topology element of this
01605                                              vertex, others can be found by
01606                                              following the diskT's next/prev
01607                                              fields. */
01608   WlzGMVertexGU geo;                    /*!< Geometry of this vertex. */
01609   struct _WlzGMVertex *next;            /*!< Next in sorted list. */
01610 } WlzGMVertex;
01611 
01612 /*!
01613 * \struct       _WlzGMDiskT
01614 * \ingroup      WlzGeoModel
01615 * \brief        A topological disk around a vertex. In 2D or 3D manifold
01616 *               there is one disk per vertex. But in a 3D non-manifold shell
01617 *               many sheets (manifold surfaces components) may be connected
01618 *               at a single vertex, in which case there is one disk per sheet.
01619 *               The disk encodes the radial order of the vertex topology
01620 *               elements around the vertex.
01621 *               Typedef: ::WlzGMDiskT.
01622 */
01623 typedef struct _WlzGMDiskT
01624 {
01625   WlzGMElemType type;                   /*!< WLZ_GMELM_DISK_T */
01626   int           idx;                    /*!< Unique identifier for vertex. */
01627   struct _WlzGMDiskT *next;             /*!< Next diskT of vertex. */
01628   struct _WlzGMDiskT *prev;             /*!< Previous diskT of vertex. */
01629   WlzGMVertex   *vertex;                /*!< The vertex that this disk cycles
01630                                              around. */
01631   WlzGMVertexT  *vertexT;               /*!< A vertex topology element in this
01632                                              disk topology element. */
01633 } WlzGMDiskT;
01634 
01635 /*!
01636 * \struct       _WlzGMEdgeT
01637 * \ingroup      WlzGeoModel
01638 * \brief        The topological properties of a directed edge.
01639 *               Typedef: ::WlzGMEdgeT.
01640 */
01641 typedef struct _WlzGMEdgeT
01642 {
01643   WlzGMElemType type;                   /*!< WLZ_GMELM_EDGE_T */
01644   int           idx;                    /*!< Unique identifier for the edge
01645                                          *   topology element. */
01646   struct _WlzGMEdgeT *next;             /*!< Next edgeT in the parent. */
01647   struct _WlzGMEdgeT *prev;             /*!< Previous edgeT in the parent. */
01648   struct _WlzGMEdgeT *opp;              /*!< Opposite edge topology element. */
01649   struct _WlzGMEdgeT *rad;              /*!< The radial edge topology
01650                                              element. */
01651   struct _WlzGMEdge *edge;              /*!< The edge. */
01652   struct _WlzGMVertexT *vertexT;        /*!< Vertex FROM which this edge
01653                                              topology element is directed. */
01654   struct _WlzGMLoopT *parent;           /*!< Parent of this edge topology
01655                                              element. */
01656 } WlzGMEdgeT;
01657 
01658 /*!
01659 * \struct       _WlzGMEdge
01660 * \ingroup      WlzGeoModel
01661 * \brief        A line or curve between a pair of vertices.
01662 *               Although this only has a topological component a geometric
01663 *               component would allow curves to be represented.
01664 *               Typedef: ::WlzGMEdge.
01665 */
01666 typedef struct _WlzGMEdge
01667 {
01668   WlzGMElemType type;                   /*!< WLZ_GMELM_EDGE */
01669   int           idx;                    /*!< Unique identifier for edge. */
01670   WlzGMEdgeT    *edgeT;                 /*!< One of the many edge topology
01671                                              elements from which the others
01672                                              can be found by following it's
01673                                              opp/rad fields. */
01674 } WlzGMEdge;
01675 
01676 /*!
01677 * \struct       _WlzGMLoopT
01678 * \ingroup      WlzGeoModel
01679 * \brief        A directed loop or the topological properties of a loop.
01680 *               Typedef: ::WlzGMLoopT.
01681 */
01682 typedef struct _WlzGMLoopT
01683 {
01684   WlzGMElemType type;                   /*!< WLZ_GMELM_LOOP_T */
01685   int           idx;                    /*!< Unique identifier for loop
01686                                              topology element. */
01687   struct _WlzGMLoopT *next;             /*!< The next loopT in the parent. */
01688   struct _WlzGMLoopT *prev;             /*!< The previous loopT in the
01689                                              parent. */
01690   struct _WlzGMLoopT *opp;              /*!< The opposite loop topology
01691                                              element. */
01692   struct _WlzGMFace *face;              /*!< The face not used in 2D models. */
01693   WlzGMEdgeT *edgeT;                    /*!< An edge topology element in
01694                                              this loop topology element, the
01695                                              others can be found by walking
01696                                              the edgeT's next/prev fields. */
01697   struct _WlzGMShell *parent;           /*!< Parent of this loopT. */
01698 } WlzGMLoopT;
01699 
01700 /*!
01701 * \struct       _WlzGMFace
01702 * \ingroup      WlzGeoModel
01703 * \brief        A circuit of edges.
01704 *               Typedef: ::WlzGMFace.
01705 */
01706 typedef struct _WlzGMFace
01707 {
01708   WlzGMElemType type;                   /*!< WLZ_GMELM_FACE */
01709   int           idx;                    /*!< Unique identifier for face. */
01710   WlzGMLoopT    *loopT;                 /*!< A directed loop topology element
01711                                              of the face. */
01712 } WlzGMFace;
01713 
01714 /*!
01715 * \struct       _WlzGMShellG2I
01716 * \ingroup      WlzGeoModel
01717 * \brief        The geometric properties of a shell in 2D integer space.
01718 *               Typedef: ::WlzGMShellG2I.
01719 */
01720 typedef struct _WlzGMShellG2I
01721 {
01722   WlzGMElemType type;                   /*!< WLZ_GMELM_SHELL_G2I */
01723   int           idx;                    /*!< Unique identifier for shell
01724                                              geometry element. */
01725   WlzIBox2      bBox;                   /*!< The bounding box of the shell. */
01726 } WlzGMShellG2I;
01727 
01728 /*!
01729 * \struct       _WlzGMShellG2D
01730 * \ingroup      WlzGeoModel
01731 * \brief        The geometric properties of a shell in 2D double precision
01732 *               space.
01733 *               Typedef: ::WlzGMShellG2D.
01734 */
01735 typedef struct _WlzGMShellG2D
01736 {
01737   WlzGMElemType type;                   /*!< WLZ_GMELM_SHELL_G2D */
01738   int           idx;                    /*!< Unique identifier for shell
01739                                              geometry element. */
01740   WlzDBox2      bBox;                   /*!< Bounding box of the shell. */
01741 } WlzGMShellG2D;
01742 
01743 /*!
01744 * \struct       _WlzGMShellG3I
01745 * \ingroup      WlzGeoModel
01746 * \brief        The geometric properties of a shell in 3D integer space.
01747 *               Typedef: ::WlzGMShellG3I.
01748 */
01749 typedef struct _WlzGMShellG3I
01750 {
01751   WlzGMElemType type;                   /*!< WLZ_GMELM_SHELL_G3I */
01752   int           idx;                    /*!< Unique identifier for shell
01753                                              geometry element. */
01754   WlzIBox3      bBox;                   /*!< Bounding box of the shell. */
01755 } WlzGMShellG3I;
01756 
01757 /*!
01758 * \struct       _WlzGMShellG3D
01759 * \ingroup      WlzGeoModel
01760 * \brief        The geometric properties of a shell in 3D double precision.
01761 *               space.
01762 *               Typedef: ::WlzGMShellG3D.
01763 */
01764 typedef struct _WlzGMShellG3D
01765 {
01766   WlzGMElemType type;                   /*!< WLZ_GMELM_SHELL_G3D */
01767   int           idx;                    /*!< Unique identifier for shell
01768                                              geometry element. */
01769   WlzDBox3      bBox;                   /*!< Bounding box of the shell. */
01770 } WlzGMShellG3D;
01771 
01772 /*!
01773 * \union        _WlzGMShellGU
01774 * \ingroup      WlzGeoModel
01775 * \brief        A union of pointers to the geometric properties of a shell.
01776 *               Typedef: ::WlzGMShellGU.
01777 */
01778 typedef union _WlzGMShellGU
01779 {
01780   WlzGMCore     *core;
01781   WlzGMShellG2I *sg2I;
01782   WlzGMShellG2D *sg2D;
01783   WlzGMShellG3I *sg3I;
01784   WlzGMShellG3D *sg3D;
01785 } WlzGMShellGU;
01786 
01787 /*!
01788 * \struct       _WlzGMShell
01789 * \ingroup      WlzGeoModel
01790 * \brief        A shell which is a collection of connected geometric
01791 *               modeling elements.
01792 *               Typedef: ::WlzGMShell.
01793 */
01794 typedef struct _WlzGMShell
01795 {
01796   WlzGMElemType type;                   /*!< WLZ_GMELM_SHELL */
01797   int           idx;                    /*!< The shell's index. */
01798   struct _WlzGMShell *next;             /*!< the next shell in the model. */
01799   struct _WlzGMShell *prev;             /*!< The previous shell in the
01800                                              model. */
01801   WlzGMShellGU geo;                     /*!< The shell's geometry. */
01802   WlzGMLoopT    *child;                 /*!< A child loop topology element
01803                                              of the shell from which all
01804                                              the others can be reached
01805                                              by walking the next/prev
01806                                              fields. */
01807   struct _WlzGMModel *parent;           /*!< The parent model of the shell. */
01808 } WlzGMShell;
01809 
01810 /*!
01811 * \enum         _WlzGMCbReason
01812 * \ingroup      WlzGeoModel
01813 * \brief        The reason a callback function is called.
01814 *               Typedef: ::WlzGMCbReason.
01815 */
01816 typedef enum _WlzGMCbReason
01817 {
01818   WLZ_GMCB_NEW,                         /*!< New element has been created. */
01819   WLZ_GMCB_FREE                         /*!< Existing element is about to
01820                                              be free'd. */
01821 } WlzGMCbReason;
01822 
01823 /*!
01824 * \struct       _WlzGMResource
01825 * \ingroup      WlzGeoModel
01826 * \brief        A resource vector (extensible array) used for allocating
01827 *               geometric modeling elements.
01828 *               Typedef: ::WlzGMResource.
01829 */
01830 typedef struct _WlzGMResource
01831 {
01832   unsigned int  numElm;                 /*!< Number of element type in model. */
01833   unsigned int  numIdx;                 /*!< Number of elements/indicies which
01834                                              have been pulled from the vector,
01835                                              with elm->idx < numIdx for all
01836                                              elements. */
01837   AlcVector     *vec;                   /*!< Vector (extensible array) of
01838                                              elements. */
01839 } WlzGMResource;
01840 
01841 /*!
01842 * \struct       _WlzGMModelR
01843 * \ingroup      WlzGeoModel
01844 * \brief        The resources used by a model.
01845 *               Typedef: ::WlzGMModelR.
01846 */
01847 typedef struct _WlzGMModelR
01848 {
01849   struct _WlzGMCbEntry  *callbacks;             /*!< Linked list of functions which
01850                                             are called when new elements are
01851                                             created or existing elements are
01852                                             destroyed. */
01853   WlzGMResource vertex;                 /*!< Vertex elements. */
01854   WlzGMResource vertexT;                /*!< Vertex topology elements. */
01855   WlzGMResource vertexG;                /*!< Vertex geometry elements. */
01856   WlzGMResource diskT;                  /*!< Disk geometry elements. */
01857   WlzGMResource edge;                   /*!< Edge elements. */
01858   WlzGMResource edgeT;                  /*!< Edge topology element elements. */
01859   WlzGMResource face;                   /*!< Face elements. */
01860   WlzGMResource loopT;                  /*!< Loop topology element elements. */
01861   WlzGMResource shell;                  /*!< Shell elements. */
01862   WlzGMResource shellG;                 /*!< Shell geometry elements. */
01863 } WlzGMModelR;
01864 
01865 /*!
01866 * \struct       _WlzGMModel
01867 * \ingroup      WlzGeoModel
01868 * \brief        A geometric model which can represent both 2D graphs
01869 *               and 3D surfaces, with the surfaces being either
01870 *               manifold or non-manifold.
01871 *               The geometric model inherits it's core fields from
01872 *               the Woolz core domain.
01873 *               Typedef: ::WlzGMModel.
01874 */
01875 typedef struct _WlzGMModel
01876 {
01877   WlzGMModelType type;                  /*!< Type of model integer or double
01878                                          * precision, 2D or 3D */
01879   int           linkcount;              /*!< Core. */
01880   void          *freeptr;               /*!< Core. */
01881   WlzGMShell    *child;                 /*!< A child shell of the model, others
01882                                              can be reached by walking the
01883                                              next/prev fields. */
01884   int           vertexHTSz;             /*!< Vertex hash table size. */
01885   WlzGMVertex   **vertexHT;             /*!< Vertex hash table. */
01886   WlzGMModelR   res;                    /*!< Model resources. */
01887 } WlzGMModel;
01888 
01889 #ifndef WLZ_EXT_BIND
01890 /*!
01891 * \typedef      WlzGMCbFn
01892 * \ingroup      WlzGeoModel
01893 * \brief        A pointer function to a function called when elements of a
01894 *               Woolz geometric model are either created or deleted.
01895 */
01896 typedef void    (*WlzGMCbFn)(WlzGMModel *, WlzGMElemP ,
01897                              WlzGMCbReason, void *);
01898 
01899 /*!
01900 * \struct       _WlzGMCbEntry
01901 * \ingroup      WlzGeoModel
01902 * \brief        
01903 */
01904 typedef struct  _WlzGMCbEntry
01905 {
01906   WlzGMCbFn     fn;
01907   void          *data;
01908   struct _WlzGMCbEntry *next;
01909 } WlzGMCbEntry;
01910 
01911 #endif /* WLZ_EXT_BIND */
01912 
01913 /*!
01914 * \struct       _WlzGMResIdx
01915 * \ingroup      WlzGeoModel
01916 * \brief        A resource index look up table (::WlzGMResIdxTb).
01917 *               The array of indicies is a look up table from the indicies of a
01918 *               GM to contigous indicies suitable for copying or outputing a
01919 *               resource vector without holes.
01920 *               Typedef: ::WlzGMResIdx.
01921 */
01922 typedef struct _WlzGMResIdx
01923 {
01924   int           idxCnt;                 /*!< Number of indicies in lut. */
01925   int           *idxLut;                /*!< Index look up table. */
01926 } WlzGMResIdx;
01927 
01928 /*!
01929 * \struct       _WlzGMResIdxTb
01930 * \ingroup      WlzGeoModel
01931 * \brief        Resource look up tables for all geometric elements in
01932 *               a model.
01933 *               Typedef: ::WlzGMResIdxTb.
01934 */
01935 typedef struct _WlzGMResIdxTb
01936 {
01937   WlzGMResIdx   vertex;
01938   WlzGMResIdx   vertexT;
01939   WlzGMResIdx   vertexG;
01940   WlzGMResIdx   diskT;
01941   WlzGMResIdx   edge;
01942   WlzGMResIdx   edgeT;
01943   WlzGMResIdx   face;
01944   WlzGMResIdx   loopT;
01945   WlzGMResIdx   shell;
01946   WlzGMResIdx   shellG;
01947 } WlzGMResIdxTb;
01948 
01949 /*!
01950 * \struct      _WlzGMGridWSpCell3D
01951 * \ingroup     WlzGeoModel
01952 * \brief       A single cell entry in an axis aligned grid for a 3D model.
01953 *              Typedef: ::WlzGMGridWSpCell3D
01954 */
01955 typedef struct _WlzGMGridWSpCell3D
01956 {
01957   WlzGMElemP    elem;                   /*! Geometric model element which
01958                                             intersects the cuboid of this
01959                                             cell. */
01960   struct _WlzGMGridWSpCell3D *next;     /*! The next cell in the linked list of
01961                                             cells. */
01962 } WlzGMGridWSpCell3D;
01963 
01964 /*!
01965 * \struct      _WlzGMGridWSp3D
01966 * \ingroup     WlzGeoModel
01967 * \brief       An axis aligned grid of cuboid cells. This has an array (the
01968 *              grid) of linked lists of cells, with the entries in each
01969 *              list holding the faces of the 3D model which intersect the
01970 *              cuboid of the cell.
01971 *              Typedef: ::WlzGMGridWSp3D
01972 */
01973 typedef struct _WlzGMGridWSp3D
01974 {
01975   WlzGMModelType elemType;              /*! Element type that the grid is
01976                                             defined for. */
01977   WlzIVertex3   nCells;                 /*! Dimensions of the cell grid
01978                                             array in terms of the number of
01979                                             cells. */
01980   double        cellSz;                 /*! Each cell is an axis aligned
01981                                             square with this side length. */
01982   WlzDVertex3   org;                    /*! Model coordinate value at the cell
01983                                             origin. */
01984   struct _WlzGMGridWSpCell3D ****cells; /*! Array of linked list of cells. */
01985   int           cellVecMax;             /*! Number of cells allocated and the
01986                                             index into cell vector of next
01987                                             cell available. */
01988   AlcVector     *cellVec;               /*! Extensible vector of cells for
01989                                             adding to the array of linked lists
01990                                             of cells. */
01991 } WlzGMGridWSp3D;
01992 
01993 /************************************************************************
01994 * Data structures for linear binary tree domains.
01995 ************************************************************************/
01996 
01997 /*!
01998 * \enum         _WlzLBTNodeClass2D
01999 * \ingroup      WlzType
02000 * \brief        Classification of a 2D LBT node a face of a 3D LBT node bycl
02001 *               its connectivity with it's neighbouring nodes (2D) or faces
02002 *               (3D)
02003 */
02004 typedef enum _WlzLBTNodeClass2D
02005 {
02006   WLZ_LBT_NODE_CLASS_2D_0,      /*!< Node has no more than one neighbour on
02007                                      any edge.
02008 \verbatim
02009                                   0
02010 2D  +---+       3D               /
02011     |   |           z      5----/4
02012     |   |           ^  y   |   / |
02013     |   |           | %    |  1  |
02014     +---+           |/     |     |
02015                     +--->x 2-----3
02016 \endverbatim */
02017   WLZ_LBT_NODE_CLASS_2D_1,      /*!< Node has no more than one neighbour on all
02018                                      edges except one.
02019 \verbatim
02020                                   0
02021 2D  +-+-+       3D               /
02022     |   |           z      5--6-/4
02023     |   |           ^  y   |   / |
02024     |   |           | %    |  1  |
02025     +---+           |/     |     |
02026                     +--->x 2-----3
02027 \endverbatim */
02028   WLZ_LBT_NODE_CLASS_2D_2,      /*!< Node only has more than one neighbour on
02029                                      adjacent edges.
02030 \verbatim
02031                                   0
02032 2D  +-+-+       3D               /
02033     |   |           z      5--6-/4
02034     |   +           ^  y   |   / |
02035     |   |           | %    |  1  7
02036     +---+           |/     |     |
02037                     +--->x 2-----3
02038 \endverbatim */
02039   WLZ_LBT_NODE_CLASS_2D_3,      /*!< Node only has more than one neighbour on
02040                                      opposite edges.
02041 \verbatim
02042                                   0
02043 2D  +-+-+       3D               /
02044     |   |           z      5--6-/4
02045     |   |           ^  y   |   / |
02046     |   |           | %    |  1  |
02047     +-+-+           |/     |     |
02048                     +--->x 2--7--3
02049 \endverbatim */
02050 
02051   WLZ_LBT_NODE_CLASS_2D_4,      /*!< Node has more than one neighbour on all
02052                                      edges except one.
02053 \verbatim
02054                                   0
02055 2D  +-+-+       3D               /
02056     |   |           z      5--6-/4
02057     |   +           ^  y   |   / |
02058     |   |           | %    |  1  8
02059     +-+-+           |/     |     |
02060                     +--->x 2--7--3
02061 \endverbatim */
02062   WLZ_LBT_NODE_CLASS_2D_5       /*!< Node has more than one neighbour on all
02063                                      edges.
02064 \verbatim
02065                                   0
02066 2D  +-+-+       3D               /
02067     |   |           z      5--6-/4
02068     +   +           ^  y   |   / |
02069     |   |           | %    9  1  8
02070     +-+-+           |/     |     |
02071                     +--->x 2--7--3
02072 \endverbatim */
02073 } WlzLBTNodeClass2D;
02074 
02075 /*!
02076 * \def          WLZ_LBTDOMAIN_MAXDIGITS
02077 * \ingroup      WlzType
02078 * \brief        The maximum number of linear binary tree key digits,
02079 *               which must be less than the number of bits in an int.
02080 */
02081 #define WLZ_LBTDOMAIN_MAXDIGITS (30)
02082 
02083 /*!
02084 * \enum         _WlzLBTNodeFlags
02085 * \ingroup      WlzGeoModel
02086 * \brief        The reason a callback function is called.
02087 *               Typedef: ::WlzGMCbReason.
02088 */
02089 typedef enum _WlzLBTNodeFlags
02090 {
02091   WLZ_LBT_NODE_FLAG_NONE        = 0,
02092   WLZ_LBT_NODE_FLAG_BOUNDARY    = 1     /*!< Node is adjacent to the objects
02093                                              boundary. */
02094 } WlzLBTNodeFlags;
02095 
02096 /*!
02097 * \struct       _WlzLBTNode2D
02098 * \ingroup      WlzType
02099 * \brief        A 2D linear binary tree node for spatial domain representation.
02100 *               Typedef: ::WlzLBTNode2D.
02101 */
02102 typedef struct _WlzLBTNode2D
02103 {
02104   unsigned              flags;          /*!< Bit flags fo the node. */
02105   unsigned              keys[3];        /*!< A single location key which
02106                                              uses bit interleaving with
02107                                              the bits interleaved between
02108                                              the elements for column, line
02109                                              and term in that order.
02110                                              Each of the array elements must
02111                                              have at least
02112                                              WLZ_LBTDOMAIN_MAXDIGITS bits. */
02113 } WlzLBTNode2D;
02114 
02115 /*!
02116 * \struct       _WlzLBTNode3D
02117 * \ingroup      WlzType
02118 * \brief        A 3D linear binary tree node for spatial domain representation.
02119 *               Typedef: ::WlzLBTNode3D.
02120 */
02121 typedef struct _WlzLBTNode3D
02122 {
02123   unsigned              flags;          /*!< Bit flags fo the node. */
02124   unsigned              keys[4];        /*!< A single location key which
02125                                              uses bit interleaving with
02126                                              the bits interleaved between
02127                                              the elements for column, line
02128                                              plane and term in that order.
02129                                              Each of the array elements must
02130                                              have at least
02131                                              WLZ_LBTDOMAIN_MAXDIGITS bits. */
02132 } WlzLBTNode3D;
02133 
02134 /*!
02135 * \struct       _WlzLBTDomain2D
02136 * \ingroup      WlzType
02137 * \brief        A 2D linear binary tree spatial domain representation.
02138 *               Typedef: ::WlzLBTDomain2D.
02139 */
02140 typedef struct _WlzLBTDomain2D
02141 {
02142   WlzObjectType         type;           /*!< From WlzCoreDomain. */
02143   int                   linkcount;      /*!< From WlzCoreDomain. */
02144   void                  *freeptr;       /*!< From WlzCoreDomain. */
02145   int                   line1;          /*!< First line coordinate. */
02146   int                   lastln;         /*!< Last line coordinate. */
02147   int                   kol1;           /*!< First column line
02148                                              coordinate. */
02149   int                   lastkl;         /*!< Last column  line
02150                                              coordinate. */
02151   int                   depth;          /*!< LBT depth. */
02152   int                   nNodes;         /*!< Number of nodes in the
02153                                              tree. */
02154   int                   maxNodes;       /*!< Number of nodes
02155                                              allocated. */
02156   WlzLBTNode2D          *nodes;         /*!< Array of nodes sorted by their
02157                                              location key. */
02158 } WlzLBTDomain2D;
02159 
02160 /*!
02161 * \struct       _WlzLBTDomain3D
02162 * \ingroup      WlzType
02163 * \brief        A 3D linear binary tree spatial domain representation.
02164 *               Typedef: ::WlzLBTDomain3D.
02165 */
02166 typedef struct _WlzLBTDomain3D
02167 {
02168   WlzObjectType         type;           /*!< From WlzCoreDomain. */
02169   int                   linkcount;      /*!< From WlzCoreDomain. */
02170   void                  *freeptr;       /*!< From WlzCoreDomain. */
02171   int                   plane1;         /*!< First plane coordinate. */
02172   int                   lastpl;         /*!< Last plane coordinate. */
02173   int                   line1;          /*!< First line coordinate. */
02174   int                   lastln;         /*!< Last line coordinate. */
02175   int                   kol1;           /*!< First column line
02176                                              coordinate. */
02177   int                   lastkl;         /*!< Last column  line
02178                                              coordinate. */
02179   int                   depth;          /*!< LBT depth. */
02180   int                   nNodes;         /*!< Number of nodes in the
02181                                              tree. */
02182   int                   maxNodes;       /*!< Number of nodes
02183                                              allocated. */
02184   WlzLBTNode3D          *nodes;         /*!< Array of nodes sorted by their
02185                                              location key. */
02186 } WlzLBTDomain3D;
02187 
02188 /************************************************************************
02189 * Data structures for contours (both 2D and 3D).
02190 ************************************************************************/
02191 
02192 /*!
02193 * \enum         _WlzContourMethod
02194 * \ingroup      WlzContour
02195 * \brief        Contour generation methods.
02196                 Typedef: ::WlzContourMethod.
02197 */
02198 typedef enum _WlzContourMethod
02199 {
02200   WLZ_CONTOUR_MTD_ISO,                  /*!< Iso-value. */
02201   WLZ_CONTOUR_MTD_GRD,                  /*!< Maximum gradient value. */
02202   WLZ_CONTOUR_MTD_BND,                  /*!< Object boundary. */
02203   WLZ_CONTOUR_MTD_RBFBND                /*!< Object boundary established using
02204                                              a radial basis function. */
02205 } WlzContourMethod;
02206 
02207 /*!
02208 * \struct       _WlzContour
02209 * \ingroup      WlzContour
02210 * \brief        A collection of 2D polylines or 3D surface elements
02211 *               represented by a Woolz geometric model.
02212 *               Typedef: ::WlzContour.
02213 */
02214 typedef struct _WlzContour
02215 {
02216   WlzObjectType type;                   /*!< WLZ_CONTOUR. */
02217   int           linkcount;              /*!< Core. */
02218   void          *freeptr;               /*!< Core. */
02219   WlzGMModel    *model;                 /*!< The Woolz geometric model
02220                                              defining the contour. */
02221 } WlzContour;
02222 
02223 
02224 #ifndef WLZ_EXT_BIND
02225 /*!
02226 * \typedef      Wlz3DProjectionIntFn
02227 * \ingroup      WlzFunction
02228 * \brief        Callback function for the WlzGetProjectionFromObject().
02229 */
02230 typedef WlzPixelV (*Wlz3DProjectionIntFn)(WlzPixelP, int, int, void *,
02231                                           WlzErrorNum *);
02232 #endif
02233 
02234 /*!
02235 * \struct       _WlzLUTDomain
02236 * \ingroup      WlzType
02237 * \brief        A look up table domain.
02238 *               Typedef: ::WlzLUTDomain.
02239 */
02240 typedef struct _WlzLUTDomain
02241 {
02242   WlzObjectType type;                   /*!< WLZ_LUT. */
02243   int           linkcount;              /*!< Core. */
02244   void          *freeptr;               /*!< Core. */
02245   int           bin1;                   /*!< Index of the first bin in the
02246                                              LUT. */
02247   int           lastbin;                /*!< Index of the last bin in the
02248                                              LUT. */
02249 } WlzLUTDomain;
02250 
02251 /*!
02252 * \union        _WlzValues
02253 * \ingroup      WlzType
02254 * \brief        The union of Woolz values.
02255 *               Typedef: ::WlzValues.
02256 */
02257 typedef union _WlzValues
02258 {
02259   struct _WlzCoreValues     *core;
02260   struct _WlzRagRValues     *v;
02261   struct _WlzRectValues     *r;
02262   struct _WlzIntervalValues *i;
02263   struct _WlzConvHullValues *c;
02264   struct _WlzVoxelValues    *vox;
02265   struct _WlzObject         *obj;
02266   struct _WlzFeatValues     *fv;
02267   struct _WlzRectFeatValues *rfv;
02268   struct _WlzIndexedValues  *x;
02269   struct _WlzTiledValues    *t;
02270   struct _WlzLUTValues      *lut;
02271   struct _WlzPointValues    *pts;
02272 } WlzValues;
02273 
02274 /*!
02275 * \union        _WlzDomain
02276 * \ingroup      WlzType
02277 * \brief        The union of Woolz domains.
02278 *               Typedef: ::WlzDomain.
02279 */
02280 typedef union _WlzDomain
02281 {
02282   struct _WlzCoreDomain      *core;
02283   struct _WlzIntervalDomain  *i;
02284   struct _WlzPlaneDomain     *p;
02285   struct _WlzPolygonDomain   *poly;
02286   struct _WlzBoundList       *b;
02287   struct _WlzHistogramDomain *hist;
02288   struct _WlzRect            *r;
02289   struct _WlzFRect           *fr;
02290   struct _WlzAffineTransform *t;
02291   struct _WlzWarpTrans       *wt;
02292   struct _WlzContour         *ctr;
02293   struct _WlzMeshTransform   *mt;
02294   struct _WlzLBTDomain2D     *l2;
02295   struct _WlzLBTDomain3D     *l3;
02296   struct _WlzCMesh2D         *cm2;
02297   struct _WlzCMesh2D5        *cm2d5;
02298   struct _WlzCMesh3D         *cm3;
02299   struct _WlzPoints          *pts;
02300   struct _WlzLUTDomain       *lut;
02301   struct _WlzThreeDViewStruct *vs3d;
02302 } WlzDomain;
02303 
02304 /*!
02305 * \struct       _WlzPropertyList
02306 * \ingroup      WlzProperty
02307 * \brief        A property list which has a type, link count and a
02308 *               linked list of properties.
02309 */
02310 typedef struct  _WlzPropertyList
02311 {
02312   WlzObjectType type;
02313   int           linkcount;
02314   AlcDLPList    *list;
02315 } WlzPropertyList;
02316 
02317 /*!
02318 * \struct       _WlzCoreProperty
02319 * \ingroup      WlzProperty
02320 * \brief        Core property with sufficient to data to provide the type
02321 *               and enough to allow the property to be freed.
02322 *               Typedef: ::WlzCoreProperty.
02323 */
02324 typedef struct _WlzCoreProperty
02325 {
02326   WlzObjectType         type;                   /*!< Type */
02327   int                   linkcount;              /*!< linkcount */
02328   void                  *freeptr;               /*!< free pointer */
02329 } WlzCoreProperty;
02330 
02331 /*!
02332 * \struct       _WlzSimpleProperty
02333 * \ingroup      WlzProperty
02334 * \brief        A simple property to hold arbitrary length string data.
02335 *               Read and writing then coercing to a structure with
02336 *               numerical values will not be portable.
02337 *               Typedef: ::WlzSimpleProperty.
02338 */
02339 typedef struct _WlzSimpleProperty
02340 {
02341   WlzObjectType         type;                   /*!< Type */
02342   int                   linkcount;              /*!< linkcount */
02343   void                  *freeptr;               /*!< free pointer */
02344   unsigned long         size;                   /*!< Data size of the property */
02345   void                  *prop;                  /*!< Pointer to the property */
02346 } WlzSimpleProperty;
02347 
02348 /*!
02349 * \def          EMAP_PROPERTY_MODELNAME_LENGTH
02350 * \ingroup      WlzProperty
02351 * \brief        Maximum length of the model name in an EMAP property.
02352 */
02353 #define EMAP_PROPERTY_MODELNAME_LENGTH  32
02354 
02355 /*!
02356 * \def          EMAP_PROPERTY_UID_LENGTH
02357 * \ingroup      WlzProperty
02358 * \brief        Maximum length of the model or anatomy UID in an EMAP property.
02359 */
02360 #define EMAP_PROPERTY_UID_LENGTH        16
02361 
02362 /*!
02363 * \def          EMAP_PROPERTY_VERSION_LENGTH
02364 * \ingroup      WlzProperty
02365 * \brief        Maximum length of the version string in an EMAP property.
02366 */
02367 #define EMAP_PROPERTY_VERSION_LENGTH    16
02368 
02369 /*!
02370 * \def          EMAP_PROPERTY_AUTHORNAME_LENGTH
02371 * \ingroup      WlzProperty
02372 * \brief        Maximum length of the author strings in an EMAP property.
02373 */
02374 #define EMAP_PROPERTY_AUTHORNAME_LENGTH 64
02375 
02376 /*!
02377 * \def          EMAP_PROPERTY_MACHINENAME_LENGTH
02378 * \ingroup      WlzProperty
02379 * \brief        Maximum length of the machine name strings in an EMAP property.
02380 */
02381 #define EMAP_PROPERTY_MACHINENAME_LENGTH 64
02382 
02383 /*!
02384 * \def          EMAP_PROPERTY_STAGE_LENGTH
02385 * \ingroup      WlzProperty
02386 * \brief        Maximum length of the stage strings in an EMAP property.
02387 */
02388 #define EMAP_PROPERTY_STAGE_LENGTH 32
02389 
02390 /*!
02391 * \struct       _WlzEMAPProperty
02392 * \ingroup      WlzProperty
02393 * \brief        A property to hold EMAP information to attach to
02394 *               the reference models, anatomy and GE domains. MAPaint
02395 *               and atlas tools will propogate the information as 
02396 *               required.
02397 *               Typedef: ::WlzEMAPProperty.
02398 */
02399 typedef struct _WlzEMAPProperty
02400 {
02401   WlzObjectType         type;                           /*!< Type */
02402   int                   linkcount;                      /*!< linkcount */
02403   void                  *freeptr;                       /*!< free pointer */
02404   WlzEMAPPropertyType   emapType;                       /*!< EMAP property type */
02405   char                  modelUID[EMAP_PROPERTY_UID_LENGTH]; /*!< model UID */
02406   char                  anatomyUID[EMAP_PROPERTY_UID_LENGTH];/*!< anatomy UID */
02407   char                  targetUID[EMAP_PROPERTY_UID_LENGTH];/*!< target model UID */
02408   char                  targetVersion[EMAP_PROPERTY_VERSION_LENGTH]; /*!< target model version */
02409   char                  stage[EMAP_PROPERTY_STAGE_LENGTH];/*!< Embryo  stage */
02410   char                  subStage[EMAP_PROPERTY_STAGE_LENGTH];/*!< Embryo  sub-stage */
02411   char                  modelName[EMAP_PROPERTY_MODELNAME_LENGTH];/*!< Volume model name */
02412   char                  version[EMAP_PROPERTY_VERSION_LENGTH];/*!< Model version */
02413   char                  *fileName;                      /*!< Original filename (not very useful) */
02414   long                  creationTime;                   /*!< Original creation time */
02415   char                  creationAuthor[EMAP_PROPERTY_AUTHORNAME_LENGTH];/*!< Creation author */
02416   char                  creationMachineName[EMAP_PROPERTY_MACHINENAME_LENGTH];/*!< Original creation machine name */
02417   long                  modificationTime;               /*!< Modification time */
02418   char                  modificationAuthor[EMAP_PROPERTY_AUTHORNAME_LENGTH];/*!< Modification author */
02419   char                  *comment;                       /*!< Text comment
02420                                                              string. */
02421 } WlzEMAPProperty;
02422 
02423 /*!
02424 * \struct       _WlzNameProperty
02425 * \ingroup      WlzProperty
02426 * \brief        A simple null terminated ASCII string for the object's
02427 *               name.
02428 *               Typedef: ::WlzNameProperty.
02429 */
02430 typedef struct _WlzNameProperty
02431 {
02432   WlzObjectType         type;                   /*!< Type. */
02433   int                   linkcount;              /*!< linkcount. */
02434   void                  *freeptr;               /*!< Free pointer. */
02435   char                  *name;                  /*!< A simple ASCII name
02436                                                      string. */
02437 } WlzNameProperty;
02438 
02439 /*!
02440 * \struct       _WlzGreyProperty
02441 * \ingroup      WlzProperty
02442 * \brief        A single grey value, which for example might represent
02443 *               the preferred display colour of a binary domain.
02444 *               Typedef: ::WlzGreyProperty.
02445 */
02446 typedef struct _WlzGreyProperty
02447 {
02448   WlzObjectType         type;                   /*!< Type. */
02449   int                   linkcount;              /*!< linkcount. */
02450   void                  *freeptr;               /*!< Free pointer. */
02451   char                  *name;                  /*!< An associated name
02452                                                      string which conveys
02453                                                      the meaning of the 
02454                                                      value. May be NULL */
02455   struct _WlzPixelV     value;                  /*!< The pixel value which
02456                                                      both encodes the grey type
02457                                                      and it's value. */
02458 } WlzGreyProperty;
02459 
02460 /*!
02461 * \struct       _WlzTextProperty
02462 * \ingroup      WlzProperty
02463 * \brief        A pair of simple null terminated ASCII strings one for the
02464 *               property name and one for it's value.
02465 *               Typedef: ::WlzTextProperty.
02466 */
02467 typedef struct _WlzTextProperty
02468 {
02469   WlzObjectType         type;                   /*!< Type. */
02470   int                   linkcount;              /*!< linkcount. */
02471   void                  *freeptr;               /*!< Free pointer. */
02472   char                  *name;                  /*!< Name string. */
02473   char                  *text;                  /*!< Text string. */
02474 } WlzTextProperty;
02475 
02476 /*!
02477 * \union        _WlzProperty
02478 * \ingroup      WlzProperty
02479 * \brief        A union of pointers for properties.
02480 *               Typedef: WlzProperty.
02481 */
02482 typedef union _WlzProperty
02483 {
02484   struct _WlzCoreProperty       *core;
02485   struct _WlzSimpleProperty     *simple;
02486   struct _WlzEMAPProperty       *emap;
02487   struct _WlzNameProperty       *name;
02488   struct _WlzGreyProperty       *greyV;
02489   struct _WlzTextProperty       *text;
02490 } WlzProperty;
02491 
02492 /************************************************************************
02493 * The Woolz objects.
02494 ************************************************************************/
02495 /*!
02496 * \struct       _WlzCoreObject
02497 * \ingroup      WlzType
02498 * \brief        The core Woolz object type which can be used to determine
02499 *               the type of a Woolz object. 
02500 *               Typedef: ::WlzCoreObject.
02501 */
02502 typedef struct _WlzCoreObject
02503 {
02504   WlzObjectType type;                   /*!< The Woolz object type. */
02505   int           linkcount;              /*!< The link count: A counter
02506                                              for the number of references to
02507                                              the object, which should only be
02508                                              accessed through WlzUnlink(),
02509                                              WlzAssignObject() and
02510                                              WlzFreeObj(). */
02511 } WlzCoreObject;
02512 
02513 /*!
02514 * \struct       _WlzObject
02515 * \ingroup      WlzType
02516 * \brief        The Woolz object.
02517 *               Typedef: ::WlzObject.
02518 */
02519 typedef struct _WlzObject
02520 {
02521   WlzObjectType      type;              /*!< From WlzCoreObject. */
02522   int                linkcount;         /*!< From WlzCoreObject. */
02523   WlzDomain          domain;            /*!< The objects domain: It's
02524                                              spatial extent or
02525                                              geometric properties. */
02526   WlzValues          values;            /*! The values defined within
02527                                             the object's domain. */
02528   WlzPropertyList    *plist;            /*! A list of the object's
02529                                             properties. */
02530   struct _WlzObject  *assoc;            /*! An object which is
02531                                             assosciated with this object. */
02532 } WlzObject;
02533 
02534 /*!
02535 * \struct       _WlzCompoundArray
02536 * \ingroup      WlzType
02537 * \brief        A compound object implemented as either an array or
02538 *               a linked list of other objects. There is a distinction between
02539 *               an compound of the same type (e.g. resulting from a labelling)
02540 *               and a compound of different types (e.g. resulting from a range
02541 *               of image processes from a single original object).
02542 *               Typedef: ::WlzCompoundArray.
02543 */
02544 typedef struct _WlzCompoundArray
02545 {
02546   WlzObjectType type;                   /*!< From WlzCoreObject. */
02547   int           linkcount;              /*!< From WlzCoreObject. */
02548   WlzObjectType otype;                  /*!< The permitted type if
02549                                             constrained. */
02550   int           n;                      /*!< The  number of objects */
02551   WlzObject     **o;                    /*!< The list of Woolz object
02552                                              pointers. */
02553   WlzPropertyList *plist;               /*! A list of the object's
02554                                             properties.  */
02555   WlzObject     *assoc;
02556 } WlzCompoundArray;
02557 
02558 /************************************************************************
02559 * Domains.
02560 ************************************************************************/
02561 /*!
02562 * \struct       _WlzCoreDomain
02563 * \ingroup      WlzType
02564 * \brief        The core domain: All Woolz domains have all the fields
02565 *               of the core domain in the same order and before any
02566 *               others, so allowing a domain to be assigned, freed
02567 *               and have it's type established.
02568                 Typedef: ::WlzCoreDomain.
02569 */
02570 typedef struct _WlzCoreDomain
02571 {
02572   WlzObjectType   type;                         /*!< The type of domain. */
02573   int             linkcount;                    /*!< The link count: A counter
02574                                                      for the number of
02575                                                      references to the domain,
02576                                                      which should only be
02577                                                      accessed through
02578                                                      WlzUnlink(),
02579                                                      WlzAssignDomain() and
02580                                                      WlzFreeDomain(). */
02581   void            *freeptr;                     /*!< A stack with pointers
02582                                                      that can be freed by
02583                                                      AlcFreeStackFree(). */
02584 } WlzCoreDomain;
02585 
02586 /*!
02587 * \struct       _WlzIntervalDomain
02588 * \ingroup      WlzType
02589 * \brief        A 2D domain defining an arbitrary  region of space in 2D.
02590 *               The domain may be of type WLZ_INTERVALDOMAIN_INTVL or
02591 *               WLZ_INTERVALDOMAIN_RECT. If the domain is of type
02592 *               WLZ_INTERVALDOMAIN_RECT then the intvlines field is
02593 *               not used. For WLZ_INTERVALDOMAIN_INTVL domains the
02594 *               intervals in a line must be contiguous.
02595 *               Typedef: ::WlzIntervalDomain.
02596 */
02597 typedef struct _WlzIntervalDomain
02598 {
02599   WlzObjectType     type;                       /*!< From WlzCoreDomain. */
02600   int               linkcount;                  /*!< From WlzCoreDomain. */
02601   void              *freeptr;                   /*!< From WlzCoreDomain. */
02602   int               line1;                      /*!< First line coordinate. */
02603   int               lastln;                     /*!< Last line coordinate. */
02604   int               kol1;                       /*!< First column
02605                                                      coordinate. */
02606   int               lastkl;                     /*!< Last column coordinate. */
02607   struct _WlzIntervalLine *intvlines;           /*!< Array of interval line
02608                                                      structures. */
02609 } WlzIntervalDomain;
02610 
02611 /*!
02612 * \struct       _WlzPlaneDomain
02613 * \ingroup      WlzType
02614 * \brief        A 3D domain defining an arbitrary  region of space in 3D.
02615 *               The 3D plane domain composed of plane-wise array of 2D domains.
02616 *               Typedef: ::WlzPlaneDomain.
02617 */
02618 typedef struct _WlzPlaneDomain
02619 {
02620   WlzObjectType     type;                       /*!< From WlzCoreDomain. */
02621   int               linkcount;                  /*!< From WlzCoreDomain. */
02622   void              *freeptr;                   /*!< From WlzCoreDomain. */
02623   int               plane1;                     /*!< First plane coordinate. */
02624   int               lastpl;                     /*!< Last plane coordinate. */
02625   int               line1;                      /*!< First line coordinate. */
02626   int               lastln;                     /*!< Last line coordinate. */
02627   int               kol1;                       /*!< First column line
02628                                                      coordinate. */
02629   int               lastkl;                     /*!< Last column  line
02630                                                      coordinate. */
02631   WlzDomain         *domains;                   /*!< Array of pointers to
02632                                                      2D domains. */
02633   float             voxel_size[3];              /*!< Array of nominal voxel
02634                                                      dimensions. */
02635 } WlzPlaneDomain;
02636 
02637 /************************************************************************
02638 * Intervals.                                            
02639 ************************************************************************/
02640 /*!
02641 * \struct       _WlzIntervalLine
02642 * \ingroup      WlzType
02643 * \brief        A line of intervals.
02644 *               Typedef: ::WlzIntervalLine.
02645 */
02646 typedef struct _WlzIntervalLine
02647 {
02648   int                  nintvs;          /*!< Number of intervals on line. */
02649   struct _WlzInterval *intvs;           /*!< Array of intervals. */
02650 } WlzIntervalLine;
02651 
02652 /*!
02653 * \struct       _WlzInterval
02654 * \ingroup      WlzType
02655 * \brief        A single interval.
02656 *               Typedef: ::WlzInterval.
02657 */
02658 typedef struct _WlzInterval
02659 {
02660   int ileft;                            /*!< Left most pixel of interval. */
02661   int iright;                           /*!< Right most pixel of interval. */
02662 } WlzInterval;
02663 
02664 /*!
02665 * \struct       _WlzDynItvPool
02666 * \ingroup      WlzType
02667 * \brief        Dynamic interval pool, for building interval domains.
02668 *               Typedef: ::WlzDynItvPool.
02669 */
02670 typedef struct _WlzDynItvPool
02671 {
02672   WlzInterval   *itvBlock;              /*!< Array of intervals. */
02673   int           itvsInBlock;            /*!< Number of intervals in array. */
02674   int           offset;                 /*!< Offset into array for next
02675                                              available interval. */
02676 } WlzDynItvPool;
02677 
02678 /*!
02679 * \struct       _WlzPartialItv2D
02680 * \ingroup      DomainOps
02681 * \brief        Data structure that can be used to hold partial intervals.
02682 *               These can then be sorted and condensed to find the intervals
02683 *               for an interval domain.
02684 */
02685 typedef struct _WlzPartialItv2D
02686 {
02687   int                   ileft;
02688   int                   iright;
02689   int                   ln;
02690 } WlzPartialItv2D;
02691 
02692 /*!
02693 * \struct       _WlzPartialItv3D
02694 * \ingroup      DomainOps
02695 * \brief        Data structure that can be used to hold partial intervals.
02696 *               These can then be sorted and condensed to find the intervals
02697 *               for a plane domain.
02698 */
02699 typedef struct _WlzPartialItv3D
02700 {
02701   int                   ileft;
02702   int                   iright;
02703   int                   ln;
02704   int                   pl;
02705 } WlzPartialItv3D;
02706 
02707 /************************************************************************
02708 * Value tables.
02709 ************************************************************************/
02710 
02711 /*!
02712 * \struct       _WlzCoreValues
02713 * \ingroup      WlzType
02714 * \brief        All Woolz value tables must have all the fields of the
02715 *               core values, in the same order and before any others,
02716 *               so allowing a values to be assigned, freed and have it's
02717 *               type established.
02718 *               Typedef: ::WlzCoreValues.
02719 */
02720 typedef struct _WlzCoreValues
02721 {
02722   WlzObjectType type;   
02723   int       linkcount;  
02724 } WlzCoreValues;
02725 
02726 /*!
02727 * \struct       _WlzValueLine
02728 * \ingroup      WlzType
02729 * \brief        Grey values along a line.
02730 *               Typedef: ::WlzValueLine.
02731 */
02732 typedef struct _WlzValueLine
02733 {
02734   int      vkol1;                       /*!< Relative left end. */
02735   int      vlastkl;                     /*!< Relative right end. */
02736   WlzGreyP values;                      /*!< Array of values. */
02737 } WlzValueLine;
02738 
02739 /*!
02740 * \struct       _WlzRagRValues
02741 * \ingroup      WlzType
02742 * \brief        The ragged rectangle values table.
02743 *               The type encodes both the type of value table and the type of
02744 *               grey value.
02745 *               Typedef: ::WlzRagRValues.
02746 */
02747 typedef struct _WlzRagRValues
02748 {
02749   WlzObjectType type;                   /*!< From WlzCoreValues. */
02750   int       linkcount;                  /*!< From WlzCoreValues. */
02751   void      *freeptr;                   /*!< From WlzCoreValues. */
02752   WlzValues original_table;             /*!< If non-NULL, the values table
02753                                              which owns the raw values we
02754                                              are using. */
02755   int       line1;                      /*!< First line. */
02756   int       lastln;                     /*!< Last line. */
02757   int       kol1;                       /*!< First column. */
02758   int       width;                      /*!< Width. */
02759   WlzPixelV bckgrnd;                    /*!< Background value for pixels not
02760                                              in object. */
02761   WlzValueLine *vtblines;               /*!< Array of value table line
02762                                              structures. */
02763 } WlzRagRValues;
02764 
02765 /*!
02766 * \struct       _WlzRectValues
02767 * \ingroup      WlzType
02768 * \brief        The rectangle values table.
02769 *               The type encodes both the type of value table and the type of
02770 *               grey value.
02771 *               Typedef: ::WlzRectValues.
02772 */
02773 typedef struct _WlzRectValues
02774 {
02775   WlzObjectType type;                   /*!< From WlzCoreValues. */
02776   int           linkcount;              /*!< From WlzCoreValues. */
02777   void          *freeptr;               /*!< From WlzCoreValues. */
02778   WlzValues     original_table;         /*!< If non-NULL, the values table
02779                                              which owns the raw values we
02780                                              are using. */
02781   int           line1;                  /*!< First line. */
02782   int           lastln;                 /*!< Last line. */
02783   int           kol1;                   /*!< First column. */
02784   int           width;                  /*!< Width. */
02785   WlzPixelV     bckgrnd;                /*!< Background value for points
02786                                              not in object. */
02787   WlzGreyP      values;                 /*!< Contiguous array of values. */
02788 } WlzRectValues;
02789 
02790 /*!
02791 * \struct       _WlzValueIntervalLine
02792 * \ingroup      WlzType
02793 * \brief        One line's worth of grey value intervals.
02794 *               Typedef: ::WlzValueIntervalLine.
02795 */
02796 typedef struct _WlzValueIntervalLine
02797 {
02798   int           nintvs;                 /*!< Number of grey value intervals. */
02799   WlzValueLine *vtbint;                 /*!< Pointer to grey value
02800                                              intervals. */
02801 } WlzValueIntervalLine;
02802 
02803 /*!
02804 * \struct       _WlzIntervalValues
02805 * \ingroup      WlzType
02806 * \brief        An interval structured value table.
02807 *               The type encodes both the type of value table and the type of
02808 *               grey value.
02809 *               Typedef: ::WlzIntervalValues.
02810 */
02811 typedef struct _WlzIntervalValues
02812 {
02813   WlzObjectType type;                   /*!< From WlzCoreValues. */
02814   int           linkcount;              /*!< From WlzCoreValues. */
02815   void          *freeptr;               /*!< From WlzCoreValues. */
02816   WlzValues     original_table;         /*!< If non-NULL, the values table
02817                                              which owns the raw values we
02818                                              are using. */
02819   int           line1;                  /*!< First line. */
02820   int           lastln;                 /*!< Last line. */
02821   int           kol1;                   /*!< First column. */
02822   int           width;                  /*!< Width. */
02823   WlzPixelV     bckgrnd;                /*!< Background value for points
02824                                              not in object. */
02825   WlzValueIntervalLine *vil;            /*!< Pointers to structures of grey
02826                                              table lines. */
02827 } WlzIntervalValues;
02828 
02829 /*!
02830 * \struct       _WlzVoxelValues
02831 * \ingroup      WlzType
02832 * \brief        Voxel value table.
02833 *               Typedef: ::WlzVoxelValues.
02834 */
02835 typedef struct _WlzVoxelValues
02836 {
02837   WlzObjectType type;                   /*!< From WlzCoreValues. */
02838   int           linkcount;              /*!< From WlzCoreValues. */
02839   void          *freeptr;               /*!< From WlzCoreValues. */
02840   WlzValues     original_table;         /*!< If non-NULL, the values table
02841                                              which owns the raw values we
02842                                              are using. */
02843   int           plane1;                 /*!< First plane. */
02844   int           lastpl;                 /*!< Last plane. */
02845   WlzPixelV     bckgrnd;                /*!< Background value for points
02846                                              not in object. */
02847   WlzValues     *values;                /*!< Array of pointers to value
02848                                              tables. */
02849 } WlzVoxelValues;
02850 
02851 /*!
02852 * \struct       _WlzValueAttach
02853 * \ingroup      WlzType
02854 * \brief        Specifies what values (for example thoose in an indexed
02855                 value table) are attached to.
02856 *               Enum: ::WlzValueAttach
02857 */
02858 typedef enum _WlzValueAttach
02859 {
02860   WLZ_VALUE_ATTACH_NONE,                /*!< No attachment. */
02861   WLZ_VALUE_ATTACH_NOD,                 /*!< Attached to mesh nodes. */
02862   WLZ_VALUE_ATTACH_ELM                  /*!< Attached to mesh elements. */
02863 } WlzValueAttach;
02864 
02865 /*!
02866 * \struct       _WlzIndexedValues
02867 * \ingroup      WlzType
02868 * \brief        In indexed value table.
02869 *               Typedef: ::WlzIndexedValues.
02870 */
02871 typedef struct _WlzIndexedValues
02872 {
02873   WlzObjectType type;                   /*!< From WlzCoreValues:
02874                                              WLZ_INDEXED_VALUES. */
02875   int           linkcount;              /*!< From WlzCoreValues. */
02876   void          *freeptr;               /*!< From WlzCoreValues, although
02877                                              this won't free the values
02878                                              themselves. */
02879   int           rank;                   /*!< The rank of the individual values.
02880                                              Here the rank for a scalar is 0,
02881                                              for a 1D array it is 1 and for
02882                                              and for individual values that
02883                                              are nD arrays the rank is n. */
02884   int           *dim;                   /*!< The dimensions of individual
02885                                              indexed values. The dimensions
02886                                              are a 1D array with the number
02887                                              of entries equal to the rank.
02888                                              A dimension array is only
02889                                              allocated if the rank > 0,
02890                                              for rank == 0 dim is NULL. */
02891   WlzGreyType   vType;                  /*!< The type of the data in the
02892                                              individual values. */
02893   WlzValueAttach attach;                /*!< Specifies what the values are
02894                                              attached to. */
02895   AlcVector     *values;                /*!< The indexed values. */
02896 } WlzIndexedValues;
02897 
02898 /*!
02899 * \struct       _WlzTiledValues
02900 * \ingroup      WlzType
02901 * \brief        A  tiled value table for both 2 an 3D domain objects.
02902 *               Typedef: ::WlzTiledValues.
02903 *
02904 *               The grey values are stored in square or cubic tiles
02905 *               with tileSz being the number of values in each tile
02906 *               irespective of the grey value type. An index to the
02907 *               tiles is stored as a simple one dimensional array.
02908 *
02909 *               To access a grey value at some position \f$(x,y,z)\f$
02910 *               which is known to be within the tiled value table:
02911 *               First the position relative to the first column (\f$x_0\f$),
02912 *               line (\f$y_0\f$) and plane (\f$z_0\f$)of the value table
02913 *               is computed:
02914 *               \f$x_r = x - x_0, y_r = y - y_0, z_r = z - z_0\f$.
02915 *               The tile index (\f$i\f$) and within tile offset (\f$o\f$)
02916 *               are then computed:
02917 *               \f{eqnarray*}
02918                 i_x = x_r / w \\
02919                 i_y = y_r / w \\
02920                 i_z = z_r / w \\
02921                 o_x = x_r - (w i_x) \\
02922                 o_y = y_r - (w i_y) \\
02923                 o_z = z_r - (w i_z) \\
02924                 i = (((i_z ni_y) + i_y) ni_x) + i_x \\
02925                 o = (((o_z nt_y) + o_y) nt_x) + o_x \\
02926                 g = T \left[ ( I \left[ i \right] t_s) + o \right]
02927                 \f}
02928 *               Where \f$I\f$ is the index table and \f$T\f$ the start
02929 *               of the tile data.
02930 *
02931 *               The tile data may be memory mapped instead of read into
02932 *               memory in which case the file descriptor will have a
02933 *               non-negative value. This can be used to close the file.
02934 */
02935 typedef struct _WlzTiledValues
02936 {
02937   WlzObjectType type;                   /*!< From WlzCoreValues:
02938                                              built from WLZ_GREY_TAB_TILED
02939                                              and the grey value type. */
02940   int           linkcount;              /*!< From WlzCoreValues. */
02941   void          *freeptr;               /*!< From WlzCoreValues, although
02942                                              this won't free the values
02943                                              themselves. */
02944   int           dim;                    /*!< The dimension of the value table,
02945                                              ie 2 or 3D. */
02946   int           kol1;                   /*!< First column. */
02947   int           lastkl;                 /*!< Last column. */
02948   int           line1;                  /*!< First line. */
02949   int           lastln;                 /*!< Last line. */
02950   int           plane1;                 /*!< First plane. */
02951   int           lastpl;                 /*!< Last plane. */
02952   WlzPixelV     bckgrnd;                /*!< Background value. */
02953   size_t        tileSz;                 /*!< The number of values in each
02954                                              tile which may be less than
02955                                              the number of bytes. */
02956   size_t        tileWidth;              /*!< Width of the tiles (\f$w\f$). */
02957   size_t        numTiles;               /*!< The total number of tiles. */
02958   int           *nIdx;                  /*!< Number of index columns,
02959                                              lines, .... */
02960   unsigned int  *indices;               /*!< Table of tile indices. */
02961   int           fd;                     /*!< File descriptor if tiles are
02962                                              memory mapped else -1. */
02963   long          tileOffset;             /*!< Offset from the start of the
02964                                              file to the tiles. This may be
02965                                              set even if not memory mapped. */
02966   WlzGreyP      tiles;                  /*!< The tiles. */
02967 } WlzTiledValues;
02968 
02969 /*!
02970 * \struct       _WlzLUTValues
02971 * \ingroup      WlzType
02972 * \brief        Look up table values.
02973 *               Typedef: ::WlzLUTValues
02974 */
02975 typedef struct _WlzLUTValues
02976 {
02977   WlzObjectType type;                   /*!< WLZ_LUT. */
02978   int           linkcount;              /*!< From WlzCoreValues. */
02979   void          *freeptr;               /*!< From WlzCoreValues. */
02980   WlzGreyType   vType;                  /*!< Type for the LUT values. */
02981   int           maxVal;                 /*!< Number of values allocated. */
02982   WlzGreyP      val;                    /*!< LUT values. */
02983 } WlzLUTValues;
02984 
02985 /*!
02986 * \struct       _WlzPointValues
02987 * \ingroup      WlzType
02988 * \brief        Point values - values with arbitrary rank and dimension
02989 *               defined at points.
02990 *               Typedef: ::WlzPointValues
02991 */
02992 typedef struct _WlzPointValues
02993 {
02994   WlzObjectType type;                   /*!< WLZ_POINT_VALUES. */
02995   int           linkcount;              /*!< From WlzCoreValues. */
02996   void          *freeptr;               /*!< From WlzCoreValues. */
02997   int           rank;                   /*!< The rank of the individual values.
02998                                              Here the rank for a scalar is 0,
02999                                              for a 1D array it is 1 and for
03000                                              and for individual values that
03001                                              are nD arrays the rank is n. */
03002   int           *dim;                   /*!< The dimensions of individual
03003                                              indexed values. The dimensions
03004                                              are a 1D array with the number
03005                                              of entries equal to the rank.
03006                                              A dimension array is only
03007                                              allocated if the rank > 0,
03008                                              for rank == 0 dim is NULL. */
03009   int           pSz;                    /*!< Size of each point this is
03010                                              the product of the dimensions
03011                                              times the value type size and
03012                                              is frequently used for accessing
03013                                              the values. */
03014   WlzGreyType   vType;                  /*!< The type of the data in the
03015                                              individual values. */
03016   size_t        maxPoints;              /*!< Number of points allocated. */
03017   WlzGreyP      values;                 /*!< The indexed values. */
03018 } WlzPointValues;
03019 
03020 /************************************************************************
03021 * Point domains.                                                
03022 ************************************************************************/
03023 /*!
03024 * \struct       _WlzPoints
03025 * \ingroup      WlzFeatures
03026 * \brief        An array of either 2D or 3D points which may have
03027 *               either integral of floating point values. Possible
03028 *               types are: WLZ_POINTS_2I, WLZ_POINTS_2D, WLZ_POINTS_3I
03029 *               and WLZ_POINTS_3D.
03030 *               Typedef: ::WlzPoints
03031 */
03032 typedef struct _WlzPoints
03033 {
03034   WlzObjectType type;                   /*!< From WlzCoreDomain. */
03035   int           linkcount;              /*!< From WlzCoreDomain. */
03036   void          *freeptr;               /*!< From WlzCoreDomain. */
03037   int           nPoints;                /*!< Number of points. */
03038   int           maxPoints;              /*!< The maximum number of points
03039                                              for which space has been
03040                                              allocated. */
03041   WlzVertexP    points;                 /*!< Array of point vertices. */
03042 } WlzPoints;
03043 
03044 /************************************************************************
03045 * Polygon domains.                                              
03046 ************************************************************************/
03047 /*!
03048 * \struct       _WlzPolygonDomain
03049 * \ingroup      WlzPolyline
03050 * \brief        A 2D polyline domain with possible types: WLZ_POLYGON_INT, 
03051 *               WLZ_POLYGON_FLOAT  or WLZ_POLYGON_DOUBLE. 
03052 *               Typedef: ::WlzPolygonDomain.
03053 */
03054 typedef struct _WlzPolygonDomain
03055 {
03056   WlzObjectType type;                   /*!< From WlzCoreDomain. */
03057   int linkcount;                        /*!< From WlzCoreDomain. */
03058   void *freeptr;                        /*!< From WlzCoreDomain. */
03059   int nvertices;                        /*!< Number of vertices. */
03060   int maxvertices;                      /*!< The maximum number of vertices
03061                                              for which space has been
03062                                              allocated. */
03063   WlzIVertex2 *vtx;                     /*!< Array of vertices.
03064                                              This may need casting according
03065                                              to the type field. */
03066 } WlzPolygonDomain;
03067 
03068 /*!
03069 * \struct       _WlzPolygonDomain3
03070 * \ingroup      WlzPolyline
03071 * \brief        A 2D polyline domain with possible types:WLZ_POLYGON_INT, 
03072 *               WLZ_POLYGON_FLOAT  or WLZ_POLYGON_DOUBLE. 
03073 *               Typedef: ::WlzPolygonDomain.
03074 */
03075 typedef struct _WlzPolygonDomain3
03076 {
03077   WlzObjectType type;                   /*!< From WlzCoreDomain. */
03078   int   linkcount;                      /*!< From WlzCoreDomain. */
03079   void *freeptr;                        /*!< From WlzCoreDomain. */
03080   int nvertices;                        /*!< Number of vertices. */
03081   int maxvertices;                      /*!< The maximum number of vertices
03082                                              for which space has been
03083                                              allocated. */
03084   WlzIVertex2 *vtx;                     /*!< Array of vertices.
03085                                              This may need casting according
03086                                              to the type field. */
03087 } WlzPolygonDomain3;
03088 
03089 /************************************************************************
03090 * Boundary list.                                                
03091 ************************************************************************/
03092 /*!
03093 * \struct       _WlzBoundList
03094 * \ingroup      WlzBoundary
03095 * \brief        A complete list of a set of boundaries which is encoded
03096 *               in tree form.
03097 */
03098 typedef struct _WlzBoundList
03099 {
03100   WlzObjectType type;                   /*!< From WlzCoreDomain. */
03101   int linkcount;                        /*!< From WlzCoreDomain. */
03102   void *freeptr;                        /*!< From WlzCoreDomain. */
03103   struct _WlzBoundList *up;             /*!< The containing hole or piece,
03104                                              NULL if the universal hole
03105                                              (very top). */
03106   struct _WlzBoundList *next;           /*!< Next hole or piece at same level
03107                                              and lying within same piece or
03108                                              hole, NULL if no more at this
03109                                              level. */
03110   struct _WlzBoundList *down;           /*!< First enclosed structure, NULL if
03111                                              none. */
03112   int wrap;                             /*!< Wrap number: The number of points
03113                                              of boundary included both at
03114                                              start and end of polygon
03115                                              representation. */
03116   WlzPolygonDomain *poly;              /*!< The polygon representation of
03117                                             this boundary. */
03118 } WlzBoundList;
03119 
03120 
03121 /************************************************************************
03122 * Chord and convex hull parameters.                             
03123 ************************************************************************/
03124 /*!
03125 * \struct       _WlzChord
03126 * \ingroup      WlzConvexHull
03127 * \brief        A cord described by the equation:
03128 *               \f[
03129                   c = a x - b y
03130                 \f]
03131 *               Typedef: ::WlzChord.
03132 */
03133 typedef struct _WlzChord 
03134 {
03135   int sig;                              /*!< Non-zero if judged to be
03136                                              significant. */
03137   int acon;                             /*!< Chord equation paramter,
03138                                              \f$a\f$. */
03139   int bcon;                             /*!< Chord equation paramter,
03140                                              \f$b\f$. */
03141   int ccon;                             /*!< Chord equation paramter,
03142                                              \f$c\f$. */
03143   double cl;                            /*!< Eight \f$\times\f$ chord
03144                                              length. */
03145   int bl;                               /*!< Line number of bay bottom or
03146                                              bulge top. */
03147   int bk;                               /*!, Column number of bay bottom or
03148                                              bulge top. */
03149   int barea;                            /*!< Eight \f$\times\f$ bay or
03150                                              bulge area. */
03151   int bd;                               /*!< Eight \f$\times\f$ bay maximum
03152                                              depth or bulge max height. */
03153 } WlzChord;
03154 
03155 /*!
03156 * \struct       _WlzConvHullValues
03157 * \ingroup      WlzConvexHull
03158 * \brief        A 2D convex hull.
03159 *               Typedef: ::WlzConvHullValues.
03160 */
03161 typedef struct _WlzConvHullValues
03162 {
03163   WlzObjectType type;                   /*!< From WlzCoreValues. */
03164   int           linkcount;              /*!< From WlzCoreValues. */
03165   void          *freeptr;               /*!< From WlzCoreValues. */
03166   WlzValues original_table;             /*!< If non-NULL, valuetable which
03167                                              owns the raw values we are
03168                                              using. */
03169   int           nchords;                /*!< Number of chords. */
03170   int           nsigchords;             /*!< Number of significant chords. */
03171   int           mdlin;                  /*!< Mid-line of enclosed
03172                                              originating object. */
03173   int           mdkol;                  /*!< Mid-column of enclosed
03174                                              originating object. */
03175   WlzChord      *ch;
03176 } WlzConvHullValues;
03177 
03178 /************************************************************************
03179 * Histograms.                                           
03180 ***********************************************************************/
03181 /*!
03182 * \struct       _WlzHistogramDomain
03183 * \ingroup      WlzHistogram
03184 * \brief        Histograms are Woolz domains and not values as might be
03185 *               expected.
03186 *               Typedef: ::WlzHistogramDomain.
03187 */
03188 typedef struct _WlzHistogramDomain
03189 {
03190   WlzObjectType type;                   /*!< From WlzCoreDomain. */
03191   int           linkcount;              /*!< From WlzCoreDomain. */
03192   void          *freeptr;               /*!< From WlzCoreDomain. */
03193   int           maxBins;                /*!< Number of histogram bins
03194                                              allocated. */
03195   int           nBins;                  /*!< Number of histogram bins used. */
03196   double        origin;                 /*!< Lowest grey value of first
03197                                              histogram bin. */
03198   double        binSize;                /*!< Grey value range for a histogram
03199                                             bin. */
03200   WlzGreyP      binValues;              /*!< Histogram values:
03201                                              Int for WLZ_HISTOGRAMDOMAIN_INT or
03202                                              Double for
03203                                              WLZ_HISTOGRAMDOMAIN_FLOAT. */
03204 } WlzHistogramDomain;
03205 
03206 /*!
03207 * \enum         _WlzHistFeature
03208 * \ingroup      WlzHistogram
03209 * \brief        Features of histograms.
03210 *               Typedef: ::WlzHistFeature.
03211 */
03212 typedef enum _WlzHistFeature
03213 {
03214   WLZ_HIST_FEATURE_NONE     = (0),      /*!< No feature. */
03215   WLZ_HIST_FEATURE_PEAK     = (1<<0),   /*!< Histogram peak. */
03216   WLZ_HIST_FEATURE_TROUGH   = (1<<1)    /*!< Histogram trough. */
03217 } WlzHistFeature;
03218 
03219 /************************************************************************
03220 * Rectangle domains.                                            
03221 ************************************************************************/
03222 /*!
03223 * \struct       _WlzRect
03224 * \ingroup      WlzFeatures
03225 * \brief        An integer rectangle domain.
03226 *               Side from (l[0],k[0]) to (l[1],k[1]) is a long side.
03227 *               The vertices are cyclic.
03228 *               Typedef: ::WlzIRect.
03229 */
03230 typedef struct  _WlzRect
03231 {
03232   WlzObjectType type;                   /*!< From WlzCoreDomain. */
03233   int linkcount;                        /*!< From WlzCoreDomain. */
03234   void *freeptr;                        /*!< From WlzCoreDomain. */
03235   int irk[4];                           /*!< Column vertex coordinates. */
03236   int irl[4];                           /*!< Line vertex coordinates. */
03237   float rangle;                         /*!< Angle of long side to
03238                                              vertical (radians). */
03239 } WlzIRect;
03240 
03241 /*!
03242 * \struct       _WlzFRect
03243 * \ingroup      WlzFeatures
03244 * \brief        A single precision floating point rectangle domain.
03245 *               Side from (l[0],k[0]) to (l[1],k[1]) is a long side.
03246 *               The vertices are cyclic.
03247 *               Typedef: ::WlzFRect.
03248 */
03249 typedef struct _WlzFRect
03250 {
03251   WlzObjectType type;                   /*!< From WlzCoreDomain. */
03252   int linkcount;                        /*!< From WlzCoreDomain. */
03253   void *freeptr;                        /*!< From WlzCoreDomain. */
03254   float frk[4];                         /*!< Column vertex coordinates. */
03255   float frl[4];                         /*!< Line vertex coordinates. */
03256   float rangle;                         /*!< Angle of long side to vertical
03257                                              (radians). */
03258 } WlzFRect;
03259 
03260 /************************************************************************
03261 * Convolution and other value filters.
03262 ************************************************************************/
03263 /*!
03264 * \struct       _WlzConvolution
03265 * \ingroup      WlzValuesFilters
03266 * \brief        A 2D space domain convolution mask.
03267 *               To reduce computational cost at the expense of data storage
03268 *               the complete convolution is used even if highly symmetrical.
03269 *               Typedef: ::WlzConvolution.
03270 */
03271 typedef struct  _WlzConvolution
03272 {
03273   WlzObjectType type;                   /*!< Identifies a convolution mask. */
03274   int linkcount;                        /*!< Reference count. */
03275   int xsize, ysize;                     /*!< Size of mask which must be odd. */
03276   int *cv;                              /*!< The convolution mask with
03277                                              size\f$\times\f$size elements. */
03278   int divscale;                         /*!< Scale factor by which the
03279                                              convolution  is divided. */
03280   int offset;                           /*!< Offset which is added to the
03281                                              scaled convolution. */
03282   int modflag;                          /*!< If non-zero the absolute value
03283                                              of the scaled, offset convolution
03284                                              is used. */
03285 } WlzConvolution;
03286 
03287 /*!
03288 * \enum         _WlzRsvFilterActionMask
03289 * \ingroup      WlzValuesFilters
03290 * \brief        The action to be performed by a recursive filter.
03291 *               These values are bit masks which may be combined.
03292 *               Typedef: ::WlzRsvFilterActionMask.
03293 */
03294 typedef enum _WlzRsvFilterActionMask
03295 {
03296   WLZ_RSVFILTER_ACTION_NONE     = (0),  /*!< No filtering. */
03297   WLZ_RSVFILTER_ACTION_X        = (1<<0), /*!< Filter along lines. */
03298   WLZ_RSVFILTER_ACTION_Y        = (1<<1), /*!< Filter through columns. */
03299   WLZ_RSVFILTER_ACTION_Z        = (1<<2)  /*!< Filter through planes. */
03300 } WlzRsvFilterActionMask;
03301 
03302 /*!
03303 * \enum         _WlzRsvFilterName
03304 * \ingroup      WlzValuesFilters
03305 * \brief        Recursive filter types that can be used to define a recursive
03306 *               filter along with a filter parameter (eg sigma for Gaussian).
03307 *               Typedef: ::WlzRsvFilterName.
03308 */
03309 typedef enum _WlzRsvFilterName
03310 {
03311   WLZ_RSVFILTER_NAME_NONE,              /*!< No name, application defined
03312                                              filter. */
03313   WLZ_RSVFILTER_NAME_DERICHE_0,         /*!< Deriche's smoothing operator. */
03314   WLZ_RSVFILTER_NAME_DERICHE_1,         /*!< Deriche's edge operator. */
03315   WLZ_RSVFILTER_NAME_DERICHE_2,         /*!< Deriche's 2nd edge operator. */
03316   WLZ_RSVFILTER_NAME_GAUSS_0,           /*!< Gaussian. */
03317   WLZ_RSVFILTER_NAME_GAUSS_1,           /*!< First derivative of Gaussian. */
03318   WLZ_RSVFILTER_NAME_GAUSS_2            /*!< Second derivative of Gaussian. */
03319 } WlzRsvFilterName;
03320 
03321 /*!
03322 * \struct       _WlzRsvFilter
03323 * \ingroup      WlzValuesFilters
03324 * \brief        The parameters
03325 *               \f$a_j\f$, \f$b_j\f$ and \f$c\f$ with \f$j\in[0\cdots2]\f$
03326 *               which define a recursive filter:
03327 *               \f[
03328                   y^{+}[i] = a_0 x[i + 0] + a_1 x[i - 1] -
03329                              b_0 y^{+}[i - 1] - b_1 y^{+}[i - 2]
03330                 \f]
03331 *               \f[
03332                   y^{-}[i] = a_2 x[i + 1] + a_3 x[i + 2] -
03333                              b_0 y^{-}[i + 1] - b_1 y^{-}[i + 2]
03334                 \f]
03335 *               \f[
03336                   y[i] = c (y^{+}[i] + y^{-}[i])
03337                 \f]
03338 *               Typedef: ::WlzRsvFilter.
03339 */ 
03340 typedef struct _WlzRsvFilter
03341 {
03342   WlzRsvFilterName      name;           /*!< The filter name. */
03343   double                a[4];           /*!< Feed forward coefficients. */
03344   double                b[2];           /*!< Feed back coefficients. */
03345   double                c;              /*!< Normalization parameter. */
03346 } WlzRsvFilter;
03347  
03348 /************************************************************************
03349 * Conforming mesh data structures.
03350 ************************************************************************/
03351 
03352 /*!
03353 * \enum         _WlzCMeshElmFlags
03354 * \ingroup      WlzMesh
03355 * \brief        Conforming mesh element flags. These are bit masks which are
03356 *               used in a conforming mesh's elements flags.
03357 *               Typedef: ::WlzCMeshElmFlags.
03358 */
03359 typedef enum _WlzCMeshElmFlags
03360 {
03361   WLZ_CMESH_ELM_FLAG_NONE       = (0),
03362   WLZ_CMESH_ELM_FLAG_BOUNDARY   = (1),  /*!< Element intersects the boundary
03363                                              of the domain to which it
03364                                              should conform. */
03365   WLZ_CMESH_ELM_FLAG_OUTSIDE    = (1<<1), /*!< Element is outside the domain to
03366                                              which the mesh should
03367                                              conform. */
03368   WLZ_CMESH_ELM_FLAG_KNOWN      = (1<<2), /*!< A property of the element is
03369                                              known. */
03370   WLZ_CMESH_ELM_FLAG_ALL        = (65535) /*!< All possible flags, 0xffff
03371                                                decimal representation required
03372                                                for JavaWoolz. */
03373 } WlzCMeshElmFlags;
03374 
03375 /*!
03376 * \enum         _WlzCMeshNodFlags
03377 * \ingroup      WlzMesh
03378 * \brief        Conforming mesh node flags. These are bit masks which are
03379 *               used in a conforming mesh's node flags.
03380 *               Typedef: ::WlzCMeshNodFlags.
03381 */
03382 typedef enum _WlzCMeshNodFlags
03383 {
03384   WLZ_CMESH_NOD_FLAG_NONE       = (0),
03385   WLZ_CMESH_NOD_FLAG_ADJUSTED   = (1),     /*!< Node position adjusted. */
03386   WLZ_CMESH_NOD_FLAG_BOUNDARY   = (1<<1),  /*!< Node is on a boundary of the
03387                                                 mesh. */
03388   WLZ_CMESH_NOD_FLAG_UPWIND     = (1<<2),   /*!< Node is upwind of the active
03389                                                 region having already been
03390                                                 processed. */
03391   WLZ_CMESH_NOD_FLAG_ACTIVE     = (1<<3),  /*!< Node is in the active region
03392                                                 and is being processed. */
03393   WLZ_CMESH_NOD_FLAG_KNOWN      = (1<<4),  /*!< Property associated with
03394                                                 node is known. */
03395   WLZ_CMESH_NOD_FLAG_OUTSIDE    = (1<<5),  /*!< Node is outside the domain to
03396                                                 which the mesh should
03397                                                 conform. */
03398   WLZ_CMESH_NOD_FLAG_ALL        = (65535) /*!< All possible flags, 0xffff
03399                                                decimal representation required
03400                                                for JavaWoolz. */
03401 } WlzCMeshNodFlags;
03402 
03403 /*!
03404 * \struct       _WlzCMeshNod2D
03405 * \ingroup      WlzMesh
03406 * \brief        A node of a 2D mesh.
03407 *               Typedef: ::WlzCMeshNod2D.
03408 */
03409 typedef struct _WlzCMeshNod2D
03410 {
03411   int           idx;                    /*!< The node index. */
03412   unsigned int  flags;                  /*!< Bitwise description of node. */
03413   WlzDVertex2   pos;                    /*!< Node position. */
03414   struct _WlzCMeshEdgU2D *edu;          /*!< One of many edge uses which is
03415                                              directed from the node. A
03416                                              node is shared by many parents. */
03417   struct _WlzCMeshNod2D *next;          /*!< Next node in bucket. */
03418   void          *prop;                  /*!< Node properties. */
03419 } WlzCMeshNod2D;
03420 
03421 /*!
03422 * \struct       _WlzCMeshNod2D5
03423 * \ingroup      WlzMesh
03424 * \brief        A node of a 2D5 mesh with a 3D position but 2D connectivity.
03425 *               Typedef: ::WlzCMeshNod2D5.
03426 */
03427 typedef struct _WlzCMeshNod2D5
03428 {
03429   int           idx;                    /*!< The node index. */
03430   unsigned int  flags;                  /*!< Bitwise description of node. */
03431   WlzDVertex3   pos;                    /*!< Node position. */
03432   struct _WlzCMeshEdgU2D5 *edu;         /*!< One of many edge uses which is
03433                                              directed from the node. A
03434                                              node is shared by many parents. */
03435   struct _WlzCMeshNod2D5 *next;         /*!< Next node in bucket. */
03436   void          *prop;                  /*!< Node properties. */
03437 } WlzCMeshNod2D5;
03438 
03439 /*!
03440 * \struct       _WlzCMeshNod3D
03441 * \ingroup      WlzMesh
03442 * \brief        A node of a 3D mesh.
03443 *               Typedef: ::WlzCMeshNod3D.
03444 */
03445 typedef struct _WlzCMeshNod3D
03446 {
03447   int           idx;                    /*!< The node index. */
03448   unsigned int  flags;                  /*!< Bitwise description of node. */
03449   WlzDVertex3   pos;                    /*!< Node position. */
03450   struct _WlzCMeshEdgU3D *edu;          /*!< One of many edge uses which is
03451                                              directed from the node. A
03452                                              node is shared by many parents. */
03453   struct _WlzCMeshNod3D *next;          /*!< Next node in bucket. */
03454   void          *prop;                  /*!< Node properties. */
03455 } WlzCMeshNod3D;
03456 
03457 /*!
03458 * \union       _WlzCMeshNodP
03459 * \ingroup      WlzMesh
03460 * \brief        A node pointer for a 2 or 3D mesh.
03461 *               Typedef: ::WlzCMeshNodP.
03462 */
03463 typedef union _WlzCMeshNodP
03464 {
03465   void                   *v;            /*!< Generic pointer. */
03466   struct _WlzCMeshNod2D  *n2;           /*!< 2D node pointer. */
03467   struct _WlzCMeshNod2D5 *n2d5;         /*!< 2D5 node pointer. */
03468   struct _WlzCMeshNod3D  *n3;           /*!< 3D node pointer. */
03469 } WlzCMeshNodP;
03470 
03471 /*!
03472 * \struct       _WlzCMeshEdgU2D
03473 * \ingroup      WlzMesh
03474 * \brief        A 2D CCW directed (half) edge within the parent simplex.
03475 *               Typedef: ::WlzCMeshEdgU2D.
03476 */
03477 typedef struct _WlzCMeshEdgU2D
03478 {
03479   struct _WlzCMeshNod2D *nod;           /*!< Node from which this edge is
03480                                              directed. */
03481   struct _WlzCMeshEdgU2D *next;         /*!< Next directed edge, previous
03482                                              can be found using next->next. */
03483   struct _WlzCMeshEdgU2D *opp;          /*!< Opposite directed edge. */
03484   struct _WlzCMeshEdgU2D *nnxt;         /*!< Next edge directed from the
03485                                              same node (un-ordered). */
03486   struct _WlzCMeshElm2D *elm;           /*!< Parent element. */
03487 } WlzCMeshEdgU2D;
03488 
03489 /*!
03490 * \struct       _WlzCMeshEdgU2D5
03491 * \ingroup      WlzMesh
03492 * \brief        A 2D CCW directed (half) edge within the parent simplex.
03493 *               Typedef: ::WlzCMeshEdgU2D5.
03494 */
03495 typedef struct _WlzCMeshEdgU2D5
03496 {
03497   struct _WlzCMeshNod2D5 *nod;           /*!< Node from which this edge is
03498                                               directed. */
03499   struct _WlzCMeshEdgU2D5 *next;         /*!< Next directed edge, previous
03500                                              can be found using next->next. */
03501   struct _WlzCMeshEdgU2D5 *opp;          /*!< Opposite directed edge. */
03502   struct _WlzCMeshEdgU2D5 *nnxt;         /*!< Next edge directed from the
03503                                              same node (un-ordered). */
03504   struct _WlzCMeshElm2D5 *elm;           /*!< Parent element. */
03505 } WlzCMeshEdgU2D5;
03506 
03507 /*!
03508 * \struct       _WlzCMeshEdgU3D
03509 * \ingroup      WlzMesh
03510 * \brief        A 3D directed (half) edge within the parent face.
03511 *               Typedef: ::WlzCMeshEdgU3D.
03512 */
03513 typedef struct _WlzCMeshEdgU3D
03514 {
03515   struct _WlzCMeshNod3D *nod;           /*!< Node from which this edge is
03516                                              directed. */
03517   struct _WlzCMeshEdgU3D *next;         /*!< Next directed edge, previous
03518                                              can be found using next->next. */
03519   struct _WlzCMeshEdgU3D *nnxt;         /*!< Next edge directed from the
03520                                              same node (un-ordered). */
03521   struct _WlzCMeshFace *face;           /*!< Parent face. */
03522 } WlzCMeshEdgU3D;
03523 
03524 /*!
03525 * \union       _WlzCMeshEdgUP
03526 * \ingroup      WlzMesh
03527 * \brief        An edge use pointer for a 2 or 3D mesh.
03528 *               Typedef: ::WlzCMeshEdgUP.
03529 */
03530 typedef union _WlzCMeshEdgUP
03531 {
03532   void                    *v;           /*!< Generic pointer. */
03533   struct _WlzCMeshEdgU2D  *e2;          /*!< 2D node pointer. */
03534   struct _WlzCMeshEdgU2D5 *e2d5;        /*!< 2D5 node pointer. */
03535   struct _WlzCMeshEdgU3D  *e3;          /*!< 3D node pointer. */
03536 } WlzCMeshEdgUP;
03537 
03538 /*!
03539 * \struct       _WlzCMeshFace
03540 * \ingroup      WlzMesh
03541 * \brief        A directed face within the parent simplex.
03542 *               Typedef: ::WlzCMeshFace.
03543 */
03544 typedef struct _WlzCMeshFace
03545 {
03546   struct _WlzCMeshEdgU3D edu[3];        /*!< Directed edges of the face. */
03547   struct _WlzCMeshFace *opp;            /*!< Opposite face on neighboring
03548                                              mesh element. */
03549   struct _WlzCMeshElm3D *elm;           /*!< Parent mesh element. */
03550 } WlzCMeshFace;
03551 
03552 /*!
03553 * \struct       _WlzCMeshElm2D
03554 * \ingroup      WlzMesh
03555 * \brief        A single 2D triangular mesh element.
03556 *               Typedef: ::WlzCMeshElm2D.
03557 */
03558 typedef struct _WlzCMeshElm2D
03559 {
03560   int           idx;                    /*!< The element index. */
03561   unsigned int  flags;                  /*!< Element flags. */
03562   struct _WlzCMeshEdgU2D edu[3];        /*!< Edges of the mesh element. */
03563   struct _WlzCMeshCellElm2D *cElm;      /*!< First cell element from which
03564                                              all other cell elements can be
03565                                              reached using the next pointer. */
03566   void          *prop;                  /*!< Element properties. */
03567 } WlzCMeshElm2D;
03568 
03569 /*!
03570 * \struct       _WlzCMeshElm2D5
03571 * \ingroup      WlzMesh
03572 * \brief        A single 3D triangular mesh element.
03573 *               Typedef: ::WlzCMeshElm2D5.
03574 */
03575 typedef struct _WlzCMeshElm2D5
03576 {
03577   int           idx;                     /*!< The element index. */
03578   unsigned int  flags;                   /*!< Element flags. */
03579   struct _WlzCMeshEdgU2D5 edu[3];        /*!< Edges of the mesh element. */
03580   struct _WlzCMeshCellElm2D5 *cElm;      /*!< First cell element from which
03581                                               all other cell elements can be
03582                                               reached using the next
03583                                               pointer. */
03584   void          *prop;                   /*!< Element properties. */
03585 } WlzCMeshElm2D5;
03586 
03587 /*!
03588 * \struct       _WlzCMeshElm3D
03589 * \ingroup      WlzMesh
03590 * \brief        A single 3D tetrahedral mesh element.
03591 *               Typedef: ::WlzCMeshElm3D.
03592 *               
03593 *               The following diagram depicts a mesh element, viewed from
03594 *               above with the apex (node n0) pointing towards the viewer.
03595 *               From this view, face f3 is at the rear of the tetrahedron.
03596 * \verbatim
03597                                         O n1                         
03598                                        /|\                   
03599                                       / | \                  
03600                                      /  |  \                 
03601                                     /   |   \                
03602                                    /    |    \    f3          
03603                                   /     |     \  /           
03604                                  /      |      \/            
03605                                 /       |      .\            
03606                                /        |     .  \            
03607                               /         |    .    \                  
03608                              /          |   .      \                 
03609                             /           O           \                
03610                            /      f1   / \    f0     \               
03611                           /          /  n0 \          \              
03612                          /         /         \         \             
03613                         /        /             \        \            
03614                        /       /                 \       \            
03615                       /      /                     \      \            
03616                      /     /                         \     \            
03617                     /    /              f2             \    \            
03618                    /   /                                 \   \            
03619                   /  /                                     \  \           
03620                  / /                                         \ \           
03621              n3 O-----------------------------------------------O n2        
03622 \endverbatim
03623 *               The relationship between nodes and faces depicted in
03624 *               this diagrap is used in constructing new mesh elements.
03625 *
03626 *               The tetrahedron can be opened a net and viewed looking
03627 *               at the directed edges uses associated with the faces from
03628 *               *outside* the element surface as shown below:
03629 * \verbatim
03630                                     n1                                
03631    n0 O-----------------------------O-----------------------------0 n0  
03632        \    ---------------------> / \    -------------------->  /    
03633         \ %         e0            / % \ %         e1            /     
03634          \ \                   / / /   \ \                  /  /      
03635           \ \                 / / /   \ \ \                /  /       
03636            \ \               / / /     \ \ \              /  /        
03637             \ \     f0      / / /       \ \ \     f1     /  /        
03638              \ \ e2     e1 / / /         \ \ \ e1    e0 /  /         
03639               \ \         / / /           \ \ \        /  /           
03640                \ \       / / /     f3      \ \ \      /  /             
03641                 \ \     / / /  e0       e1  \ \ \    /  /               
03642                  \ \   / / /                 \ \    /  /                 
03643                   \   / / /                   \ \  %  /                   
03644                    \ % /           e2          % \   /                    
03645                     \ /  <--------------------    \ /                       
03646                      O-----------------------------O                         
03647                    n2 \ %  -------------------->  / n3                
03648                        \ \         e1            /                    
03649                         \ \                   / /                     
03650                          \ \                 / /                      
03651                           \ \               / /                       
03652                            \ \     f2      / /                        
03653                             \ \           / /                         
03654                              \ \ e0   e2 / /                          
03655                               \ \       / /                           
03656                                \ \     / /                            
03657                                 \ \   / /                            
03658                                  \   / /                              
03659                                   \ % /                               
03660                                    \ /                                
03661                                     O                                 
03662                                    n0                                 
03663 \endverbatim
03664 *               Each mesh element has four faces and each face has three
03665 *               directed edges, with the edges directed counter clockwise
03666 *               (when viewed from outside the mesh element) away from their
03667 *               nodes.
03668 *
03669 *               <table>
03670 *                 <caption>
03671 *                 Indexing of faces, edge uses and nodes in 3D elements.
03672 *                 <\caption>
03673 *                 <tr><td>Face</td> <td>Edge Use</td> <td>Node/td></tr>
03674 *                 <tr><td>0</td>    <td>0</td>        <td>0/td></tr>
03675 *                 <tr><td>0</td>    <td>1</td>        <td>1/td></tr>
03676 *                 <tr><td>0</td>    <td>2</td>        <td>2/td></tr>
03677 *                 <tr><td>1</td>    <td>0</td>        <td>0/td></tr>
03678 *                 <tr><td>1</td>    <td>1</td>        <td>3/td></tr>
03679 *                 <tr><td>1</td>    <td>2</td>        <td>1/td></tr>
03680 *                 <tr><td>2</td>    <td>0</td>        <td>0/td></tr>
03681 *                 <tr><td>2</td>    <td>1</td>        <td>2/td></tr>
03682 *                 <tr><td>2</td>    <td>2</td>        <td>3/td></tr>
03683 *                 <tr><td>3</td>    <td>0</td>        <td>1/td></tr>
03684 *                 <tr><td>3</td>    <td>1</td>        <td>1/td></tr>
03685 *                 <tr><td>3</td>    <td>2</td>        <td>3/td></tr>
03686 *               </table>
03687 
03688 *               The face opposite a node, or node opposite a face
03689 *               can easily be found using: \f$f + n = 3\f$, where
03690 *               \f$f\f$ is the face and \f$n\f$ is the node.
03691 *
03692 */
03693 typedef struct _WlzCMeshElm3D
03694 {
03695   int           idx;                    /*!< The element index. */
03696   unsigned int  flags;                  /*!< Element flags. */
03697   struct _WlzCMeshFace face[4];         /*!< Faces of the mesh element. */
03698   struct _WlzCMeshCellElm3D *cElm;      /*!< First cell element from which
03699                                              all other cell elements can be
03700                                              reached using the next pointer. */
03701   void          *prop;                  /*!< Element properties. */
03702 } WlzCMeshElm3D;
03703 
03704 /*!
03705 * \union       _WlzCMeshElmP
03706 * \ingroup      WlzMesh
03707 * \brief        A element pointer for a 2 or 3D mesh.
03708 *               Typedef: ::WlzCMeshElmP.
03709 */
03710 typedef union _WlzCMeshElmP
03711 {
03712   void                   *v;            /*! Generic pointer. */
03713   struct _WlzCMeshElm2D  *e2;           /*!< 2D element pointer. */
03714   struct _WlzCMeshElm2D5 *e2d5;         /*!< 2D5 element pointer. */
03715   struct _WlzCMeshElm3D  *e3;           /*!< 3D element pointer. */
03716 } WlzCMeshElmP;
03717 
03718 /*!
03719 * \struct       _WlzCMeshCellElm2D
03720 * \ingroup      WlzMesh
03721 * \brief        Data structure which is used to link lists of 2D elements
03722 *               with the grid cells that they intersect.
03723 *               Typedef: ::WlzCMeshCell2D.
03724 */
03725 typedef struct _WlzCMeshCellElm2D
03726 {
03727   struct _WlzCMeshElm2D *elm;           /*! The element. */
03728   struct _WlzCMeshCell2D *cell;         /*! The cell. */
03729   struct _WlzCMeshCellElm2D *next;      /*! Next element intersecting cell or
03730                                             next cell element in the free
03731                                             list. */
03732   struct _WlzCMeshCellElm2D *nextCell;  /*! Next cell which this element
03733                                             intersects. */
03734 } WlzCMeshCellElm2D;
03735 
03736 /*!
03737 * \struct       _WlzCMeshCellElm2D5
03738 * \ingroup      WlzMesh
03739 * \brief        Data structure which is used to link lists of 2D5 elements
03740 *               with the grid cells that they intersect.
03741 *               Typedef: ::WlzCMeshCell2D5.
03742 */
03743 typedef struct _WlzCMeshCellElm2D5
03744 {
03745   struct _WlzCMeshElm2D5 *elm;          /*! The element. */
03746   struct _WlzCMeshCell2D5 *cell;        /*! The cell. */
03747   struct _WlzCMeshCellElm2D5 *next;     /*! Next element intersecting cell or
03748                                             next cell element in the free
03749                                             list. */
03750   struct _WlzCMeshCellElm2D5 *nextCell; /*! Next cell which this element
03751                                             intersects. */
03752 } WlzCMeshCellElm2D5;
03753 
03754 /*!
03755 * \struct       _WlzCMeshCellElm3D
03756 * \ingroup      WlzMesh
03757 * \brief        Data structure which is used to link lists of 3D elements
03758 *               with the grid cells that they intersect.
03759 *               Typedef: ::WlzCMeshCell3D.
03760 */
03761 typedef struct _WlzCMeshCellElm3D
03762 {
03763   struct _WlzCMeshElm3D *elm;           /*! The element. */
03764   struct _WlzCMeshCell3D *cell;         /*! The cell. */
03765   struct _WlzCMeshCellElm3D *next;      /*! Next element intersecting cell or
03766                                             next cell element in the free
03767                                             list. */
03768   struct _WlzCMeshCellElm3D *nextCell;  /*! Next cell which this element
03769                                             intersects. */
03770 } WlzCMeshCellElm3D;
03771 
03772 /*!
03773 * \struct       _WlzCMeshCell2D
03774 * \ingroup      WlzMesh
03775 * \brief        A single cell of a spatial grid or array of 2D cells.
03776 *               Typedef: ::WlzCMeshCell2D.
03777 */
03778 typedef struct _WlzCMeshCell2D
03779 {
03780   struct _WlzCMeshNod2D *nod;           /*! Head of a linked list of nodes
03781                                             which are located within the
03782                                             cell. */
03783   struct _WlzCMeshCellElm2D *cElm;      /*! Cell element data structure for
03784                                             an element which intersects this
03785                                             cell. */
03786 } WlzCMeshCell2D;
03787 
03788 /*!
03789 * \struct       _WlzCMeshCell2D5
03790 * \ingroup      WlzMesh
03791 * \brief        A single cell of a spatial grid or array of 2D5 cells.
03792 *               Typedef: ::WlzCMeshCell2D5.
03793 */
03794 typedef struct _WlzCMeshCell2D5
03795 {
03796   struct _WlzCMeshNod2D5 *nod;          /*! Head of a linked list of nodes
03797                                             which are located within the
03798                                             cell. */
03799   struct _WlzCMeshCellElm2D5 *cElm;     /*! Cell element data structure for
03800                                             an element which intersects this
03801                                             cell. */
03802 } WlzCMeshCell2D5;
03803 
03804 /*!
03805 * \struct       _WlzCMeshCell3D
03806 * \ingroup      WlzMesh
03807 * \brief        A single cell of a spatial grid or array of 3D cells.
03808 *               Typedef: ::WlzCMeshCell3D.
03809 */
03810 typedef struct _WlzCMeshCell3D
03811 {
03812   struct _WlzCMeshNod3D *nod;           /*! Head of a linked list of nodes
03813                                             which are located within the
03814                                             cell. */
03815   struct _WlzCMeshCellElm3D *cElm;      /*! Cell element data structure for
03816                                             an element which intersects this
03817                                             cell. */
03818 } WlzCMeshCell3D;
03819 
03820 /*!
03821 * \struct       _WlzCMeshCellGrid2D
03822 * \ingroup      WlzMesh
03823 * \brief        A spatial grid or array of square 2D cells that are used for
03824 *               fast node and element location queries.
03825 *               Typedef: ::WlzCMeshCellGrid2D.
03826 */
03827 typedef struct _WlzCMeshCellGrid2D
03828 {
03829   WlzIVertex2   nCells;                 /*! Dimensions of the cell grid
03830                                             array in terms of the number of
03831                                             cells. */
03832   double        cellSz;                 /*! Each cell is an axis aligned
03833                                             square with this side length. */
03834   struct _WlzCMeshCell2D **cells;       /*! Array of cells. */
03835   WlzCMeshCellElm2D *freeCE;            /*! List of free cell elements for
03836                                             re/use. */
03837   AlcBlockStack *allCE;                 /*! Allocated cell elements. */
03838 } WlzCMeshCellGrid2D;
03839 
03840 /*!
03841 * \struct       _WlzCMeshCellGrid2D5
03842 * \ingroup      WlzMesh
03843 * \brief        A spatial grid or array of cubiod 3D cells that are used for
03844 *               fast 2D5 node and element location queries.
03845 *               Typedef: ::WlzCMeshCellGrid2D5.
03846 */
03847 typedef struct _WlzCMeshCellGrid2D5
03848 {
03849   WlzIVertex3   nCells;                 /*! Dimensions of the cell grid
03850                                             array in terms of the number of
03851                                             cells. */
03852   double        cellSz;                 /*! Each cell is an axis aligned
03853                                             cube with this side length. */
03854   struct _WlzCMeshCell2D5 ***cells;     /*! Array of cells. */
03855   WlzCMeshCellElm2D5 *freeCE;           /*! List of free cell elements for
03856                                             re/use. */
03857   AlcBlockStack *allCE;                 /*! Allocated cell elements. */
03858 } WlzCMeshCellGrid2D5;
03859 
03860 /*!
03861 * \struct       _WlzCMeshCellGrid3D
03862 * \ingroup      WlzMesh
03863 * \brief        A spatial grid or array of square 3D cells that are used for
03864 *               fast node and element location queries.
03865 *               Typedef: ::WlzCMeshCellGrid3D.
03866 */
03867 typedef struct _WlzCMeshCellGrid3D
03868 {
03869   WlzIVertex3   nCells;                 /*! Dimensions of the cell grid
03870                                             array in terms of the number of
03871                                             cells. */
03872   double        cellSz;                 /*! Each cell is an axis aligned
03873                                             cube with this side length. */
03874   struct _WlzCMeshCell3D ***cells;      /*! Array of cells. */
03875   WlzCMeshCellElm3D *freeCE;            /*! List of free cell elements for
03876                                             re/use. */
03877   AlcBlockStack *allCE;                 /*! Allocated cell elements. */
03878 } WlzCMeshCellGrid3D;
03879 
03880 #ifndef WLZ_EXT_BIND
03881 /*!
03882 * \typedef      WlzCMeshCbFn
03883 * \ingroup      WlzMesh
03884 * \brief        A pointer to a function called to make mesh entity
03885 *               properties.
03886 *               Parameters passed are: mesh, entity, data.
03887 */
03888 typedef WlzErrorNum (*WlzCMeshCbFn)(void *, void *, void *);
03889 #endif
03890 
03891 /*!
03892 * \struct       _WlzCMeshCbEntry
03893 * \ingroup      WlzMesh
03894 * \brief        Callback entry for list of callbacks.
03895 *               Typedef: ::WlzCMeshCbEntry.
03896 */
03897 typedef struct _WlzCMeshCbEntry
03898 {
03899 #ifndef WLZ_EXT_BIND
03900   WlzCMeshCbFn  fn;
03901 #else
03902   void          *fn;
03903 #endif
03904   void          *data;
03905   struct _WlzCMeshCbEntry *next;
03906 } WlzCMeshCbEntry;
03907 
03908 /*!
03909 * \struct       _WlzCMeshEntRes
03910 * \ingroup      WlzMesh
03911 * \brief        Resources used for efficient allocation and recycling of
03912 *               mesh entities.
03913 *               Typedef: ::WlzCMeshEntRes.
03914 */
03915 typedef struct _WlzCMeshEntRes
03916 {
03917   unsigned int  numEnt;                 /*!< Number of valid entities in
03918                                              vector. */
03919   unsigned int  maxEnt;                 /*!< Space allocated in vector. */
03920   unsigned int  nextIdx;                /*!< Index of next free mesh entity
03921                                              in vector. */
03922   AlcVector     *vec;                   /*!< Vector (extensible array) of
03923                                              mesh entities. */
03924   WlzCMeshCbEntry *newEntCb;            /*!< Callbacks for new entities. */
03925   WlzCMeshCbEntry *delEntCb;            /*!< Callbacks for deleted entities. */
03926 } WlzCMeshEntRes;
03927 
03928 /*!
03929 * \struct       _WlzCMeshRes
03930 * \ingroup      WlzMesh
03931 * \brief        Resources used for efficient allocation, recycling and
03932 *               location of mesh elements and nodes.
03933 *               Typedef: ::WlzCMeshRes.
03934 */
03935 typedef struct _WlzCMeshRes
03936 {
03937   struct _WlzCMeshEntRes nod;            /*!< Node resources. */
03938   struct _WlzCMeshEntRes elm;            /*!< Element resources. */
03939 } WlzCMeshRes;
03940 
03941 /*!
03942 * \union        _WlzCMeshEntP
03943 * \ingroup      WlzMesh
03944 * \brief        Union of pointers to top level mesh entities.
03945 *               Typedef: ::WlzCMeshEntP
03946 */
03947 typedef union _WlzCMeshEntP
03948 {
03949   void                  *v;             /*!< Generic pointer. */
03950   struct _WlzCMeshNod2D *n2;            /*!< 2D node pointer. */
03951   struct _WlzCMeshNod2D *n2d5;          /*!< 2D5 node pointer. */
03952   struct _WlzCMeshNod3D *n3;            /*!< 3D node pointer. */
03953   struct _WlzCMeshElm2D *e2;            /*!< 2D element pointer. */
03954   struct _WlzCMeshElm2D *e2d5;          /*!< 2D5 element pointer. */
03955   struct _WlzCMeshElm3D *e3;            /*!< 3D element pointer. */
03956 } WlzCMeshEntP;
03957 
03958 /*!
03959 * \struct       _WlzCMesh2D
03960 * \ingroup      WlzMesh
03961 * \brief        A graph based mesh model for 2D boundary conforming
03962 *               simplical meshes.
03963 *               The mesh inherits it's core fields from the Woolz core
03964 *               domain.
03965 *               Typedef: ::WlzCMesh2D.
03966 */
03967 typedef struct _WlzCMesh2D
03968 {
03969   int           type;                   /*!< Type of mesh. */
03970   int           linkcount;              /*!< Core. */
03971   void          *freeptr;               /*!< Core. */
03972   double        maxSqEdgLen;            /*!< Maximum of squared edge lengths
03973                                              which can be used to restrict
03974                                              geometric searches. This may not
03975                                              be correct if nodes have been
03976                                              deleted or modified so it should
03977                                              not be relied upon for any more
03978                                              than an upper limit. */
03979   WlzDBox2      bBox;                   /*!< Axis aligned bounding box of
03980                                              the mesh. */
03981   WlzCMeshCellGrid2D cGrid;             /*!< Cell grid for fast node and
03982                                              element location queries. */
03983   struct _WlzCMeshRes res;              /*!< Mesh resources. */
03984 
03985 } WlzCMesh2D;
03986 
03987 /*!
03988 * \struct       _WlzCMesh2D5
03989 * \ingroup      WlzMesh
03990 * \brief        A graph based mesh model for 2D5 boundary conforming
03991 *               simplical meshes.
03992 *               The mesh inherits it's core fields from the Woolz core
03993 *               domain.
03994 *               Typedef: ::WlzCMesh2D5.
03995 */
03996 typedef struct _WlzCMesh2D5
03997 {
03998   int           type;                   /*!< Type of mesh. */
03999   int           linkcount;              /*!< Core. */
04000   void          *freeptr;               /*!< Core. */
04001   double        maxSqEdgLen;            /*!< Maximum of squared edge lengths
04002                                              which can be used to restrict
04003                                              geometric searches. This may not
04004                                              be correct if nodes have been
04005                                              deleted or modified so it should
04006                                              not be relied upon for any more
04007                                              than an upper limit. */
04008   WlzDBox3      bBox;                   /*!< Axis aligned bounding box of
04009                                              the mesh. */
04010   WlzCMeshCellGrid2D5 cGrid;            /*!< Cell grid for fast node and
04011                                              element location queries. */
04012   struct _WlzCMeshRes res;              /*!< Mesh resources. */
04013 
04014 } WlzCMesh2D5;
04015 
04016 /*!
04017 * \struct       _WlzCMesh3D
04018 * \ingroup      WlzMesh
04019 * \brief        A graph based mesh model for 3D boundary conforming
04020 *               simplical meshes.
04021 *               The mesh inherits it's core fields from the Woolz core
04022 *               domain.
04023 *               Typedef: ::WlzCMesh3D.
04024 */
04025 typedef struct _WlzCMesh3D
04026 {
04027   int           type;                   /*!< Type of mesh. */
04028   int           linkcount;              /*!< Core. */
04029   void          *freeptr;               /*!< Core. */
04030   double        maxSqEdgLen;            /*!< Maximum of squared edge lengths
04031                                              which can be used to restrict
04032                                              geometric searches. This may not
04033                                              be correct if nodes have been
04034                                              deleted or modified so it should
04035                                              not be relied upon for any more
04036                                              than an upper limit. */
04037   WlzDBox3      bBox;                   /*!< Axis aligned bounding box of
04038                                              the mesh. */
04039   WlzCMeshCellGrid3D cGrid;             /*!< Cell grid for fast node and
04040                                              element location queries. */
04041   struct _WlzCMeshRes res;              /*!< Mesh resources. */
04042 
04043 } WlzCMesh3D;
04044 
04045 /*!
04046 * \union        _WlzCMeshP
04047 * \ingroup      WlzMesh
04048 * \brief        Union of 2D and 3D conforming simplical mesh pointers.
04049 */
04050 typedef union _WlzCMeshP
04051 {
04052   void          *v;
04053   WlzCMesh2D    *m2;
04054   WlzCMesh2D5   *m2d5;
04055   WlzCMesh3D    *m3;
04056 } WlzCMeshP;
04057 
04058 /************************************************************************
04059 * Functions
04060 ************************************************************************/
04061 
04062 /*!
04063 * \enum         _WlzFnType
04064 * \ingroup      WlzFunction
04065 * \brief        The types of function.
04066 *               Typedef: ::WlzFnType.
04067 */
04068 typedef enum _WlzFnType
04069 {
04070   WLZ_FN_BASIS_2DGAUSS,                 /*!< Gaussian basis function. */
04071   WLZ_FN_BASIS_3DGAUSS,
04072   WLZ_FN_BASIS_2DIMQ,                   /*!< Inverse multiquadric basis
04073                                              function. */
04074   WLZ_FN_BASIS_3DIMQ,
04075   WLZ_FN_BASIS_2DPOLY,                   /*!< Polynomial basis function. */
04076   WLZ_FN_BASIS_3DPOLY,
04077   WLZ_FN_BASIS_2DMQ,                    /*!< Multiquadric basis function. */
04078   WLZ_FN_BASIS_3DMQ,
04079   WLZ_FN_BASIS_2DTPS,                   /*!< Thin plate spline basis fn. */
04080   WLZ_FN_BASIS_3DTPS,
04081   WLZ_FN_BASIS_2DCONF_POLY,             /*!< 2D Conformal polynomial basis
04082                                              function. */
04083   WLZ_FN_BASIS_3DCONF_POLY,
04084   WLZ_FN_BASIS_3DMOS,                   /*!< 3D Multi-order spline. */
04085   WLZ_FN_BASIS_SCALAR_3DMOS,            /*!< 3D Multi-order spline with scalar
04086                                              values. */
04087   WLZ_FN_SCALAR_MOD,                    /*!< Modulus (abs() or fabs()). */
04088   WLZ_FN_SCALAR_EXP,                    /*!< Exponential (exp()). */
04089   WLZ_FN_SCALAR_LOG,                    /*!< Logarithm (log()). */
04090   WLZ_FN_SCALAR_SQRT,                   /*!< Square root (x^-1/2). */
04091   WLZ_FN_SCALAR_INVSQRT,                /*!< Inverse square root (x^-1/2). */
04092   WLZ_FN_SCALAR_SQR,                    /*!< Square (x * x). */
04093   WLZ_FN_COUNT                          /*!< Not a function but the number
04094                                              of functions. Keep this the
04095                                              last of the enums! */
04096 } WlzFnType;
04097 
04098 /*!
04099 * \typedef      WlzBasisEvalFn
04100 * \ingroup      WlzFunction
04101 * \brief        An alternative basis function evaluation function that may
04102 *               may be called.
04103 */
04104 #ifdef WLZ_EXT_BIND
04105 typedef void *WlzBasisEvalFn;
04106 #else /* WLZ_EXT_BIND */
04107 typedef double (*WlzBasisEvalFn)(void *, double);
04108 #endif /* WLZ_EXT_BIND */
04109 
04110 /*!
04111 * \typedef      WlzBasisDistFn
04112 * \ingroup      WlzFunction
04113 * \brief        An alternative basis function distance function that may
04114 *               may be called.
04115 */
04116 #ifdef WLZ_EXT_BIND
04117 typedef void *WlzBasisDistFn;
04118 #else /* WLZ_EXT_BIND */
04119 typedef double (*WlzBasisDistFn)(void *, int, WlzVertex);
04120 #endif /* WLZ_EXT_BIND */
04121 
04122 /*!
04123 * \struct       _WlzBasisFn
04124 * \ingroup      WlzFunction
04125 * \brief        A basis function.
04126 *               Typedef: ::WlzBasisFn.
04127 */
04128 typedef struct _WlzBasisFn
04129 {
04130   WlzFnType     type;                   /*!< The transform basis function. */
04131   int           nPoly;                  /*!< Polynomial order + 1. */
04132   int           nBasis;                 /*!< Number of basis function
04133                                              coefficients. */
04134   int           nVtx;                   /*!< Number of control point
04135                                              vertices. */
04136   int           maxVx;                  /*!< Maximum number of vertices space
04137                                              has been allocated for. */
04138   WlzVertexP    poly;                   /*!< Polynomial coefficients. */
04139   WlzVertexP    basis;                  /*!< Basis function coefficients. */
04140   WlzVertexP    vertices;               /*!< Control point vertices, these are
04141                                              the destination vertices of the
04142                                              control points used to define the
04143                                              basis function transform. */
04144   WlzVertexP    sVertices;              /*!< Source vertices used to compute
04145                                              the transform. Not always used
04146                                              and may be NULL. */
04147   void          *param;                 /*!< Other parameters used by the
04148                                              basis function, e.g. delta in
04149                                              the MQ and Gauss basis
04150                                              functions. Must be allocated
04151                                              in a single block to allow
04152                                              the parameters to be freed
04153                                              by AlcFree().
04154                                              For the MQ this is actually
04155                                              \f$(\delta r)^2\f$, where \f$r\f$
04156                                              is the range of the landmarks. */
04157 #ifdef WLZ_EXT_BIND
04158   void          *evalFn;
04159 #else
04160   WlzBasisEvalFn evalFn;                /*!< An alternative basis function
04161                                              evaluation function that may
04162                                              be called if non NULL. */
04163 #endif
04164   WlzHistogramDomain *evalData;         /*!< Data passed to the alternative
04165                                              basis function evaluation
04166                                              function if the function pointer
04167                                              is non NULL. AlcFree() will be
04168                                              called to free the data when the
04169                                              basis function is free'd. */
04170 #ifdef WLZ_EXT_BIND
04171   void          *distFn;
04172   void          *mesh;
04173 #else
04174   WlzBasisDistFn distFn;                /*!< An alternative basis function
04175                                              distance function that may
04176                                              be called if non NULL. */
04177   WlzCMeshP     mesh;                   /*!< Associated mesh. */
04178 #endif
04179   double        **distMap;              /*!< Array of one dimensional arrays.
04180                                              There is a one dimensional array
04181                                              of mesh node distances for each
04182                                              landmark pair. Where the mesh is
04183                                              the mesh in the associated
04184                                              transform. In each one dimensional                                              array the node distances are
04185                                              indexed bu the node indices.
04186                                              There is a one dimensional array
04187                                              for each of the control points.
04188                                              Essentialy these arrays cache
04189                                              distances to avoid recomputation.
04190                                              If a distance array is no longer
04191                                              valid it should be freed and set
04192                                              to NULL, it will then be
04193                                              recomputed as needed.
04194                                              Athough the number of control
04195                                              points may vary the number of
04196                                              mesh nodes must remain constant. */
04197 } WlzBasisFn;
04198 
04199 /*!
04200 * \struct       _WlzThreshCbStr
04201 * \ingroup      WlzType
04202 * \brief        Callback structure from WlzCbThreshold()
04203 *               Typedef: ::WlzThreshCbStr.
04204 */
04205 typedef struct _WlzThreshCbStr
04206 {
04207   WlzPixelP     pix;
04208   WlzIVertex3   pos;
04209 } WlzThreshCbStr;
04210 
04211 /*!
04212 * \typedef      WlzThreshCbFn
04213 * \ingroup      WlzFunction
04214 * \brief        Callback function for the WlzCbThreshold()
04215 */
04216 #ifdef WLZ_EXT_BIND
04217 typedef void *WlzThreshCbFn;
04218 #else /* WLZ_EXT_BIND */
04219 typedef int (*WlzThreshCbFn)(WlzObject *, void *, WlzThreshCbStr *);
04220 #endif /* WLZ_EXT_BIND */
04221 
04222 /************************************************************************
04223 * Transforms
04224 ************************************************************************/
04225 /*!
04226 * \union        _WlzTransform
04227 * \ingroup      WlzTransform
04228 * \brief        A union of all valid transforms.
04229 *               Typedef: ::WlzTransform.
04230 */
04231 typedef union _WlzTransform
04232 {
04233   struct _WlzCoreTransform *core;       /*!< Core transform. */
04234   struct _WlzEmptyTransform *empty;     /*!< Empty (zero) transform. */
04235   struct _WlzAffineTransform *affine;   /*!< Affine transforms, 2D or 3D. */
04236   struct _WlzBasisFnTransform *basis;   /*!< Any basis function transform. */
04237   struct _WlzMeshTransform *mesh;       /*!< Any convex mesh transform. */
04238   struct _WlzObject *obj;               /*!< Some transforms are objects
04239                                              with a domain and values (eg
04240                                              conforming mesh transforms). */
04241 } WlzTransform;
04242 
04243 /*!
04244 * \struct       _WlzCoreTransform
04245 * \ingroup      WlzTransform
04246 * \brief        The core transform, with members common to all transforms.
04247 *               Typedef: ::WlzCoreTransform.
04248 */
04249 typedef struct _WlzCoreTransform
04250 {
04251   WlzTransformType type;                /*!< From WlzCoreDomain. */
04252   int           linkcount;              /*!< From WlzCoreDomain. */
04253   void          *freeptr;               /*!< From WlzCoreDomain. */
04254 } WlzCoreTransform;
04255 
04256 /*!
04257 * \struct       _WlzEmptyTransform
04258 * \ingroup      WlzTransform
04259 * \brief        An empty transform, with members common to all transforms.
04260 *               An empty transform is a compact represetation of a zero
04261 *               transform avoiding the use of NULL which implies an error.
04262 *               Typedef: ::WlzCoreTransform.
04263 */
04264 typedef struct _WlzEmptyTransform
04265 {
04266   WlzTransformType type;                /*!< From WlzCoreDomain. */
04267   int           linkcount;              /*!< From WlzCoreDomain. */
04268   void          *freeptr;               /*!< From WlzCoreDomain. */
04269 } WlzEmptyTransform;
04270 
04271 /*!
04272 * \struct       _WlzAffineTransform
04273 * \ingroup      WlzTransform
04274 * \brief        Either a 2D or 3D affine transform.
04275 *               The homogeneous matrix (mat) is always allocated as a 4x4
04276 *               AlcDouble2Alloc style array. It is used as a 3x3
04277 *               matrix for 2D and as a 4x4 matrix for 3D affine transforms. 
04278 *               Typedef: ::WlzAffineTransform.
04279 */
04280 typedef struct _WlzAffineTransform
04281 {
04282   WlzTransformType type;                /*!< From WlzCoreDomain. */
04283   int           linkcount;              /*!< From WlzCoreDomain. */
04284   void          *freeptr;               /*!< From WlzCoreDomain. */
04285   double        **mat;                  /*!< A 4x4 homogeneous matrix which is
04286                                              used as a 3x3 matrix for 2D
04287                                              transforms and as a 4x4 matrix for
04288                                              3D affine transforms. */
04289 } WlzAffineTransform;
04290 
04291 /*!
04292 * \struct       _WlzAffineTransformPrim
04293 * \ingroup      WlzTransform
04294 * \brief        Affine tranform primitives.
04295 *               Typedef: ::WlzAffineTransformPrim.
04296 */
04297 typedef struct _WlzAffineTransformPrim
04298 {
04299   double        tx,                     /*!< X translation. */
04300                 ty,                     /*!< Y translation. */
04301                 tz,                     /*!< Z translation. */
04302                 scale,                  /*!< Scale transformation. */
04303                 theta,                  /*!< Rotation about z-axis. */
04304                 phi,                    /*!< Rotation about y-axis. */
04305                 alpha,                  /*!< Shear strength. */
04306                 psi,                    /*!< Shear angle in x-y plane. */
04307                 xsi;                    /*!< 3D shear angle. */
04308   int           invert;                 /*!< Non-zero if reflection about
04309                                              the y-axis. */
04310 } WlzAffineTransformPrim;
04311 
04312 /*!
04313 * \struct       _WlzBasisFnTransform
04314 * \ingroup      WlzTransform
04315 * \brief        A basis function transform.
04316 *               The delta is used by the MQ and Gauss basis functions:
04317 *               For the MQ basis function delta = \f$R^2\f$,
04318 *               and for the Gaussian basis function delta = \f$1/s^2\f$.
04319 *               Typedef: ::WlzBasisFnTransform.
04320 */
04321 typedef struct _WlzBasisFnTransform
04322 {
04323   WlzTransformType type;                /*!< From WlzCoreDomain. */
04324   int           linkcount;              /*!< From WlzCoreDomain. */
04325   void          *freeptr;               /*!< From WlzCoreDomain. */
04326   WlzBasisFn    *basisFn;               /*!< The basis function for the
04327                                              transform. */
04328 } WlzBasisFnTransform;
04329 
04330 /*!
04331 * \struct       _WlzMeshNode
04332 * \ingroup      WlzTransform
04333 * \brief        Defines a node within a mesh transform.
04334 *               Typedef: ::WlzMeshNode.
04335 */
04336 typedef struct  _WlzMeshNode
04337 {
04338   unsigned int  flags;                  /*!< Mesh node flags. */
04339   WlzDVertex2   position;               /*!< Node position. */
04340   WlzDVertex2   displacement;           /*!< Node displacement. */
04341 } WlzMeshNode;
04342 
04343 /*!
04344 * \struct       _WlzMeshNode3D
04345 * \ingroup      WlzTransform
04346 * \brief        Defines a 3D node within a mesh transform.
04347 *  added by J. Rao 10/09/2001
04348 */
04349 struct  _WlzMeshNode3D
04350 {
04351   unsigned int  flags;                  /*!< Mesh node flags */
04352   WlzDVertex3   position;               /*!< Node position */
04353   WlzDVertex3   displacement;           /*!< Node displacement */
04354 };
04355 typedef struct _WlzMeshNode3D WlzMeshNode3D;
04356 
04357 
04358 
04359 /*!
04360 * \struct       _WlzMeshNode2D5
04361 * \ingroup      WlzTransform
04362 * \brief        Defines a 2D5 node within a mesh transform.
04363 *  added by J. Rao 23/10/2001
04364 */
04365 typedef struct  _WlzMeshNode2D5
04366 {
04367   unsigned int  flags;                  /*!< Mesh node flags */
04368   WlzDVertex2   position;               /*!< Node position */
04369   WlzDVertex3   displacement;           /*!< Node displacement */
04370 } WlzMeshNode2D5;
04371 
04372 /*!
04373 * \struct       _WlzMeshElem
04374 * \ingroup      WlzTransform
04375 * \brief        Defines an triangular mesh element within a mesh transform.
04376 *               The nodes and neighbours are indexed such that:         
04377 *               Neighbour 0 shares nodes 1 and 2, neighbour 1 shares nodes 2
04378 *               and 0 and neighbour 2 shares nodes 0 and 1. All the nodes
04379 *               are stored in counter clockwise (CCW) order.
04380 *               Typedef: ::WlzMeshElem.
04381 */
04382 typedef struct _WlzMeshElem
04383 {
04384   WlzMeshElemType type;                 /*!< Type of mesh element. */
04385   int           idx;                    /*!< Index of this element. */
04386   unsigned int  flags;                  /*!< Mesh element flags. */
04387   int           nodes[3];               /*!< Node indicies (CCW order). */
04388   int           neighbours[3];          /*!< Indicies of neighbouring
04389                                              elements. */
04390   double        strainU[3];             /*!< Constants of strain energy
04391                                              function. */
04392   double        strainA[3];             /*!< Constants of strain energy
04393                                              function. */
04394 } WlzMeshElem;
04395 
04396 /*!
04397 * \struct       _WlzMeshElem3D 
04398 * \ingroup      WlzTransform
04399 * \brief        Defines an tetrahedral mesh element within a mesh transform.
04400 *               The nodes and neighbours are indexed such that:         
04401 *               Neighbour 0 shares surface ( nodes 0, 1 and 2), neighbour 1 
04402 *               shares surface (nodes 1, 3 and 2), neighbour 2 shares surface
04403 *               (nodes 2, 3 and 0 ) and  neighbour 3 shares surface (nodes 0, 3 and 1 )
04404 *               All the nodes stored in the following sequence:
04405 *               0-1-2 formed a counter clockwise (CCW) order using the dircection of a 
04406 *               surface outwards from the tetrahedron. 0-2-3 are also stored in  
04407 *               counter clockwise (CCW) order.                          
04408 *               added by J. Rao     10/09/2001
04409 *
04410 */
04411 typedef struct _WlzMeshElem3D
04412 {
04413   WlzMeshElemType type;                 /*!< Type of mesh element */
04414   int           idx;                    /*!< Index of this element */
04415   unsigned int  flags;                  /*!< Mesh element flags */
04416   int           nodes[4];               /*!< Node indicies (CCW order) */
04417   int           neighbours[4];          /*!< Indicies of neighbouring
04418                                              elements */
04419 } WlzMeshElem3D;
04420 
04421 /*!
04422 * \struct       _WlzMeshTransform
04423 * \ingroup      WlzTransform
04424 * \brief        A mesh convex transform.
04425 *               Typedef: ::WlzMeshElem.
04426 */
04427 typedef struct _WlzMeshTransform
04428 {
04429   WlzTransformType type;                /*!< From WlzCoreDomain. */
04430   int           linkcount;              /*!< From WlzCoreDomain. */
04431   void          *freeptr;               /*!< From WlzCoreDomain. */
04432   int           nElem;                  /*!< Number of elements. */
04433   int           nNodes;                 /*!< Number of vertex nodes. */
04434   int           maxElem;                /*!< Space allocated for elements. */
04435   int           maxNodes;               /*!< Space allocated for vertex 
04436                                              nodes. */
04437   WlzMeshElem   *elements;              /*!< Mesh elements. */
04438   WlzMeshNode   *nodes;                 /*!< Mesh nodes. */
04439 } WlzMeshTransform;
04440 
04441 
04442 #ifndef WLZ_EXT_BIND
04443 /*!
04444 * \struct       _WlzMeshTransform3D
04445 * \ingroup      WlzTransform
04446 * \brief        Defines a mesh transform.
04447 *               added by J. Rao 10/09/2001        
04448 */
04449 typedef struct _WlzMeshTransform3D
04450 {
04451   WlzTransformType type;                /*!< From the core domain. */
04452   int           linkcount;              /*!< From the core domain. */
04453   void          *freeptr;               /*!< From the core domain. */
04454   int           nElem;                  /*!< Number of elements */
04455   int           nNodes;                 /*!< Number of vertex nodes */
04456   int           maxElem;                /*!< Space allocated for elements */
04457   int           maxNodes;               /*!< Space allocated for vertex 
04458                                              nodes */
04459   WlzMeshElem3D         *elements;      /*!< Mesh elements */
04460   WlzMeshNode3D         *nodes;         /*!< Mesh nodes */
04461 } WlzMeshTransform3D;
04462 
04463 #endif /* WLZ_EXT_BIND */
04464 
04465 /*!
04466 * \struct       _WlzMeshTransform2D5
04467 * \ingroup      WlzTransform
04468 * \brief        Defines a mesh transform.
04469 *               added by J. Rao 23/10/2001        
04470 */
04471 typedef struct _WlzMeshTransform2D5
04472 {
04473   WlzTransformType type;                /*!< From the core domain. */
04474   int           linkcount;              /*!< From the core domain. */
04475   void          *freeptr;               /*!< From the core domain. */
04476   int           nElem;                  /*!< Number of elements */
04477   int           nNodes;                 /*!< Number of vertex nodes */
04478   int           maxElem;                /*!< Space allocated for elements */
04479   int           maxNodes;               /*!< Space allocated for vertex 
04480                                              nodes */
04481   double        zConst;                 /*!< z plane const */
04482   WlzMeshElem           *elements;      /*!< Mesh elements */
04483   WlzMeshNode2D5        *nodes;         /*!< Mesh nodes */
04484 } WlzMeshTransform2D5;
04485 
04486 /************************************************************************
04487 * User weighting functions and callback data structures for ICP based
04488 * registration and matching.
04489 ************************************************************************/
04490 #ifndef WLZ_EXT_BIND
04491 /*!
04492 * \typedef      WlzRegICPUsrWgtFn
04493 * \ingroup      WlzTransform
04494 * \brief        A pointer to a function called for user code weighting
04495 *               of the matched vertices.
04496 */
04497 typedef double  (*WlzRegICPUsrWgtFn)(WlzVertexType,
04498                              WlzAffineTransform *,
04499                              AlcKDTTree *,
04500                              WlzVertexP, WlzVertexP, WlzVertex, WlzVertex,
04501                              double, double, void *);
04502 
04503 /*!
04504 * \typedef      WlzMatchICPWeightCbData
04505 * \ingroup      WlzTransform
04506 * \brief        A data structure for wieghting vertex matches within
04507 *               WlzMatchICPWeightMatches().
04508 *               Typedef: ::WlzMatchICPWeightCbData.
04509 */
04510 typedef struct _WlzMatchICPWeightCbData
04511 {
04512   WlzGMModel    *tGM;
04513   WlzGMModel    *sGM;
04514   int           nScatter;
04515   double        maxDisp;
04516 } WlzMatchICPWeightCbData;
04517 
04518 #endif /* WLZ_EXT_BIND */
04519 
04520 /************************************************************************
04521 * Sequential/local transformation workspace structure.          
04522 ************************************************************************/
04523 /*!
04524 * \struct       _WlzSeqParWSpace
04525 * \ingroup      WlzValuesFilters
04526 * \brief        
04527 *               Typedef: ::WlzSeqParWSpace.
04528 */
04529 typedef struct _WlzSeqParWSpace
04530 {
04531   int **adrptr;
04532   int kdelta;
04533   int ldelta;
04534   int brdrsz;
04535 } WlzSeqParWSpace;
04536 
04537 /*!
04538 * \struct       _Wlz1DConvMask
04539 * \ingroup      WlzValuesFilters
04540 * \brief
04541 *               Typedef: ::Wlz1DConvMask.
04542 */
04543 typedef struct _Wlz1DConvMask
04544 {
04545   int mask_size;
04546   int *mask_values;
04547   int norm_factor;
04548 } Wlz1DConvMask;
04549 
04550 /*!
04551 * \struct       _WlzSepTransWSpace
04552 * \ingroup      WlzValuesFilters
04553 * \brief
04554 *               Typedef: ::WlzSepTransWSpace.
04555 */
04556 typedef struct _WlzSepTransWSpace
04557 {
04558   WlzPixelP     inbuf;
04559   WlzPixelP     outbuf;
04560   int           len;
04561   WlzPixelV     bckgrnd;
04562 } WlzSepTransWSpace;
04563 
04564 /************************************************************************
04565 * Standard workspace structure for interval objects.            
04566 ************************************************************************/
04567 /*!
04568 * \struct       _WlzIntervalWSpace
04569 * \ingroup      WlzAccess
04570 * \brief        The standard workspace structure for interval objects.
04571 *               Typedef: ::WlzIntervalWSpace.
04572 */
04573 typedef struct _WlzIntervalWSpace
04574 {
04575   WlzObject *objaddr;                   /*!< The current object. */
04576   int dmntype;                          /*!< Domain type. */
04577   int lineraster;                       /*!< Line scan direction as follows:
04578                                              <ul>
04579                                                <li>
04580                                                 1 increasing rows.
04581                                                </li>
04582                                                <li>
04583                                                 -1 decreasing rows.
04584                                                </li>
04585                                              </ul> */
04586   int colraster;                        /*!< Column scan direction as follows:
04587                                              <ul>
04588                                                <li>
04589                                                 1 increasing columns.
04590                                                </li>
04591                                                <li>
04592                                                 -1 decreasing columns.
04593                                                </li>
04594                                              </ul> */
04595   WlzIntervalDomain *intdmn;            /*!< Pointer to interval structure. */
04596   WlzIntervalLine *intvln;              /*!< Pointer to current line of
04597                                              intervals. */
04598   WlzInterval   *intpos;                /*!< Pointer to current interval - 
04599                                              in the case of
04600                                              WLZ_INTERVALDOMAIN_RECT this
04601                                              is set up to point to the column
04602                                              bounds in the interval domain
04603                                              structure. */
04604   int colpos;                           /*!< Column position. */
04605   int colrmn;                           /*!< Columns remaining. */
04606   int linbot;                           /*!< First line. */
04607   int linpos;                           /*!< Line position. */
04608   int linrmn;                           /*!< Lines remaining. */
04609   int intrmn;                           /*!< Intervals remaining in line. */
04610   int lftpos;                           /*!< Left end of interval. */
04611   int rgtpos;                           /*!< Right end of interval. */
04612   int nwlpos;                           /*!< Non-zero if new line, counts
04613                                              line increment since the last
04614                                              interval. */
04615   struct _WlzGreyWSpace *gryptr;        /*!< Pointer to grey value table
04616                                              workspace. */
04617 } WlzIntervalWSpace;
04618 
04619 /************************************************************************
04620 * Standard workspace for grey value table manipulations                 
04621 ************************************************************************/
04622 /*!
04623 * \struct       _WlzGreyWSpace
04624 * \ingroup      WlzAccess
04625 * \brief        The standard workspace for grey value table manipulations.
04626 *               Typedef: ::WlzGreyWSpace.
04627 */
04628 typedef struct _WlzGreyWSpace
04629 {
04630   int gvio;                             /*!< Grey value I/O switch:
04631                                              <ul>
04632                                                <li>
04633                                                0 = input to object only
04634                                                </li>
04635                                                <li>
04636                                                1 = output from object only
04637                                                </li>
04638                                              </ul>
04639                                             Only relevant if tranpl set, as all
04640                                             grey-tables are unpacked. */
04641   int tranpl;                           /*!< If non-zero, transplant values
04642                                              to a buffer whose address is
04643                                              u_grintptr. Direction of
04644                                              transplant in gvio. */
04645   WlzGreyType pixeltype;                /*!< Grey type. */
04646   WlzObjectType gdomaintype;            /*!< Value table type. */
04647   WlzValues gtable;                     /*!< Grey value table. */
04648   WlzValueLine *gline;                  /*!< Pointer to current grey table
04649                                              line pointer. */
04650   WlzIntervalWSpace *intptr;            /*!< Pointer to interval table
04651                                              workspace. */
04652   WlzGreyP u_grintptr;                  /*!< Pointer to interval grey table.
04653                                              Always points to lowest order
04654                                              column, whatever the value of
04655                                              raster. */
04656 } WlzGreyWSpace;
04657 
04658 
04659 /*!
04660 * \struct       _WlzIterateWSpace
04661 * \ingroup      WlzAccess
04662 * \brief        A workspace structure for interval objects which allows
04663 *               iteration through an object's pixels/voxels..
04664 *               Typedef: ::WlzIterateWSpace.
04665 */
04666 typedef struct _WlzIterateWSpace
04667 {
04668   WlzObject     *obj;                   /*!< The object being iterated
04669                                              through. */
04670   WlzObject     *obj2D;                 /*!< Object for the current plane. */
04671   WlzIntervalWSpace *iWSp;              /*!< Interval workspace for the current
04672                                              2D object. */
04673   WlzGreyWSpace *gWSp;                  /*!< Grey workspace for the current
04674                                              2D object. */
04675   WlzRasterDir  dir;                    /*!< Scanning direction. */
04676   int           grey;                   /*!< Non-zero if initialised for
04677                                              grey values. */
04678   int           itvPos;                 /*!< Offset into the current
04679                                              interval. */
04680   int           plnIdx;                 /*!< Offset into planes of a 3D object
04681                                              for the current plane. */
04682   int           plnRmn;                 /*!< Number of planes remaining for
04683                                              the current 2D object when
04684                                              iterating through a 3D object. */
04685   WlzIVertex3   pos;                    /*!< Current position. */
04686   WlzGreyType   gType;                  /*!< The current grey type. If
04687                                              WLZ_GREY_ERROR then the work space
04688                                              has not been initialised for grey
04689                                              data. */
04690   WlzGreyP      gP;                     /*!< Pointer to current grey value
04691                                              This will be NULL if grey values
04692                                              are not appopriate, ie gType
04693                                              is WLZ_GREY_ERROR. */
04694 } WlzIterateWSpace;
04695 
04696 /*!
04697 * \struct       _WlzGreyValueWSpace
04698 * \ingroup      WlzAccess
04699 * \brief        Workspace for random access grey value manipulations.
04700 *               Typedef: ::WlzGreyValueWSpace.
04701 */
04702 typedef struct _WlzGreyValueWSpace
04703 {
04704   WlzObjectType objType;                /*!< Type of object, either
04705                                              WLZ_2D_DOMAINOBJ or
04706                                              WLZ_3D_DOMAINOBJ. */
04707   WlzDomain     domain;                 /*!< The object's domain. */
04708   WlzValues     values;                 /*!< The object's values. */
04709   WlzObjectType gTabType;               /*!< The grey table type. */
04710   WlzObjectType *gTabTypes3D;           /*!< Cache for efficiency with 2D
04711                                              value types. Not used for
04712                                              tiled values. */
04713   WlzAffineTransform *invTrans;         /*!< If the object is a WLZ_TRANS_OBJ
04714                                              then used to cache the inverse
04715                                              transform. */
04716   WlzIntervalDomain *iDom2D;            /*!< Current/last plane or 2D object
04717                                              domain. */
04718   WlzValues     values2D;               /*!< Current/last plane or 2D object
04719                                              values. Not used for tiled
04720                                              values. */
04721   int           plane;                  /*!< Current/last plane position. */
04722   WlzGreyType   gType;                  /*!< Grey type. */
04723   WlzObjectType gTabType2D;             /*!< Current/last plane or 2D grey
04724                                              table. Not used for tiled
04725                                              values. */
04726   WlzGreyV      gBkd;                   /*!< Background grey value, always
04727                                              of gType. */
04728   WlzGreyP      gPtr[8];                /*!< One, four or eight grey
04729                                              pointers. */
04730   WlzGreyV      gVal[8];                /*!< One, four or eight grey
04731                                              values. */
04732   unsigned      bkdFlag;                /*!< Flag set if background used
04733                                              with a bitmask to indicate
04734                                              which values are background.
04735                                              Value is 0 if there are no
04736                                              background values. */
04737 } WlzGreyValueWSpace;
04738 
04739 /************************************************************************
04740 * Transform callback functions
04741 ************************************************************************/
04742 
04743 /*!
04744 * \typedef      WlzAffineTransformCbFn
04745 * \ingroup      WlzTransform
04746 * \brief        Callback function for the WlzAffineTransformCb()
04747 *               which may be used for value interpolation of an
04748 *               interval of destination values.
04749 *
04750 *               The parameters are:
04751 *               \arg cbData Callback data passed to WlzAffineTransformCb().
04752 *               \arg gWSp   Target grey workspace.
04753 *               \arg gVWSp  Source grey value workspace.
04754 *               \arg invTr  Affine transform from target to source.
04755 *               \arg pln    Plane of interval in destination.
04756 *               \arg ln     Line of interval in destination.
04757 */
04758 #ifndef WLZ_EXT_BIND
04759 typedef WlzErrorNum (*WlzAffineTransformCbFn)(void *cbData,
04760                                       struct _WlzGreyWSpace *gWSp,
04761                                       struct _WlzGreyValueWSpace *gVWSp,
04762                                       struct _WlzAffineTransform *invTr,
04763                                       int pln, int ln);
04764 #endif
04765 
04766 /************************************************************************
04767 * Finite Element and Warping structures.                        
04768 ************************************************************************/
04769 
04770 /*!
04771 * \enum         _WlzElementType
04772 * \ingroup      WlzTransform
04773 * \brief        The types of elements in a finite element warp mesh.
04774 *               Typedef: ::WlzElementType.
04775 */
04776 typedef enum _WlzElementType
04777 {
04778     WLZ_LINEAR_RECT             = 11,   /*!< Linear and rectangular. */
04779     WLZ_INCOMPRESSIBLE_RECT,            /*!< Incompessible and rectangular. */
04780     WLZ_COMPRESSIBLE_RECT,              /*!< Compressible and rectangular. */
04781     WLZ_LINEAR_TRI              = 21,   /*!< Linear and triangular. */
04782     WLZ_INCOMPRESSIBLE_TRI,             /*!< Incompessible and triangular. */
04783     WLZ_COMPRESSIBLE_TRI                /*!< Compressible and triangular. */
04784 } WlzElementType;
04785 
04786 
04787 #define WLZ_LINEAR 1
04788 #define WLZ_INCOMPRESSIBLE 2
04789 #define WLZ_COMPRESSIBLE 3
04790 
04791 #define WLZ_RECTANGULAR 1
04792 #define WLZ_TRIANGULAR 2
04793 
04794 /*!
04795 * \struct       _WlzTElement
04796 * \ingroup      WlzTransform
04797 * \brief        Triangular finite element warping mesh element.
04798 *               Typedef: ::WlzTElement.
04799 */
04800 typedef struct _WlzTElement
04801 {
04802     WlzElementType type;        /*!< Type of element (linear, compressible,
04803                                      incompressible). */
04804     int n;                      /*!< Global element number. */
04805     int nodes[3];               /*!< Global node numbers - in anti-clockwise
04806                                      order! */
04807     float u[3];                 /*!< E = u[0] if type linear. */
04808     float a[3];                 /*!< \f$\mu\f$ = a[0] if type linear. */
04809 } WlzTElement;
04810 
04811 /*!
04812 * \struct       _WlzRElement
04813 * \ingroup      WlzTransform
04814 * \brief        Rectangular finite element warping mesh element.
04815 *               Typedef: ::WlzRElement.
04816 */
04817 typedef struct _WlzRElement
04818 {
04819     WlzElementType type;        /*!< Type of element (linear, compressible,
04820                                      incompressible). */
04821     int n;                      /*!< Global element number. */
04822     int nodes[4];               /*!< Global node numbers - in anti-clockwise
04823                                      order! */
04824     float u[3];                 /*!< E = u[0] if type linear. */
04825     float a[3];                 /*!< \f$\mu\f$ = a[0] if type linear. */
04826 } WlzRElement;
04827 
04828 /*!
04829 * \struct       _WlzWarpTrans
04830 * \ingroup      WlzTransform
04831 * \brief        Finite element warp transformation.
04832 *               Typedef: ::WlzWarpTrans.
04833 */
04834 typedef struct _WlzWarpTrans
04835 {
04836   int type;                     /*!< From WlzCoreDomain. */
04837   int linkcount;                /*!< From WlzCoreDomain. */
04838   int nelts;                    /*!< Number of elements */
04839   int nodes;                    /*!< Number of nodes. */
04840   WlzDVertex2 *ncoords;         /*!< Array of nodal coordinates. */
04841   WlzTElement *eltlist;         /*!< List of elements. */
04842   WlzDVertex2 *displacements;   /*!< Array of nodal displacements. */
04843   float imdisp;                 /*!< Max displacement in warped image. */
04844   float iterdisp;               /*!< Max displacement during last iteration. */
04845 } WlzWarpTrans;
04846 
04847 /************************************************************************
04848 * Feature matching structures for finite element warping.
04849 ************************************************************************/
04850 
04851 /*!
04852 * \enum         _WlzMatchType
04853 * \ingroup      WlzRegistration
04854 * \brief        Finite element warping match types.
04855 *               Typedef: ::WlzMatchType.
04856 */
04857 typedef enum _WlzMatchType
04858 {
04859     WLZ_DISCARD_POINT   = -1,
04860     WLZ_NODE_ATTACH     = 0,
04861     WLZ_ELEMENT_ATTACH  = 1
04862 } WlzMatchType;
04863 
04864 #define WLZ_MAX_NODAL_DEGREE 20
04865 
04866 /*!
04867 * \struct       _WlzFeatureVector
04868 * \ingroup      WlzRegistration
04869 * \brief        Finite element warping feature vector.
04870 *               Typedef: ::WlzFeatureVector.
04871 */
04872 typedef struct _WlzFeatureVector
04873 {
04874   int direction;
04875   float magnitude;
04876   float mean1;
04877   float mean2;
04878   float std1;
04879   float std2;
04880 } WlzFeatureVector;
04881 
04882 
04883 /*!
04884 * \struct       _WlzFeatValueLine
04885 * \ingroup      WlzRegistration
04886 * \brief        A line of finite element warping feature vectors.
04887 *               Typedef: ::WlzFeatValueLine.
04888 */
04889 typedef struct _WlzFeatValueLine
04890 {
04891   int    vkol1;                         /*!< Left end. */
04892   int    vlastkl;                       /*!< Right end. */
04893   WlzFeatureVector *values;             /*!< Array of feature vector values. */
04894 } WlzFeatValueLine;
04895 
04896 
04897 /*!
04898 * \struct       _WlzFeatValues
04899 * \ingroup      WlzRegistration
04900 * \brief        A ragged rectangular feature value table.
04901 *               Typedef: ::WlzFeatValues.
04902 */
04903 typedef struct _WlzFeatValue
04904 {
04905   WlzObjectType type;                   /*!< From WlzCoreValues. */
04906   int           linkcount;              /*!< From WlzCoreValues. */
04907   void          *freeptr;               /*!< From WlzCoreValues. */
04908   WlzValues     original_table;         /*!< If non-NULL, the values table
04909                                              which owns the raw values we
04910                                              are using. */
04911   int           line1;                  /*!< First line. */
04912   int           lastln;                 /*!< Last line. */
04913   int           kol1;                   /*!< First column. */
04914   int           width;                  /*!< Width. */
04915   WlzFeatureVector backgrnd;            /*!< Background value for feature
04916                                              vectors not in object. */
04917   WlzFeatValueLine *vtblines;           /*!< Array of feature value table line
04918                                              structures. */
04919 } WlzFeatValues;
04920     
04921 
04922 /*!
04923 * \struct       _WlzRectFeatValues
04924 * \ingroup      WlzRegistration
04925 * \brief        A rectangular feature value table.
04926 *               Typedef: ::WlzRectFeatValues.
04927 */
04928 typedef struct  _WlzRectFeatValues
04929 {
04930   WlzObjectType type;                   /*!< From WlzCoreValues. */
04931   int           linkcount;              /*!< From WlzCoreValues. */
04932   void          *freeptr;               /*!< From WlzCoreValues. */
04933   WlzValues     original_table;         /*!< If non-NULL, the values table
04934                                              which owns the raw values we
04935                                              are using. */
04936   int           line1;                  /*!< First line. */
04937   int           lastln;                 /*!< Last line. */
04938   int           kol1;                   /*!< First column. */
04939   int           width;                  /*!< Width. */
04940   WlzFeatureVector backgrnd;            /*!< Background value for feature
04941                                              vectors not in object. */
04942   WlzFeatureVector *values;             /*!< Contiguous array of feature
04943                                              vector values. */
04944 } WlzRectFeatValues;
04945     
04946 
04947 /*!
04948 * \struct       _WlzFMatchPoint
04949 * \ingroup      WlzRegistration
04950 * \brief        Finite element warping feature match point.
04951 *               Typedef: ::WlzFMatchPoint.
04952 */
04953 typedef struct _WlzFMatchPoint
04954 {
04955   WlzMatchType  type;                   /*!< Match type. */
04956   int           node;                   /*!< Node or element to which point
04957                                              attached. */
04958   WlzFVertex2   ptcoords;               /*!< Coordinate of interesting
04959                                              point. */
04960   int           elements[WLZ_MAX_NODAL_DEGREE]; /*!< Array of elements in
04961                                             which to search for point. */
04962   WlzFeatureVector *features;           /*!< Pointer to features of point. */
04963 } WlzFMatchPoint;
04964 
04965 /*!
04966 * \struct       _WlzFMatchObj
04967 * \ingroup      WlzRegistration
04968 * \brief        A finite element warping feature match, interesting points
04969 *               object.
04970 *               Typedef: ::WlzFMatchObj.
04971 */
04972 typedef struct _WlzFMatchObj
04973 {
04974   WlzObjectType type;                   /*!< From WlzCoreObject. */
04975   int           linkcount;              /*!< From WlzCoreObject. */
04976   int           nopts;                  /*!< Number of interesting points. */
04977   WlzFMatchPoint *matchpts;             /*!< Array of interesting points. */
04978 } WlzFMatchObj;
04979 
04980 /*!
04981 * \struct       _Wlz3DWarpTrans
04982 * \ingroup      WlzRegistration
04983 * \brief        A plane-wise 3D finite element warping transform.
04984 *               Typedef: ::Wlz3DWarpTrans.
04985 */
04986 typedef struct _Wlz3DWarpTrans
04987 {
04988   WlzObjectType type;                   /*!< From WlzCoreObject. */
04989   int           linkcount;              /*!< From WlzCoreObject. */
04990   WlzPlaneDomain *pdom;                 /*!< Plane domain. */
04991   WlzFMatchObj  **intptdoms;            /*!< Array of pointers to interesting
04992                                              point objects. */
04993   int           iteration;              /*!< Current iteration. */
04994   int           currentplane;           /*!< Current plane. */
04995   float         maxdisp;                /*!< Maximum displacement. */
04996   WlzPropertyList *plist;               /*!< A list of the object's
04997                                              properties. */
04998   WlzObject     *assoc;                 /*!< Associated object. */
04999 } Wlz3DWarpTrans;
05000 
05001 /*!
05002 * \enum         _Wlz3DViewStructInitMask
05003 * \ingroup      WlzTransform
05004 * \brief        Mesh transform element flag bit masks.
05005 *               Typedef: ::WlzMeshElemFlags.
05006 */
05007 typedef enum _Wlz3DViewStructInitMask
05008 {
05009   WLZ_3DVIEWSTRUCT_INIT_NONE    = (0),
05010   WLZ_3DVIEWSTRUCT_INIT_TRANS   = (1),    /*!< Initialised transform */
05011   WLZ_3DVIEWSTRUCT_INIT_BB      = (1<<1), /*!< Initialised bounding box */
05012   WLZ_3DVIEWSTRUCT_INIT_LUT     = (1<<2), /*!< Initialised look-up tables */
05013 #ifndef WLZ_EXT_BIND
05014   WLZ_3DVIEWSTRUCT_INIT_ALL     = 0x7     /*!< Initialised all convenience mask */
05015 #else
05016   WLZ_3DVIEWSTRUCT_INIT_ALL     = (7)     /*!< Initialised all convenience mask */
05017 #endif
05018 } Wlz3DViewStructInitMask;
05019 
05020 /************************************************************************
05021 * 3D section structure.                                         
05022 ************************************************************************/
05023 /*!
05024 * \struct       _WlzThreeDViewStruct
05025 * \ingroup      WlzSectionTransform
05026 * \brief        Defines a planar section through a 3D volume.
05027 *               Typedef: ::WlzThreeDViewStruct.
05028 */
05029 typedef struct _WlzThreeDViewStruct
05030 {
05031   WlzObjectType type;                   /*!< Identifies the 3D view data
05032                                              structure: WLZ_3D_VIEW_STRUCT. */
05033   int           linkcount;              /*!< Core. */
05034   void          *freeptr;               /*!< Core. */
05035   int           initialised;            /*!< Non zero if the 3D view structure
05036                                              has been initialized. */
05037   WlzDVertex3   fixed;                  /*!< Fixed point. */
05038   double        theta;                  /*!< Angle of rotation about the z-axis
05039                                              (radians). */
05040   double        phi;                    /*!< Angle between the viewing
05041                                              direction and the original
05042                                              z-axis (radians). */
05043   double        zeta;                   
05044   double        dist;                   /*!< Perpendicular distance from the
05045                                              fixed point to the view plane. */
05046   double        scale;                  /*!< Overall scale parameter */
05047   double        voxelSize[3];           /*!< Voxel rescaling if required */
05048   int           voxelRescaleFlg;        /*!< Voxel rescaling mode */
05049   WlzInterpolationType interp;          /*!< use pixel interpolation */
05050   WlzThreeDViewMode view_mode;          /*!< Determines the angle at which the
05051                                              section cut. */
05052   WlzDVertex3   up;                     /*!< Up vector. */
05053   WlzDVertex3   fixed_2;                /*!< Second fixed point. */
05054   double        fixed_line_angle;       /*!< Angle of fixed line. */
05055   WlzObject     *ref_obj;
05056   WlzDVertex3   minvals;
05057   WlzDVertex3   maxvals;
05058   double        *xp_to_x, *xp_to_y, *xp_to_z;
05059   double        *yp_to_x, *yp_to_y, *yp_to_z;
05060 /*  double      **rotation;*/
05061   WlzAffineTransform    *trans;         /*!< Affine transform for given
05062                                           parameters. Could include the
05063                                           voxel size rescaling */
05064 } WlzThreeDViewStruct;
05065 
05066 /*!
05067 * \typedef      WlzProjectIntMode
05068 * \ingroup      WlzTransform
05069 * \brief        3D to 2D projection integration modes.
05070 */
05071 typedef enum    _WlzProjectIntMode
05072 {
05073   WLZ_PROJECT_INT_MODE_NONE,            /*!< No integration. */
05074   WLZ_PROJECT_INT_MODE_DOMAIN,          /*!< Integration using constant
05075                                              density within a domain. */
05076   WLZ_PROJECT_INT_MODE_VALUES           /*!< Integration using voxel value
05077                                              dependant density. */
05078 } WlzProjectIntMode;
05079 
05080 /*!
05081 * \enum         _WlzKrigModelFnType
05082 * \ingroup      WlzType
05083 * \brief        Enumerated values for kriging variogram model functions. See
05084 *               the functions for details.
05085 */
05086 typedef enum _WlzKrigModelFnType
05087 {
05088   WLZ_KRIG_MODELFN_INVALID      = 0,    /*!< Invalid function, may be used
05089                                              to indicate an error. */
05090   WLZ_KRIG_MODELFN_NUGGET,              /*!< Nugget model function, see
05091                                              WlzKrigModelFnNugget(). */
05092   WLZ_KRIG_MODELFN_LINEAR,              /*!< Linear model function, see
05093                                              WlzKrigModelFnNugget(). */
05094   WLZ_KRIG_MODELFN_SPHERICAL,           /*!< Spherical model function, see
05095                                              WlzKrigModelFnSpherical(). */
05096   WLZ_KRIG_MODELFN_EXPONENTIAL,         /*!< Exponential model function, see
05097                                              WlzKrigModelFnExponential(). */
05098   WLZ_KRIG_MODELFN_GAUSSIAN,            /*!< Gaussian model function, see
05099                                              WlzKrigModelFnGaussian(). */
05100   WLZ_KRIG_MODELFN_QUADRATIC            /*!< Quadratic model function, see
05101                                              WlzKrigModelFnQuadratic(). */
05102 } WlzKrigModelFnType;
05103 
05104 /*!
05105 * \struct       _WlzKrigModelFn
05106 * \ingroup      WlzType
05107 * \brief        Parameters and function pointer for a kriging model function.
05108 */
05109 typedef struct _WlzKrigModelFn
05110 {
05111   WlzKrigModelFnType    type;           /*!< Kriging model function type. */
05112   double                c0;             /*!< Nugget (offset) parameter. */
05113   double                c1;             /*!< Sill (slope) parameter. */
05114   double                a;              /*!< Range parameter. */
05115 #ifdef WLZ_EXT_BIND
05116   void                  *fn;
05117 #else
05118   double                (*fn)(struct _WlzKrigModelFn *, double h);
05119 #endif
05120                                         /*!< Function pointer. */
05121 } WlzKrigModelFn;
05122 
05123 
05124 #ifndef WLZ_EXT_BIND
05125 #ifdef  __cplusplus
05126 }
05127 #endif /* __cplusplus */
05128 #endif /* WLZ_EXT_BIND */
05129 
05130 #endif  /* !WLZ_TYPE_H Don't put anything after this line */