Woolz Image Processing  Version 1.8.3
WlzProperty

Files

file  WlzMakeProperties.c
 Allocation and freeing routines of properties.
 

Data Structures

struct  _WlzPropertyList
 A property list which has a type, link count and a linked list of properties. More...
 
struct  _WlzCoreProperty
 Core property with sufficient to data to provide the type and enough to allow the property to be freed. Typedef: WlzCoreProperty. More...
 
struct  _WlzSimpleProperty
 A simple property to hold arbitrary length string data. Read and writing then coercing to a structure with numerical values will not be portable. Typedef: WlzSimpleProperty. More...
 
struct  _WlzEMAPProperty
 A property to hold EMAP information to attach to the reference models, anatomy and GE domains. MAPaint and atlas tools will propogate the information as required. Typedef: WlzEMAPProperty. More...
 
struct  _WlzNameProperty
 A simple null terminated ASCII string for the object's name. Typedef: WlzNameProperty. More...
 
struct  _WlzGreyProperty
 A single grey value, which for example might represent the preferred display colour of a binary domain. Typedef: WlzGreyProperty. More...
 
struct  _WlzTextProperty
 A pair of simple null terminated ASCII strings one for the property name and one for it's value. Typedef: WlzTextProperty. More...
 
union  _WlzProperty
 A union of pointers for properties. Typedef: WlzProperty. More...
 

Macros

#define EMAP_PROPERTY_MODELNAME_LENGTH   32
 Maximum length of the model name in an EMAP property. More...
 
#define EMAP_PROPERTY_UID_LENGTH   16
 Maximum length of the model or anatomy UID in an EMAP property. More...
 
#define EMAP_PROPERTY_VERSION_LENGTH   16
 Maximum length of the version string in an EMAP property. More...
 
#define EMAP_PROPERTY_AUTHORNAME_LENGTH   64
 Maximum length of the author strings in an EMAP property. More...
 
#define EMAP_PROPERTY_MACHINENAME_LENGTH   64
 Maximum length of the machine name strings in an EMAP property. More...
 
#define EMAP_PROPERTY_STAGE_LENGTH   32
 Maximum length of the stage strings in an EMAP property. More...
 

Enumerations

enum  _WlzEMAPPropertyType {
  WLZ_EMAP_PROPERTY_GREY_MODEL = 1,
  WLZ_EMAP_PROPERTY_GREY_OTHER,
  WLZ_EMAP_PROPERTY_DOMAIN_ANATOMY,
  WLZ_EMAP_PROPERTY_DOMAIN_OTHER,
  WLZ_EMAP_PROPERTY_TRANSFORM,
  WLZ_EMAP_PROPERTY_DUMMY
}
 Sub types of EMAP properties Typedef: WlzEMAPPropertyType. More...
 

Functions

WlzPropertyListWlzMakePropertyList (WlzErrorNum *dstErr)
 Makes a new property list with a zero link count and a linked list that has no items. More...
 
WlzSimplePropertyWlzMakeSimpleProperty (int size, WlzErrorNum *dstErr)
 Allocate space for a WlzSimpleProperty which is a structure with size bytes allocated for data. More...
 
WlzErrorNum WlzFreeSimpleProperty (WlzSimpleProperty *prop)
 Free space allocated for a WlzSimpleProperty. More...
 
WlzNamePropertyWlzMakeNameProperty (char *name, WlzErrorNum *dstErr)
 Makes a name property from the given name string which is copied. More...
 
WlzGreyPropertyWlzMakeGreyProperty (char *name, WlzPixelV val, WlzErrorNum *dstErr)
 Makes a grey value property from the given grey value which is copied. More...
 
WlzTextPropertyWlzMakeTextProperty (char *name, char *text, WlzErrorNum *dstErr)
 Makes a text property from the given name and text strings which are copied. More...
 
WlzEMAPPropertyWlzMakeEMAPProperty (WlzEMAPPropertyType type, char *modelUID, char *anatomyUID, char *targetUID, char *targetVersion, char *stage, char *subStage, char *modelName, char *version, char *fileName, char *comment, WlzErrorNum *dstErr)
 Make an EMAP property structure. More...
 
