Woolz Image Processing Version 1.4.0
WlzIndexObj.c File Reference

Functions for creating and manipulating objects in which 2 or 3D spatial domains are represented as index grey values within in a single domain object. Such objects are frequently refered to as index objects. More...

Functions

WlzObjectWlzIndexObjFromCompound (WlzCompoundArray *cObj, WlzErrorNum *dstErr)
 Creates a new spatial domain object with grey values; the grey values being indices of the domains in the given compound array object.
WlzCompoundArrayWlzIndexObjToCompound (WlzObject *gObj, WlzErrorNum *dstErr)
 Creates a new compound array object in which each object of the array is either an empty object or a spatial domain without grey values. The spatial domain objects will be of the same type as the given object and their domains will correspond those of the grey values of the given object, where the i'th object of the compound object's array will have the domain for which all grey values have the value i. This function can be considered the inverse of WlzIndexObjFromCompound().

Detailed Description

Functions for creating and manipulating objects in which 2 or 3D spatial domains are represented as index grey values within in a single domain object. Such objects are frequently refered to as index objects.

Author:
Bill Hill
Date:
June 2011
Version:
Id:
ce5c32a4adbcc264c4d3f95284375177bc73444e
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.


Function Documentation

WlzObject* WlzIndexObjFromCompound ( WlzCompoundArray cObj,
WlzErrorNum dstErr 
)

Creates a new spatial domain object with grey values; the grey values being indices of the domains in the given compound array object.

Returns:
New spatial domain object with grey values or NULL on error.

The domain of the new object is the union of the domains of the objects in the given compound array object. The values are set so that all values in the domain of the i'th compound array object are set to i, with i incremented from 0 through to one less than the number of objects in the compound array object. If the domains overlap then higher index objects will overwrite lower index objects within their intersection. All objects of the compound array must either be of type WLZ_EMPTY, WLZ_2D_DOMAINOBJ or WLZ_2D_DOMAINOBJ and at least one must be non empty. Any NULL pointer in the compound array will be treated as an empty object. This function can be considered the inverse of WlzIndexObjToCompound().

Parameters:
cObjGiven compound array which must have all ojects valid.
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcMalloc(), _WlzValues::core, _WlzGreyV::inv, _WlzCompoundArray::n, _WlzCompoundArray::o, _WlzGreyV::shv, _WlzPixelV::type, _WlzObject::type, _WlzCompoundArray::type, _WlzGreyV::ubv, _WlzValues::v, _WlzPixelV::v, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_COMPOUND_ARR_1, WLZ_COMPOUND_ARR_2, WLZ_EMPTY_OBJ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WlzAssignObject(), WlzFreeObj(), WlzFreeValueTb(), WlzFreeVoxelValueTb(), WlzGreyMask(), WlzGreyTableType(), WlzMakeMain(), WlzNewValuesVox(), WlzNewValueTb(), and WlzUnionN().

Referenced by WlzCMeshTransformManyObjAsIdx().

WlzCompoundArray* WlzIndexObjToCompound ( WlzObject gObj,
WlzErrorNum dstErr 
)

Creates a new compound array object in which each object of the array is either an empty object or a spatial domain without grey values. The spatial domain objects will be of the same type as the given object and their domains will correspond those of the grey values of the given object, where the i'th object of the compound object's array will have the domain for which all grey values have the value i. This function can be considered the inverse of WlzIndexObjFromCompound().

Returns:
New compound array object or NULL on error.
Parameters:
gObjGiven spatial domain object with grey values. The grey values must be of the type WLZ_GREY_UBYTE, WLZ_GREY_SHORT or WLZ_GREY_INT.
dstErrDestination error pointer, may be NULL.

References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzGreyV::inv, _WlzCompoundArray::o, _WlzPixelV::type, _WlzObject::type, _WlzPixelV::v, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_COMPOUND_ARR_2, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_DATA, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_THRESH_HIGH, WLZ_THRESH_LOW, WlzAssignObject(), WlzFreeObj(), WlzGreyRange(), WlzGreyTypeFromObj(), WlzIsEmpty(), WlzMakeCompoundArray(), WlzMakeEmpty(), WlzMakeMain(), WlzThreshold(), and WlzValueConvertPixel().

Referenced by WlzCMeshTransformManyObjAsIdx().