Woolz Image Processing  Version 1.7.5
WlzCMeshTransform.c File Reference

Functions for creating and applying 2D and 3D conforming mesh transforms. More...

Data Structures

struct  _WlzCMeshScanElm2D
 Conforming mesh scanning element for 2D mesh. More...
 
struct  _WlzCMeshScanElm3D
 Conforming mesh scanning element for 2D5 or 3D mesh. More...
 
struct  _WlzCMeshScanItv2D
 Scan interval within a 2D conforming mesh element. More...
 
struct  _WlzCMeshScanItv3D
 Scan interval within a 3D conforming mesh element. More...
 
struct  _WlzCMeshScanWSp2D
 Conforming mesh scanning workspace for a 2D mesh. More...
 
struct  _WlzCMeshScanWSp3D
 Conforming mesh scanning workspace for a 3D mesh. More...
 

Macros

#define WLZ_CMESH_POS_DTOI(X)   ((int )floor(X))
 

Typedefs

typedef enum _WlzCMeshScanElmFlags WlzCMeshScanElmFlags
 
typedef struct _WlzCMeshScanElm2D WlzCMeshScanElm2D
 
typedef struct _WlzCMeshScanElm3D WlzCMeshScanElm3D
 
typedef struct _WlzCMeshScanItv2D WlzCMeshScanItv2D
 
typedef struct _WlzCMeshScanItv3D WlzCMeshScanItv3D
 
typedef struct _WlzCMeshScanWSp2D WlzCMeshScanWSp2D
 
typedef struct _WlzCMeshScanWSp3D WlzCMeshScanWSp3D
 

Enumerations

enum  _WlzCMeshScanElmFlags {
  WLZ_CMESH_SCANELM_NONE = (0),
  WLZ_CMESH_SCANELM_SQUASH = (1),
  WLZ_CMESH_SCANELM_FWD = (2),
  WLZ_CMESH_SCANELM_REV = (4)
}
 Flags for the conforming mesh scannning elements. More...
 

Functions

WlzObjectWlzCMeshTransformInvert (WlzObject *gObj, WlzErrorNum *dstErr)
 Inverts the given constrained mesh transform in place. More...
 
WlzObjectWlzCMeshTransformFromObj (WlzObject *srcObj, WlzMeshGenMethod method, double minDist, double maxDist, WlzObject **dstDilObj, int delOut, WlzErrorNum *dstErr)
 Creates a conforming mesh transform for the given object with all mesh displacements allocated but set to zero. A mesh transform is a conforming mesh object with indexed values such that the values are double precision displacements that are ordered x, y[, z]. More...
 
WlzErrorNum WlzCMeshTransformVtxAry2I (WlzObject *mObj, int nVtx, WlzIVertex2 *vtx, int nInside, WlzUByte *inside)
 Transforms the vertices in the given integer vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2I(). More...
 
WlzErrorNum WlzCMeshTransformVtxAry3I (WlzObject *mObj, int nVtx, WlzIVertex3 *vtx, int nInside, WlzUByte *inside)
 Transforms the vertices in the given integer vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3I(). More...
 
WlzErrorNum WlzCMeshTransformVtxAry2F (WlzObject *mObj, int nVtx, WlzFVertex2 *vtx, int nInside, WlzUByte *inside)
 Transforms the vertices in the given float vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2F(). More...
 
WlzErrorNum WlzCMeshTransformVtxAry3F (WlzObject *mObj, int nVtx, WlzFVertex3 *vtx, int nInside, WlzUByte *inside)
 Transforms the vertices in the given float vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3F(). More...
 
WlzErrorNum WlzCMeshTransformVtxAry2D (WlzObject *mObj, int nVtx, WlzDVertex2 *vtx, int nInside, WlzUByte *inside)
 Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2D(). More...
 
WlzErrorNum WlzCMeshTransformVtxAry2D5 (WlzObject *mObj, int nVtx, WlzDVertex3 *vtx, int nInside, WlzUByte *inside)
 Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2D(). More...
 
WlzErrorNum WlzCMeshTransformVtxAry3D (WlzObject *mObj, int nVtx, WlzDVertex3 *vtx, int nInside, WlzUByte *inside)
 Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3D(). More...
 
WlzObjectWlzCMeshToDomObj (WlzObject *mObj, int trans, double scale, WlzErrorNum *dstErr)
 Computes a new domain object, the domain of which corresponds to the region of space enclosed by the mesh, such that the domain object is covered by the given mesh object. More...
 
WlzObjectWlzCMeshToDomObjValues (WlzObject *dObj, WlzObject *mObj, WlzInterpolationType itp, int ixi, WlzErrorNum *dstErr)
 Given a domain object and a mesh object, this function creates a new domain object using the domain of the given object and a new value table. The function then interpolates the mesh values throughout the domain object. More...
 