WlzErrorNum WlzChangeEMAPProperty (WlzEMAPProperty *prop, WlzEMAPPropertyType type, char *modelUID, char *anatomyUID, char *targetUID, char *targetVersion, char *stage, char *subStage, char *modelName, char *version, char *fileName, char *comment)
 Change the values of an EMAP property. Each given value will be checked against the current value to see if a change is necessary. If the property is changed the modification time and author will be updated. NULL for any of modelName, version, fileName, comment implies no change. To change these please modify directly, updating the modification time appropriately. More...
 
WlzErrorNum WlzFreeEMAPProperty (WlzEMAPProperty *prop)
 Free an EMAP property. More...
 
WlzProperty WlzGetProperty (AlcDLPList *plist, WlzObjectType type, WlzErrorNum *dstErr)
 Get a property of a given type from a property list. It is assumed that there is only one property of a given type in the list. More...
 
WlzErrorNum WlzRemoveProperty (AlcDLPList *plist, WlzProperty prop)
 Remove, without freeing, a property from a property list. This is typiucally used after a call to WlzGetProperty(). More...
 
WlzErrorNum WlzFreeProperty (WlzProperty prop)
 Free a woolz property. More...
 
WlzErrorNum WlzFreePropertyList (WlzPropertyList *pList)
 Free a complete property list (including the list structure itself). More...
 
void WlzFreePropertyListEntry (void *prop)
 Free a property list entry. This is a procedure that can be passed e.g. to AlcDLPListEntryAppend to enable automatic freeing of properties held on a property list. More...
 
WlzNamePropertyWlzPropertyListContainsName (WlzPropertyList *plist, char *name)
 Finds the name property with the given name string in the given property list. More...
 

Detailed Description

Macro Definition Documentation

◆ EMAP_PROPERTY_MODELNAME_LENGTH

#define EMAP_PROPERTY_MODELNAME_LENGTH   32

Maximum length of the model name in an EMAP property.

Referenced by WlzChangeEMAPProperty(), and WlzMakeEMAPProperty().

◆ EMAP_PROPERTY_UID_LENGTH

#define EMAP_PROPERTY_UID_LENGTH   16

Maximum length of the model or anatomy UID in an EMAP property.

Referenced by WlzChangeEMAPProperty(), and WlzMakeEMAPProperty().

◆ EMAP_PROPERTY_VERSION_LENGTH

#define EMAP_PROPERTY_VERSION_LENGTH   16

Maximum length of the version string in an EMAP property.

Referenced by WlzChangeEMAPProperty(), and WlzMakeEMAPProperty().

◆ EMAP_PROPERTY_AUTHORNAME_LENGTH

#define EMAP_PROPERTY_AUTHORNAME_LENGTH   64

Maximum length of the author strings in an EMAP property.

Referenced by WlzMakeEMAPProperty().

◆ EMAP_PROPERTY_MACHINENAME_LENGTH

#define EMAP_PROPERTY_MACHINENAME_LENGTH   64

Maximum length of the machine name strings in an EMAP property.

Referenced by WlzMakeEMAPProperty().

◆ EMAP_PROPERTY_STAGE_LENGTH

#define EMAP_PROPERTY_STAGE_LENGTH   32

Maximum length of the stage strings in an EMAP property.

Referenced by WlzChangeEMAPProperty(), and WlzMakeEMAPProperty().

Enumeration Type Documentation

◆ _WlzEMAPPropertyType

Sub types of EMAP properties Typedef: WlzEMAPPropertyType.

Enumerator
WLZ_EMAP_PROPERTY_GREY_MODEL 

Reference Model

WLZ_EMAP_PROPERTY_GREY_OTHER 

Grey object e.g. derived from model

WLZ_EMAP_PROPERTY_DOMAIN_ANATOMY 

Anatomy Domain

WLZ_EMAP_PROPERTY_DOMAIN_OTHER 

Other Domain

WLZ_EMAP_PROPERTY_TRANSFORM 

woolz transform for EMAP models

WLZ_EMAP_PROPERTY_DUMMY 

Dummy property

Function Documentation

◆ WlzMakePropertyList()

WlzPropertyList* WlzMakePropertyList ( WlzErrorNum dstErr)

