Woolz Image Processing  Version 1.8.3
WlzLBTDomain.c File Reference

Functions for creating and manipulating linear binary tree domains. More...

Functions

WlzLBTDomain2DWlzMakeLBTDomain2D (WlzObjectType type, int l1, int ll, int k1, int kl, WlzErrorNum *dstErr)
 Creates a linear binary tree domain without creating any nodes, leaving the nodes pointer NULL. Only the type, bounding box and depth are set. The depth \(d\) is set such that

\[ 2^d >= \max(k_l - k_1, l_l - l_1) + 1 \]

where \(k_1\), \(k_l\), \(l_1\) and \(l_l\) are the first column, last column, first line and last line respectively. More...

 
WlzLBTDomain3DWlzMakeLBTDomain3D (WlzObjectType type, int p1, int pl, int l1, int ll, int k1, int kl, WlzErrorNum *dstErr)
 Creates a linear binary tree domain without creating any nodes, leaving the nodes pointer NULL. Only the type, bounding box and depth are set. The depth \(d\) is set such that

\[ 2^d >= \max(p_l - p_1, k_l - k_1, l_l - l_1) + 1 \]

where \(k_1\), \(k_l\), \(l_1\) and \(l_l\) are the first column, last column, first line and last line respectively. More...

 
WlzErrorNum WlzFreeLBTDomain3D (WlzLBTDomain3D *lDom)
 Frees the given 3D linear binary tree domain. More...
 
WlzErrorNum WlzFreeLBTDomain2D (WlzLBTDomain2D *lDom)
 Frees the given 2D linear binary tree domain. More...
 
WlzDomain WlzLBTDomainFromObj (WlzObject *obj, WlzErrorNum *dstErr)
 Creates a new 2D or 3D linear binary tree domain from the given object's domain. The given object must be either a 2D or 3D domain object. domain. More...
 
WlzLBTDomain2DWlzLBTDomain2DFromDomain (WlzDomain dom, WlzErrorNum *dstErr)
 Creates a new 2D linear binary tree domain from the given domain. More...
 
WlzLBTDomain3DWlzLBTDomain3DFromDomain (WlzDomain dom, WlzErrorNum *dstErr)
 Creates a new 2D linear binary tree domain from the given domain. More...
 
WlzIntervalDomainWlzLBTDomainToIDomain (WlzLBTDomain2D *lDom, WlzErrorNum *dstErr)
 Creates a new interval domain from the given 2D linear binary tree domain. More...
 
WlzPlaneDomainWlzLBTDomainToPDomain (WlzLBTDomain3D *lDom, WlzErrorNum *dstErr)
 Creates a new plane domain from the given 3D linear binary tree domain. More...
 
WlzIntervalDomainWlzIDomainFromPItv2D (int line1, int lastln, int kol1, int lastkl, int nPItv, WlzPartialItv2D *pItv, WlzErrorNum *dstErr)
 Allocates and computes an interval domain from the given table of partial intervals. The given partial intervals must fit within the given domain bounding box. More...
 
WlzPlaneDomainWlzPDomainFromPItv3D (int plane1, int lastpl, int line1, int lastln, int kol1, int lastkl, int nPItv, WlzPartialItv3D *pItv, WlzErrorNum *dstErr)
 Allocates and computes a plane domain from the given table of partial intervals. The given partial intervals must fit within the given domain bounding box. More...
 
WlzLBTDomain3DWlzLBTDomain3DFromPDomain (WlzPlaneDomain *pDom, WlzErrorNum *dstErr)
 Creates a new 3D linear binary tree domain from the given interval domain. More...
 
WlzLBTDomain2DWlzLBTDomain2DFromIDomain (WlzIntervalDomain *iDom, WlzErrorNum *dstErr)
 Creates a new 2D linear binary tree domain from the given interval domain. More...
 
WlzErrorNum WlzLBTBalanceDomain2D (WlzLBTDomain2D *lDom, WlzObject *iObj, int maxSz, int maxBndSz)
 Balances the given LBT domain so that the neighbouring nodes of each node are either of the same size or differ in size by a ratio of 2:1. The function also enforces maximum node size for all nodes and boundary nodes. The neighbour finding algorithm used is quick and simple but it requires an object in which the values are set to the corresponding LBT domain indices. For efficiency an associated interval domain may be given, if the associated domain pointer is NULL then a domain will be computed. More...
 
WlzErrorNum WlzLBTBalanceDomain3D (WlzLBTDomain3D *lDom, WlzObject *iObj, int maxSz, int maxBndSz)
 Balances the given LBT domain so that the neighbouring nodes of each node are either of the same size or differ in size by a ratio of 2:1. The function also enforces maximum node size for all nodes and boundary nodes. The neighbour finding algorithm used is quick and simple but it requires an object in which the values are set to the corresponding LBT domain indices. For efficiency an associated interval domain may be given, if the associated domain pointer is NULL then a domain will be computed. More...
 
