Package bar :: Module color :: Class barColorIndexer
[hide private]
[frames] | no frames]

Class barColorIndexer


Class enabling automated color assignment basing on provided structure hierarchy.

Nested Classes [hide private]
Instance Methods [hide private]
 
getSpan(self, elem)
Estimate span of spectrum required by a hierarchy element.
 
recolor(self)
Recolor CAF slides by loading and applying new color mapping to each slice.
 
setColors(self, name=None, hSpan=(0.0, 1.0), s=0.0, v=0.4)
Automatically assign colours to the hierarchy groups elements.
 
__setChildColours(self, elem, span, es, ev)
Assign colours to elements of hierarchy tree.

Inherited from atlas_indexer.barIndexer: __init__, clearProperties, fixOrphanStructures, getXMLelement, indexSingleSlide, normaliseIDs, setParentsFromFile, unfoldSubtrees, updateProperties, visibleGroups

Inherited from base.barObject: __str__, getElementById, writeXMLtoFile

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

    color_mappings

Inherited from atlas_indexer.barIndexer: setColorMappingFromFile

    fullname_mappings

Inherited from atlas_indexer.barIndexer: setNameMappingFromFile

    hierarchy

Inherited from atlas_indexer.barIndexer: createFlatHierarchy

Class Methods [hide private]

Inherited from atlas_indexer.barIndexer: fromXML

Static Methods [hide private]

Inherited from atlas_indexer.barIndexer (private): _fromXML

Inherited from base.barObject (private): _getAttributesDict

Class Variables [hide private]
Instance Variables [hide private]

Inherited from atlas_indexer.barIndexer: cafDirectory

    fullname_mappings

Inherited from atlas_indexer.barIndexer (private): _fullNameMapping

Properties [hide private]

Inherited from atlas_indexer.barIndexer: colorMapping, gid, groups, hierarchy, hierarchyRootElementName, properties, slides, structures, uid, uidList

Inherited from object: __class__

    fullname_mappings

Inherited from atlas_indexer.barIndexer: fullNameMapping

Method Details [hide private]

getSpan(self, elem)

 

Estimate span of spectrum required by a hierarchy element.

@param elem: hierarchy element for which spectrum span is estimated
@type elem: C{self.{L{_groupElement}}

@return: estimated spectrum span for element L{elem}.
@rtype: float

recolor(self)

 

Recolor CAF slides by loading and applying new color mapping to each slice.

Returns:
self

setColors(self, name=None, hSpan=(0.0, 1.0), s=0.0, v=0.4)

 

Automatically assign colours to the hierarchy groups elements.

Parameters:
  • name (str) - name of hierarchy tree root element; if not given assumed to be self.hierarchyRootElementName
  • hSpan ((float, float)) - hue span assigned to the hierarchy tree
  • s (float) - saturation of the hierarchy tree root element
  • v (float) - value of the hierarchy tree root element
Returns:
self

Note: Colours are defined in HSV colourspace. Range of accepted values is 0-1.

__setChildColours(self, elem, span, es, ev)

 

Assign colours to elements of hierarchy tree.

@param elem: hierarchy tree
@type elem: C{self.{L{_groupElement}}

@param span: beginningg (included) and end (excluded) of the spectrum
             (hue) span
@type span: (float, float)

@param es: saturation of colour assigned to L{elem} root node
@type ev: float

@param ev: value of colour assigned to L{elem} root node
@type ev: float

@note: Colours are defined in HSV colourspace. Range of accepted
       values is 0-1.