Woolz Image Processing
Version 1.7.5
|
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 | |
WlzPropertyList * | WlzMakePropertyList (WlzErrorNum *dstErr) |
Makes a new property list with a zero link count and a linked list that has no items. More... | |
WlzSimpleProperty * | WlzMakeSimpleProperty (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... | |
WlzNameProperty * | WlzMakeNameProperty (char *name, WlzErrorNum *dstErr) |
Makes a name property from the given name string which is copied. More... | |
WlzGreyProperty * | WlzMakeGreyProperty (char *name, WlzPixelV val, WlzErrorNum *dstErr) |
Makes a grey value property from the given grey value which is copied. More... | |
WlzTextProperty * | WlzMakeTextProperty (char *name, char *text, WlzErrorNum *dstErr) |
Makes a text property from the given name and text strings which are copied. More... | |
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. 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... | |
WlzNameProperty * | WlzPropertyListContainsName (WlzPropertyList *plist, char *name) |
Finds the name property with the given name string in the given property list. More... | |
#define EMAP_PROPERTY_MODELNAME_LENGTH 32 |
Maximum length of the model name in an EMAP property.
Referenced by WlzChangeEMAPProperty(), WlzMakeEMAPProperty(), WlzReadObj(), and WlzWriteObj().
#define EMAP_PROPERTY_UID_LENGTH 16 |
Maximum length of the model or anatomy UID in an EMAP property.
Referenced by WlzChangeEMAPProperty(), WlzMakeEMAPProperty(), WlzReadObj(), and WlzWriteObj().
#define EMAP_PROPERTY_VERSION_LENGTH 16 |
Maximum length of the version string in an EMAP property.
Referenced by WlzChangeEMAPProperty(), WlzMakeEMAPProperty(), WlzReadObj(), and WlzWriteObj().
#define EMAP_PROPERTY_AUTHORNAME_LENGTH 64 |
Maximum length of the author strings in an EMAP property.
Referenced by WlzMakeEMAPProperty(), WlzReadObj(), and WlzWriteObj().
#define EMAP_PROPERTY_MACHINENAME_LENGTH 64 |
Maximum length of the machine name strings in an EMAP property.
Referenced by WlzMakeEMAPProperty(), WlzReadObj(), and WlzWriteObj().
#define EMAP_PROPERTY_STAGE_LENGTH 32 |
Maximum length of the stage strings in an EMAP property.
Referenced by WlzChangeEMAPProperty(), WlzMakeEMAPProperty(), WlzReadObj(), and WlzWriteObj().
enum _WlzEMAPPropertyType |
Sub types of EMAP properties Typedef: WlzEMAPPropertyType.
WlzPropertyList* WlzMakePropertyList | ( | WlzErrorNum * | dstErr | ) |
Makes a new property list with a zero link count and a linked list that has no items.
dstErr | Destination 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(), WlzDGTensorPDFeature(), WlzDGTensorSDFeature(), WlzEffReadObjNifti(), WlzEffWriteObjAm(), WlzEffWriteObjNrrd(), WlzNObjGreyStats(), and WlzReadObj().
WlzSimpleProperty* WlzMakeSimpleProperty | ( | int | size, |
WlzErrorNum * | dstErr | ||
) |
Allocate space for a WlzSimpleProperty which is a structure with size bytes allocated for data.
size | Size of space allocated for the property. |
dstErr | Destination 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.
Referenced by WlzReadObj().
WlzErrorNum WlzFreeSimpleProperty | ( | WlzSimpleProperty * | prop | ) |
Free space allocated for a WlzSimpleProperty.
prop | property to be freed |
References AlcFree(), AlcFreeStackFree(), _WlzSimpleProperty::freeptr, _WlzSimpleProperty::linkcount, WLZ_ERR_NONE, and WlzUnlink().
Referenced by WlzReadObj().
WlzNameProperty* WlzMakeNameProperty | ( | char * | name, |
WlzErrorNum * | dstErr | ||
) |
Makes a name property from the given name string which is copied.
name | Given name. |
dstErr | Destination 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.
Referenced by WlzCopyPropertyList(), WlzDGTensorPDFeature(), WlzDGTensorSDFeature(), WlzEffReadObjNifti(), WlzEffWriteObjAm(), WlzNObjGreyStats(), and WlzReadObj().
WlzGreyProperty* WlzMakeGreyProperty | ( | char * | name, |
WlzPixelV | val, | ||
WlzErrorNum * | dstErr | ||
) |
Makes a grey value property from the given grey value which is copied.
name | Optional name string, may be NULL. |
val | Given value. |
dstErr | Destination 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.
Referenced by WlzCopyPropertyList(), WlzEffWriteObjAm(), and WlzReadObj().
WlzTextProperty* WlzMakeTextProperty | ( | char * | name, |
char * | text, | ||
WlzErrorNum * | dstErr | ||
) |
Makes a text property from the given name and text strings which are copied.
name | Optional name string, may be NULL. |
text | Given text string. |
dstErr | Destination 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.
Referenced by WlzEffReadObjNifti(), WlzEffWriteObjNrrd(), and WlzReadObj().
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.
type | required EMAP property type: WLZ_EMAP_PROPERTY_GREY_MODEL, WLZ_EMAP_PROPERTY_ANATOMY_DOMAIN or WLZ_EMAP_PROPERTY_OTHER_DOMAIN. |
modelUID | Unique ID for the model (e.g. EMAPM:12345) |
anatomyUID | Unique ID for the anatomy component (e.g. EMAP:12345) |
targetUID | Unique ID to the target model (for transform object). |
targetVersion | Version of the target models |
stage | Model embryonic stage. |
subStage | Model embryonic sub-stage. |
modelName | Standard name for the model. |
version | Model version. |
fileName | Filename when model registered. |
comment | Comment string. |
dstErr | Error return. |
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.
Referenced by WlzCopyPropertyList(), and WlzReadObj().
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.
prop | property to be changed |
type | new type |
modelUID | new model UID |
anatomyUID | new anatomy UID |
targetUID | new target UID |
targetVersion | new target version |
stage | new embryonic stage |
subStage | new embryonic sub-stage |
modelName | new model name |
version | new model version |
fileName | new filename |
comment | new comment |
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.
WlzErrorNum WlzFreeEMAPProperty | ( | WlzEMAPProperty * | prop | ) |
Free an EMAP property.
prop | property to be freed |
References AlcFree(), AlcFreeStackFree(), _WlzEMAPProperty::freeptr, _WlzEMAPProperty::linkcount, WLZ_ERR_NONE, and WlzUnlink().
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.
plist | Property list to search |
type | Property type required |
dstErr | error return values: WLZ_ERR_NONE, WLZ_ERR_PROPERTY_NULL. |
References _WlzProperty::core, _AlcDLPItem::entry, _AlcDLPList::head, _AlcDLPItem::next, WLZ_ERR_NONE, and WLZ_ERR_PROPERTY_NULL.
WlzErrorNum WlzRemoveProperty | ( | AlcDLPList * | plist, |
WlzProperty | prop | ||
) |
Remove, without freeing, a property from a property list. This is typiucally used after a call to WlzGetProperty().
plist | Property list to search |
prop | Property to be removed. |
References AlcDLPItemUnlink(), AlcFree(), _WlzProperty::core, _AlcDLPItem::entry, _AlcDLPList::head, _AlcDLPItem::next, WLZ_ERR_NONE, and WLZ_ERR_PROPERTY_NULL.
WlzErrorNum WlzFreeProperty | ( | WlzProperty | prop | ) |
Free a woolz property.
prop | property to be freed |
References ALC_ER_NONE, AlcFree(), AlcFreeStackFree(), _WlzProperty::core, _WlzCoreProperty::freeptr, _WlzCoreProperty::linkcount, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzUnlink().
Referenced by WlzDGTensorPDFeature(), WlzDGTensorSDFeature(), WlzEffReadObjNifti(), and WlzNObjGreyStats().
WlzErrorNum WlzFreePropertyList | ( | WlzPropertyList * | pList | ) |
Free a complete property list (including the list structure itself).
pList | Property list to be freed. |
References AlcDLPListFree(), AlcFree(), _WlzPropertyList::linkcount, _WlzPropertyList::list, WLZ_ERR_NONE, and WlzUnlink().
Referenced by WlzCopyObject(), WlzCopyPropertyList(), WlzDGTensorPDFeature(), WlzDGTensorSDFeature(), WlzEffReadObjNifti(), WlzEffWriteObjAm(), WlzFreeObj(), and WlzReadObj().
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.
prop | Property to be freed. |
References AlcFree(), AlcFreeStackFree(), _WlzCoreProperty::freeptr, _WlzCoreProperty::linkcount, WLZ_ERR_NONE, and WlzUnlink().
Referenced by WlzCopyPropertyList(), WlzDGTensorPDFeature(), WlzDGTensorSDFeature(), WlzEffReadObjNifti(), WlzEffWriteObjAm(), WlzEffWriteObjNrrd(), WlzNObjGreyStats(), and WlzReadObj().
WlzNameProperty* WlzPropertyListContainsName | ( | WlzPropertyList * | plist, |
char * | name | ||
) |
Finds the name property with the given name string in the given property list.
plist | Given property list. |
name | Name 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().