WlzObjectWlzLBTMakeNodeIndexObj2D (WlzLBTDomain2D *lDom, WlzIntervalDomain *iDom, WlzErrorNum *dstErr)
 Creates a new 2D domain object with integer values which are the indices of the nodes containing the pixels of the domain. More...
 
WlzObjectWlzLBTMakeNodeIndexObj3D (WlzLBTDomain3D *lDom, WlzPlaneDomain *pDom, WlzErrorNum *dstErr)
 Creates a new 3D domain object with integer values which are the indices of the nodes containing the pixels of the domain. More...
 
WlzErrorNum WlzLBTIndexObjSetAllNodes2D (WlzLBTDomain2D *lDom, WlzObject *iObj)
 Sets all index values in an existing 2D LBT node index object. More...
 
WlzErrorNum WlzLBTIndexObjSetAllNodes3D (WlzLBTDomain3D *lDom, WlzObject *iObj)
 Sets all index values in an existing 3D LBT node index object. More...
 
void WlzLBTClassifyNode2D (WlzLBTDomain2D *lDom, WlzGreyValueWSpace *iGVWSp, int idN, WlzLBTNodeClass2D *dstCls, int *dstRot)
 Classifies the given LBT node by it's connectivity and returns it's class and the counter-clockwise rotation of the basic class pattern in multiples of 90 degrees. More...
 
void WlzLBTClassifyNodeFace3D (WlzLBTDomain3D *lDom, WlzGreyValueWSpace *iGVWSp, int idN, int idF, WlzDVertex3 *vtx, WlzLBTNodeClass2D *dstCls, int *dstRot)
 Classifies the given LBT node's face by it's connectivity and returns it's class and the counter-clockwise rotation of the basic class pattern, when viewed from outside of the node's cube looking at the face, in multiples of 90 degrees. This function uses the face index and orientation system defined in WlzCMeshFromBalLBTDom3D(). More...
 
int WlzLBTCountNodNbrDir2D (WlzLBTDomain2D *lDom, WlzGreyValueWSpace *iGVWSp, int idN, WlzDirection dir)
 Counts the number of neighbours of the given node in the given direction. More...
 
int WlzLBTNodeSz2D (WlzLBTNode2D *nod)
 Computes the size of a 2D linear binary tree node. More...
 
int WlzLBTNodeLogSz2D (WlzLBTNode2D *nod)
 Computes the log (base 2) of the size of a 2D linear binary tree node. More...
 
int WlzLBTNodeSz3D (WlzLBTNode3D *nod)
 Computes the size of a 3D linear binary tree node. More...
 
int WlzLBTNodeLogSz3D (WlzLBTNode3D *nod)
 Computes the log (base 2) of the size of a 3D linear binary tree node. More...
 
void WlzLBTPosToKey3D (WlzIVertex3 pos, unsigned *keys)
 Sets the value of the LBT key for the given position, where the position is relative to the first line and column of the domain. The key is encoded by interleaving the bits of the column coordinate, line coordinate, plane coordinate and term value in that order. The keys are ordered so that bit 0 is least significant. More...
 
void WlzLBTPosToKey2D (WlzIVertex2 pos, unsigned *keys)
 Sets the value of the LBT key for the given position, where the position is relative to the first line and column of the domain. The key is encoded by interleaving the bits of the column coordinate, line coordinate and term value in that order. The keys are ordered so that bit 0 is least significant. More...
 
void WlzLBTGetKeyDigits3D (unsigned *keys, WlzUByte *digits)
 Gets an array of WLZ_LBTDOMAIN_MAXDIGITS location digits from the given 3D keys. More...
 
void WlzLBTGetKeyDigits2D (unsigned *keys, WlzUByte *digits)
 Gets an array of WLZ_LBTDOMAIN_MAXDIGITS location digits from the given 2D keys. More...
 
void WlzLBTKeyToPos3I (unsigned *key, WlzIVertex3 *pos)
 Sets position (relative to the first line and column of the domain) which corresponds to the given 3D LBT key. More...
 
void WlzLBTKeyToPos2I (unsigned *key, WlzIVertex2 *pos)
 Sets position (relative to the first line and column of the domain) which corresponds to the given 3D LBT key. More...
 
void WlzLBTKeyToBox3I (unsigned *key, WlzIBox3 *box)
 Sets bounding box which corresponds to the given 3D LBT key. More...
 
void WlzLBTKeyToBox2I (unsigned *key, WlzIBox2 *box)
 Sets bounding box which corresponds to the given 2D LBT key. More...
 
WlzErrorNum WlzLBTTestOutputNodesTxt (FILE *fP, WlzDomain dom)
 Outputs the nodes of the LBT ask text for testing. More...
 
WlzErrorNum WlzLBTTestOutputNodesVtk (FILE *fP, WlzDomain dom)
 Outputs the nodes of the LBT as VTK polydata for testing. More...
 

Detailed Description

Functions for creating and manipulating linear binary tree domains.

Author
Bill Hill
Date
December 2003
Version
Id
f9735c4615e35ea3a3e6c91682e791317753b46b
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.