Package bar :: Module base :: Class barGenericStructure
[hide private]
[frames] | no frames]

Class barGenericStructure


Class of containers of paths related to one structure.

Nested Classes [hide private]
Instance Methods [hide private]
 
__init__(self, name, color, pathList=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__setitem__(self, key, value)
Add path to the structure.
 
__delitem__(self, key)
Remove path from the structure.
barPath
__getitem__(self, key)
Returns: requested path
 
__str__(self)
An alias for self.getXMLelement().toxml()
int
__len__(self)
Returns: number of paths in the structure
 
updatePaths(self)
Update colour and name of contained paths.
[str, ...]
keys(self)
Returns: contained paths identifiers
[(str, barPath), ...]
items(self)
Returns: (path identifier, path) pairs for contained paths
[barPath, ...]
values(self)
Returns: contained paths
iterator([barPath, ...])
itervalues(self)
Returns: iterator over contained paths
iterator([str, ...])
iterkeys(self)
Returns: iterator over contained paths identifiers
iterator([(str, barPath), ...])
iteritems(self)
Returns: iterator over (path identifier, path) pairs for contained paths
 
_getPaths(self)
An alias for self.values().
str or None
_getFeatureType(self)
Getter for the type property
 
_setFeatureType(self, newFeatureType)
Setter for the type property of the structure.
 
_setStructureName(self, name)
Assign the name of the structure.
str
_getStructureName(self)
Returns: name of the structure
str
_getStructureColor(self)
Returns: colour of the structure in hexadecimal format (with or without the leading '#')
 
_setStructureColor(self, newColor)
Assign the colour of the structure.
(int, int, int, int)
_getBbox(self)
Returns: bounding box (min_x, min_y, max_x, max_y) of the whole structure
 
_setBbox(self, newBBox)
Raise ValueError.
iterator([xml.dom.minidom.Node, ...])
getXMLelement(self)
Returns: iterator over XML DOM representations of contained paths.
 
addPaths(self, *args)
Add paths to the structure.
 
__affineTransform(self, M)
Transform the location of all paths in SVG coordinate system.
 
affineTransform(self, M)
An alias to self.__affineTransform(M).
 
__setCrispEdges(self, boolValue)
Set 'crispEdges' attribute for every path of the structure.
bool
__getCrispEdges(self)
Returns: True if every contained path has crispEdges attribute equal 'crispEdges', False otherwise.

Inherited from barAtlasSlideElement (private): _getTextNodeXMLelement

Inherited from barObject: getElementById, writeXMLtoFile

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

Class Methods [hide private]

Inherited from barAtlasSlideElement: fromXML

Static Methods [hide private]

Inherited from barObject (private): _getAttributesDict

Class Variables [hide private]
Instance Variables [hide private]
str _color
colour of the structure in hexadecimal format (with or without leading '#')
str _name
name of the structure
{str : barPath} _paths
paths related to the structure
Properties [hide private]
str name
string type
Attribute holding type of the feature delineated by given path.
str color
Colour of the structure in hexadecimal format (with or without the leading '#').
(int, int, int, int) bbx
Bounding box (min_x, min_y, max_x, max_y) of the whole structure.
[barPath, ...] paths
Contained paths.
bool crispEdges
The 'crispEdges' attribute of all contained paths.

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, color, pathList=None)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • name (str) - name of the structure
  • color (str) - colour of the structure
  • pathList (sequence([barPath, ...])) - paths to be included in the structure
Overrides: object.__init__

__setitem__(self, key, value)
(Index assignment operator)

 

Add path to the structure.

Parameters:

__delitem__(self, key)
(Index deletion operator)

 

Remove path from the structure.

Parameters:
  • key (str) - path identifier

__getitem__(self, key)
(Indexing operator)

 
Parameters:
  • key (str) - identifier of the requested path
Returns: barPath
requested path

__str__(self)
(Informal representation operator)

 

An alias for self.getXMLelement().toxml()