WlzObjectWlzCMeshTransformObj (WlzObject *srcObj, WlzObject *mObj, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Applies a conforming mesh transform to the given source object. More...
 
WlzCompoundArrayWlzCMeshTransformManyObjAsIdx (WlzCompoundArray *srcObj, WlzObject *mObj, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Applies a conforming mesh transform to all the domains of the given compound array, in a single pass, by creating an grey valued index object from the domains in the compound array; transforming the grey valued domain object and then extracting the domains from the grey valued index object. Because a conforming mesh transform can be comparatively slow this can reduce the time taken to apply the same transform to multiple domains. However it is assumed that none of the domains intersect. If they do then the domains with higher indices (later in the compound array) will overwrite those with lower indices (earlier in the compound array). In many cases this assumption may be valid, eg in the case of exclusive anatomy domains or gene expression strength domains where each is known to be a subset of the preceding strength domains. Even so the results of this function may not be identical to seperate calls at the boundaries of the domains. To distinguish the domains from the background value it may be useful to make the first object of the given compound array an empty object. More...
 
WlzErrorNum WlzCMeshGetNodesAndEdges (WlzObject *mObj, int *dstNNod, WlzDVertex2 **dstNod, int *dstNDsp, WlzDVertex2 **dstDsp, int *dstNEdg, int **dstEdg)
 Gets the nodes, node displacements and edges of the mesh. The nodes and node displacements are returned as simple arrays of vertices. The edges are returned as a degenerate list of triples, with each triple being the indices of the nodes of an element. More...
 
WlzDBox2 WlzCMeshTransformGetBBox2D (WlzObject *mObj, int trans, WlzErrorNum *dstErr)
 Computes the bounding box of the mesh in the given mesh transform, with or without applying the displacements according to the value of trans. More...
 
WlzDBox3 WlzCMeshTransformGetBBox3D (WlzObject *mObj, int trans, WlzErrorNum *dstErr)
 Computes the bounding box of the mesh in the given mesh transform, with or without applying the displacements according to the value of trans. More...
 
WlzErrorNum WlzScaleCMeshValue (double scale, WlzObject *obj)
 Scales index values pointed of a WoolzObject in place. More...
 
WlzObjectWlzCopyScaleCMeshValue (double scale, WlzObject *obj, WlzErrorNum *dstErr)
 Creates an woolz CMesh transform object indentical with the input object, but with value scaled. More...
 
WlzErrorNum WlzCMeshAffineProduct (WlzObject *trM, WlzAffineTransform *trA, int order)
 Computes the product of the given affine and conforming mesh transforms in place, ie the mesh transform has it's displacements overwritten. More...
 
WlzObjectWlzCMeshMeshMeshProduct (WlzMeshTransform *tr0, WlzMeshTransform *tr1, WlzErrorNum *dstErr)
 Computes the product of the two given (convex) mesh transforms. This is computed within intersection of the two mesh transforms resulting in a conforming mesh transform.

\[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_0}(\mathbf{T_1}(\mathbf{x})) \]

Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output conforming mesh \(\mathbf{T_R}\). The displacements are given in the output conforming transform are given by

\[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_1}(\mathbf{x}) + \mathbf{d_0}(\mathbf{d_1}(\mathbf{x})) - \mathbf{x} \]

. More...

 
WlzObjectWlzCMeshMeshProduct (WlzObject *tr0, WlzMeshTransform *tr1, int order, WlzErrorNum *dstErr)
 Computes the product of the two given (convex) mesh transforms. This is computed within intersection of the two mesh transforms resulting in a conforming mesh transform.

\[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_1}(\mathbf{T_0}(\mathbf{x})) \]

Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output mesh \(\mathbf{T_R}\). The displacements in the output transform are given by

\[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_0}(\mathbf{x}) + \mathbf{d_1}(\mathbf{d_0}(\mathbf{x})) - \mathbf{x} \]

. More...

 
WlzObjectWlzCMeshProduct (WlzObject *tr0, WlzObject *tr1, WlzErrorNum *dstErr)
 Computes the product of the two given (conforming) mesh transforms. This is computed within intersection of the two mesh transforms resulting in another conforming mesh transform.

\[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_1}(\mathbf{T_0}(\mathbf{x})) \]

Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output mesh \(\mathbf{T_R}\). The displacements in the output transform are given by

\[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_0}(\mathbf{x}) + \mathbf{d_1}(\mathbf{d_0}(\mathbf{x})) - \mathbf{x} \]

. More...

 
WlzObjectWlzCMeshExpansion (WlzObject *cObj, int inverse, int method, WlzErrorNum *dstErr)
 Compute the scalar expansion factors for the mesh elements of the given conforming mesh transform. The expansion factors are attached to the elements of the returned conforming mesh object. The expansion factor is defined to be the trace of the strain tensor but in many cases the maximum eigenvalue is a more sensitive feature. More...
 

Detailed Description

Functions for creating and applying 2D and 3D conforming mesh transforms.

Author
Bill Hill
Date
October 2004
Version
Id
e46a8d3abcff4791e07ab59de78d0658fcfb0d8f
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Macro Definition Documentation

#define WLZ_CMESH_POS_DTOI (   X)    ((int )floor(X))

Typedef Documentation