Makes a new property list with a zero link count and a linked list that has no items.

Returns
New property list.
Parameters
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcDLPListNew(), AlcFree(), _WlzPropertyList::list, _WlzPropertyList::type, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_PROPERTYLIST.

Referenced by WlzCopyPropertyList().

◆ WlzMakeSimpleProperty()

WlzSimpleProperty* WlzMakeSimpleProperty ( int  size,
WlzErrorNum dstErr 
)

Allocate space for a WlzSimpleProperty which is a structure with size bytes allocated for data.

Returns
New simple property.
Parameters
sizeSize of space allocated for the property.
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcFree(), AlcFreeStackPush(), AlcMalloc(), _WlzSimpleProperty::freeptr, _WlzSimpleProperty::linkcount, _WlzSimpleProperty::prop, _WlzSimpleProperty::size, _WlzSimpleProperty::type, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_PROPERTY_SIMPLE.

◆ WlzFreeSimpleProperty()

WlzErrorNum WlzFreeSimpleProperty ( WlzSimpleProperty prop)

Free space allocated for a WlzSimpleProperty.

Returns
WkzErrorNum
Parameters
propproperty to be freed
Source:
WlzMakeProperties.c

References AlcFree(), AlcFreeStackFree(), _WlzSimpleProperty::freeptr, _WlzSimpleProperty::linkcount, WLZ_ERR_NONE, and WlzUnlink().

◆ WlzMakeNameProperty()

WlzNameProperty* WlzMakeNameProperty ( char *  name,
WlzErrorNum dstErr 
)

Makes a name property from the given name string which is copied.

Returns
New name property.
Parameters
nameGiven name.
dstErrDestination pointer for error number, may be NULL.

References AlcCalloc(), AlcFree(), AlcFreeStackPush(), AlcStrDup(), _WlzNameProperty::freeptr, _WlzNameProperty::name, _WlzNameProperty::type, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_PROPERTY_NAME.

◆ WlzMakeGreyProperty()

WlzGreyProperty* WlzMakeGreyProperty ( char *  name,
WlzPixelV  val,
WlzErrorNum dstErr 
)

Makes a grey value property from the given grey value which is copied.

Returns
New grey value property.
Parameters
nameOptional name string, may be NULL.
valGiven value.
dstErrDestination pointer for error number, may be NULL.

References AlcCalloc(), AlcFree(), AlcFreeStackPush(), AlcStrDup(), _WlzGreyProperty::freeptr, _WlzGreyProperty::name, _WlzGreyProperty::type, _WlzGreyProperty::value, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_PROPERTY_GREY.

◆ WlzMakeTextProperty()

WlzTextProperty* WlzMakeTextProperty ( char *  name,
char *  text,
WlzErrorNum dstErr 
)

Makes a text property from the given name and text strings which are copied.

Returns
New text property.
Parameters
nameOptional name string, may be NULL.
textGiven text string.
dstErrDestination pointer for error number, may be NULL.

References AlcCalloc(), AlcFree(), AlcFreeStackPush(), AlcStrDup(), _WlzTextProperty::freeptr, _WlzTextProperty::name, _WlzTextProperty::text, _WlzTextProperty::type, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_PROPERTY_TEXT.

◆ WlzMakeEMAPProperty()

WlzEMAPProperty* WlzMakeEMAPProperty ( WlzEMAPPropertyType  type,
char *  modelUID,
char *  anatomyUID,
char *  targetUID,
char *  targetVersion,
char *  stage,
char *  subStage,
char *  modelName,
char *  version,
char *  fileName,
char *  comment,
WlzErrorNum dstErr 
)

Make an EMAP property structure.

Returns
WlzEMAPProperty
Parameters
typerequired EMAP property type: WLZ_EMAP_PROPERTY_GREY_MODEL, WLZ_EMAP_PROPERTY_ANATOMY_DOMAIN or WLZ_EMAP_PROPERTY_OTHER_DOMAIN.
modelUIDUnique ID for the model (e.g. EMAPM:12345)
anatomyUIDUnique ID for the anatomy component (e.g. EMAP:12345)
targetUIDUnique ID to the target model (for transform object).
targetVersionVersion of the target models
stageModel embryonic stage.
subStageModel embryonic sub-stage.
modelNameStandard name for the model.
versionModel version.
fileNameFilename when model registered.
commentComment string.
dstErrError return.
Source:
WlzMakeProperties.c