Overrides: object.__str__
(inherited documentation)

__len__(self)
(Length operator)

 
Returns: int
number of paths in the structure

keys(self)

 
Returns: [str, ...]
contained paths identifiers

items(self)

 
Returns: [(str, barPath), ...]
(path identifier, path) pairs for contained paths

values(self)

 
Returns: [barPath, ...]
contained paths

itervalues(self)

 
Returns: iterator([barPath, ...])
iterator over contained paths

iterkeys(self)

 
Returns: iterator([str, ...])
iterator over contained paths identifiers

iteritems(self)

 
Returns: iterator([(str, barPath), ...])
iterator over (path identifier, path) pairs for contained paths

_getFeatureType(self)

 

Getter for the type property

Returns: str or None
value of the type property

_setFeatureType(self, newFeatureType)

 

Setter for the type property of the structure.

Returns:
None

_setStructureName(self, name)

 

Assign the name of the structure.

Parameters:
  • name (str) - new name of the structure

_getStructureName(self)

 
Returns: str
name of the structure

_getStructureColor(self)

 
Returns: str
colour of the structure in hexadecimal format (with or without the leading '#')

_setStructureColor(self, newColor)

 

Assign the colour of the structure.

Parameters:
  • newColor (str) - new colour of the structure in hexadecimal format (with or without the leading '#')

_getBbox(self)

 
Returns: (int, int, int, int)
bounding box (min_x, min_y, max_x, max_y) of the whole structure

getXMLelement(self)

 

Generate XML DOM representation of the object.

Parameters:
  • useBarNS - determines, if element uses 3dBAR XML namespace
Returns: iterator([xml.dom.minidom.Node, ...])
iterator over XML DOM representations of contained paths.
Overrides: barObject.getXMLelement

addPaths(self, *args)

 

Add paths to the structure.

Parameters:

__affineTransform(self, M)

 

Transform the location of all paths in SVG coordinate system.

Parameters:
  • M (numpy 3x3 array) - transformation matrix

affineTransform(self, M)

 

An alias to self.__affineTransform(M).

Parameters:
  • M - transformation matrix
Overrides: barAtlasSlideElement.affineTransform

__getCrispEdges(self)

 
Returns: bool
True if every contained path has crispEdges attribute equal 'crispEdges', False otherwise.

Property Details [hide private]

name

Get Method:
_getStructureName(self) - Returns: name of the structure
Set Method:
_setStructureName(self, name) - Assign the name of the structure.
Type:
str

type

Attribute holding type of the feature delineated by given path. For example it can be like 'gray matter', 'white matter', 'single cell', 'ventricle', and other... This property would be extended when INCF DAI common metadata set will be well established.

Get Method:
_getFeatureType(self) - Getter for the type property
Set Method:
_setFeatureType(self, newFeatureType) - Setter for the type property of the structure.
Type:
string

color

Colour of the structure in hexadecimal format (with or without the leading '#').

Get Method:
_getStructureColor(self) - Returns: colour of the structure in hexadecimal format (with or without the leading '#')
Set Method:
_setStructureColor(self, newColor) - Assign the colour of the structure.
Type:
str

bbx

Bounding box (min_x, min_y, max_x, max_y) of the whole structure.

Read-only property.

Get Method:
_getBbox(self) - Returns: bounding box (min_x, min_y, max_x, max_y) of the whole structure
Set Method:
_setBbox(self, newBBox) - Raise ValueError.
Type:
(int, int, int, int)

paths

Contained paths.

Read-only property.

Get Method:
_getPaths(self) - An alias for self.values().

crispEdges

The 'crispEdges' attribute of all contained paths. When read True if the value of the attribute of every contained path is 'crispEdges', False otherwise.

Get Method:
__getCrispEdges(self) - Returns: True if every contained path has crispEdges attribute equal 'crispEdges', False otherwise.
Set Method:
__setCrispEdges(self, boolValue) - Set 'crispEdges' attribute for every path of the structure.
Type:
bool