Class of objects representing whole CAF dataset index.
The class provides also methods to create CAF dataset index de
novo.
It is assumed that structure names are unique and it is not necessary
to introduce another uniqe ID. However, a kind of UID (unique ID) is
introduced inside the index. The UID is used to create complex structure
hierarchy.
Please note that this class operates in two ways when creating CAF
dataset index:
|
__addGroup(self,
group,
parent=None)
Parse the hierarchy group (sub)tree and update self._hierarchyGroups
according to information in the tree nodes; update information about
parental nodes in the nodes of the tree. |
|
|
|
__fromXML(cls,
sourceXMLElement) |
|
|
int
|
__getGID(self)
Returns:
value of the next element of the GID sequence |
|
|
{str : barIndexerPropertyElement}
|
__getProperty(self)
Returns:
CAF dataset index property name to 'property' element representation
mapping |
|
|
{int : barIndexerSlideElement}
|
__getSlides(self)
Returns:
slidenumber to 'slide' element representation mapping |
|
|
{str : barIndexerStructureElement}
|
__getStructures(self)
Returns:
name to 'structure' element representation mapping |
|
|
int
|
__getUID(self)
Returns:
value of the next element of the UID sequence |
|
|
{str : [int, ...]}
|
__getUidList(self)
For each of hierarchy groups find UIDs of structures assigned to it. |
|
|
|
|
|
__init__(self,
hierarchyRootElementName=' Brain ' )
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
__normaliseIDs(self)
Normalise ID and UID of groups and structures. |
|
|
|
__setGID(self,
val)
Increase the value of the current element of the GID sequence. |
|
|
|
__setProperty(self,
newValue)
Raise ValueError. |
|
|
|
__setSlides(self,
newValue)
Raise ValueError. |
|
|
|
__setStructures(self,
newValue)
Raise ValueError. |
|
|
|
__setUID(self,
val)
Increase the value of the current element of the UID sequence. |
|
|
|
__setUidList(self,
newList)
Raise ValueError. |
|
|
|
|
|
clearProperties(self)
Remove all CAF dataset index properties. |
|
|
|
fixOrphanStructures(self,
parentGrpName=None)
Search for structures not covered by hierarchy, then bind them to the
requested hierarchy group. |
|
|
xml.dom.Document
|
getXMLelement(self)
Returns:
XML representation of represented CAF dataset index |
|
|
|
indexSingleSlide(self,
tracedSlide,
slideNumber)
Register given CAF slide to the CAF dataset index. |
|
|
|
|
|
setParentsFromFile(self,
hierarchyFilename,
childCol=0,
parentCol=1)
Create structure hierarchy according to relation provided in the
file. |
|
|
set([str, ...])
|
unfoldSubtrees(self,
rootStructures,
defaultDepth=0,
leavesOnly=False)
Returns:
names of hierarchy subtree tree nodes related to any structure
present in CAF slides |
|
|
|
updateProperties(self,
propsDict)
Updates properties of the indexer with the data from provided
dictionary. |
|
|
|
|
Inherited from base.barObject :
__str__ ,
getElementById ,
writeXMLtoFile
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|
{str : str}
|
|
|
__setColorMapping(self,
sourceDictionary=None,
dummyElementColor=' #777777 ' )
Assign colours to the hierarchy groups. |
|
|
|
|
{str : str}
|
|
|
__setFullNameMapping(self,
sourceDictionary=None,
dummyNameElement=' ------ ' )
Assign full names to the hierarchy groups. |
|
|
|
|
tuple
|
|
{str : barIndexerGroupElement}
|
|
str
|
__getHierarchyRoot(self)
Returns:
name of the superior group of the CAF dataset structures hierarhy |
|
|
|
__setHierarchy(self,
sourceDictionary)
Create structure hierarchy according to provided relation. |
|
|
|
__setHierarchyGroups(self,
newValue)
Raise ValueError. |
|
|
|
__setHierarchyRoot(self,
hierarchyRootElementName)
Define the name of the superior group of the CAF dataset structures
hierarhy. |
|
|
|
|
|
|
|
|
{str : str}
|
_colorMapping
cached hierarchy group name to colour mapping dictionary
|
int
|
_gid
current value of GID sequence
|
{str : _groupElement, ...}
|
_hierarchyGroups
hierarchy group name to object representing related 'group' element
mapping
|
str
|
_hierarchyRootElementName
name of the superior group of the hierarhy gathering all structures
|
{str : _propertyElement, ...}
|
_properties
CAF dataset property name to object representing related 'property'
element mapping
|
{int : _slideElement, ...}
|
_slides
CAF slide number to object representing related 'slide' element
mapping
|
{str : _structureElement, ...}
|
_structures
structure name to object representing related 'structure' element
mapping
|
int
|
_uid
current value of UID sequence
|
str
|
cafDirectory
path to the directory where the CAF dataset index file is located
|
{str : str}
|
_fullNameMapping
cached hierarchy group name to full name mapping
|