References AlcCalloc(), AlcFreeStackPush(), AlcStrDup(), _WlzEMAPProperty::anatomyUID, _WlzEMAPProperty::comment, _WlzEMAPProperty::creationAuthor, _WlzEMAPProperty::creationMachineName, _WlzEMAPProperty::creationTime, EMAP_PROPERTY_AUTHORNAME_LENGTH, EMAP_PROPERTY_MACHINENAME_LENGTH, EMAP_PROPERTY_MODELNAME_LENGTH, EMAP_PROPERTY_STAGE_LENGTH, EMAP_PROPERTY_UID_LENGTH, EMAP_PROPERTY_VERSION_LENGTH, _WlzEMAPProperty::emapType, _WlzEMAPProperty::fileName, _WlzEMAPProperty::freeptr, _WlzEMAPProperty::modelName, _WlzEMAPProperty::modelUID, _WlzEMAPProperty::modificationAuthor, _WlzEMAPProperty::modificationTime, _WlzEMAPProperty::stage, _WlzEMAPProperty::subStage, _WlzEMAPProperty::targetUID, _WlzEMAPProperty::type, _WlzEMAPProperty::version, WLZ_EMAP_PROPERTY_DOMAIN_ANATOMY, WLZ_EMAP_PROPERTY_DOMAIN_OTHER, WLZ_EMAP_PROPERTY_GREY_MODEL, WLZ_EMAP_PROPERTY_GREY_OTHER, WLZ_EMAP_PROPERTY_TRANSFORM, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_UNIMPLEMENTED, and WLZ_PROPERTY_EMAP.

◆ WlzChangeEMAPProperty()

WlzErrorNum WlzChangeEMAPProperty ( WlzEMAPProperty prop,
WlzEMAPPropertyType  type,
char *  modelUID,
char *  anatomyUID,
char *  targetUID,
char *  targetVersion,
char *  stage,
char *  subStage,
char *  modelName,
char *  version,
char *  fileName,
char *  comment 
)

Change the values of an EMAP property. Each given value will be checked against the current value to see if a change is necessary. If the property is changed the modification time and author will be updated. NULL for any of modelName, version, fileName, comment implies no change. To change these please modify directly, updating the modification time appropriately.

Returns
woolz error
Parameters
propproperty to be changed
typenew type
modelUIDnew model UID
anatomyUIDnew anatomy UID
targetUIDnew target UID
targetVersionnew target version
stagenew embryonic stage
subStagenew embryonic sub-stage
modelNamenew model name
versionnew model version
fileNamenew filename
commentnew comment
Source:
WlzMakeProperties.c

References AlcFreeStackPush(), AlcStrDup(), _WlzEMAPProperty::anatomyUID, _WlzEMAPProperty::comment, EMAP_PROPERTY_MODELNAME_LENGTH, EMAP_PROPERTY_STAGE_LENGTH, EMAP_PROPERTY_UID_LENGTH, EMAP_PROPERTY_VERSION_LENGTH, _WlzEMAPProperty::emapType, _WlzEMAPProperty::fileName, _WlzEMAPProperty::freeptr, _WlzEMAPProperty::modelName, _WlzEMAPProperty::modelUID, _WlzEMAPProperty::modificationAuthor, _WlzEMAPProperty::modificationTime, _WlzEMAPProperty::stage, _WlzEMAPProperty::subStage, _WlzEMAPProperty::targetUID, _WlzEMAPProperty::targetVersion, _WlzEMAPProperty::type, _WlzEMAPProperty::version, WLZ_EMAP_PROPERTY_DOMAIN_ANATOMY, WLZ_EMAP_PROPERTY_DOMAIN_OTHER, WLZ_EMAP_PROPERTY_GREY_MODEL, WLZ_EMAP_PROPERTY_GREY_OTHER, WLZ_EMAP_PROPERTY_TRANSFORM, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PROPERTY_NULL, WLZ_ERR_PROPERTY_TYPE, WLZ_ERR_UNIMPLEMENTED, and WLZ_PROPERTY_EMAP.

◆ WlzFreeEMAPProperty()

WlzErrorNum WlzFreeEMAPProperty ( WlzEMAPProperty prop)

Free an EMAP property.

Returns
woolz error number values: WLZ_ERR_NONE
Parameters
propproperty to be freed
Source:
WlzMakeProperties.c

References AlcFree(), AlcFreeStackFree(), _WlzEMAPProperty::freeptr, _WlzEMAPProperty::linkcount, WLZ_ERR_NONE, and WlzUnlink().

◆ WlzGetProperty()

WlzProperty WlzGetProperty ( AlcDLPList plist,
WlzObjectType  type,
WlzErrorNum dstErr 
)

Get a property of a given type from a property list. It is assumed that there is only one property of a given type in the list.

Returns
The required property. If the core value is NULL the requested property is not in the list.
Parameters
plistProperty list to search
typeProperty type required
dstErrerror return values: WLZ_ERR_NONE, WLZ_ERR_PROPERTY_NULL.
Source:
WlzMakeProperties.c

References _WlzProperty::core, _AlcDLPItem::entry, _AlcDLPList::head, _AlcDLPItem::next, WLZ_ERR_NONE, and WLZ_ERR_PROPERTY_NULL.

◆ WlzRemoveProperty()

WlzErrorNum WlzRemoveProperty ( AlcDLPList plist,
WlzProperty  prop 
)

Remove, without freeing, a property from a property list. This is typiucally used after a call to WlzGetProperty().

Returns
woolz error values: WLZ_ERR_NONE
Parameters
plistProperty list to search
propProperty to be removed.
Source:
WlzMakeProperties.c

References AlcDLPItemUnlink(), AlcFree(), _WlzProperty::core, _AlcDLPItem::entry, _AlcDLPList::head, _AlcDLPItem::next, WLZ_ERR_NONE, and WLZ_ERR_PROPERTY_NULL.

◆ WlzFreeProperty()

WlzErrorNum WlzFreeProperty ( WlzProperty  prop)

Free a woolz property.

Returns
wooz error values: WLZ_ERR_NONE, WLZ_ERR_MEM_ALLOC.
Parameters
propproperty to be freed
Source:
WlzMakeProperties.c

References ALC_ER_NONE, AlcFree(), AlcFreeStackFree(), _WlzProperty::core, _WlzCoreProperty::freeptr, _WlzCoreProperty::linkcount, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzUnlink().

◆ WlzFreePropertyList()

WlzErrorNum WlzFreePropertyList ( WlzPropertyList pList)

Free a complete property list (including the list structure itself).

Returns
Woolz error code.
Parameters
pListProperty list to be freed.

References AlcDLPListFree(), AlcFree(), _WlzPropertyList::linkcount, _WlzPropertyList::list, WLZ_ERR_NONE, and WlzUnlink().

Referenced by WlzCopyObject(), and WlzFreeObj().

◆ WlzFreePropertyListEntry()

void WlzFreePropertyListEntry ( void *  prop)

Free a property list entry. This is a procedure that can be passed e.g. to AlcDLPListEntryAppend to enable automatic freeing of properties held on a property list.

Parameters
propProperty to be freed.

References AlcFree(), AlcFreeStackFree(), _WlzCoreProperty::freeptr, _WlzCoreProperty::linkcount, WLZ_ERR_NONE, and WlzUnlink().

◆ WlzPropertyListContainsName()

WlzNameProperty* WlzPropertyListContainsName ( WlzPropertyList plist,
char *  name 
)

Finds the name property with the given name string in the given property list.

Returns
Pointer to the name property in the given property list which contains matches the given name string or NULL if there is no matching name property,
Parameters
plistGiven property list.
nameName string to be matched, or if NULL the first name property found.

References _AlcDLPItem::entry, _AlcDLPList::head, _WlzPropertyList::list, _WlzNameProperty::name, _AlcDLPItem::next, _WlzNameProperty::type, and WLZ_PROPERTY_NAME.

Referenced by WlzEffWritePointsVtkFieldValues(), and WlzEffWritePointsVtkScalarValues().