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

Class barPretracedSlide


Class of objects representing countur slides.

Nested Classes [hide private]
Instance Methods [hide private]
 
__init__(self, slideTemplate='\n<svg baseProfile="full" id="body"\nheight="900"\nwidth="120..., rendererConfiguration={'ReferenceHeight': 900, 'ReferenceWidth': 1200, 'imageSize': ..., tracingConfiguration={'CacheLevel': 5, 'DetectUnlabelled': True, 'DumpDirectory': '..., slideNumber=0)
Class requires providing following properties in order to work properly:
 
__setitem__(self, key, newLabel)
Add label to the slide.
barStructureLabel
__getitem__(self, key)
Returns: label of requested identifier
 
__delitem__(self, key)
Remove label of requested identifier from the slide,
[DOM Object, ... ]
values(self)
Returns list of all svg paths as DOM Objects.
barPretracedSlide
affineTransform(self, M)
Transform the location (in SVG coordinate system) of every label, marker and path in the slide.
 
__affineTransform(self, M)
Transform the location (in SVG coordinate system) of every label, marker and path in the slide.
 
parseMarkers(self)
Transform information contained in slide markers to slide medatata information.
xml.dom.minidom.Document
getXMLelement(self)
Generate XML DOM representation of the object.
 
modifyContours(self, newStrokeWidth=None, newStrokeColour=None)
Modify width and colour of the contours (paths).

Inherited from barSlideRenderer: renderSlide

Inherited from barVectorSlide: Show, addLabel, alignToRefMatrix, deleteLabelByCaption, deleteLabelByID, getCommentLabels, getLabelByName, getRegularLabels, getSpotLabels, renameLabelByCaption, retypeLabelByCaption, srs2svg, svg2srs, updateMetadata

Inherited from barObject: __str__, getElementById, writeXMLtoFile

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

Class Methods [hide private]
cls
fromXML(cls, svgDocument, fixDrawing=False)
Create object representing given SVG slide.
None
_fromXML_LoadPaths(cls, slide, svgdom)
Part of XML parsing subroutine responsible for extracting SVG paths from provided XML element.
None
_fromXML_LoadLabels(cls, slide, svgdom)
Part of XML parsing subroutine responsible for extracting labels and markers from provided XML element.
Static Methods [hide private]

Inherited from barObject (private): _getAttributesDict

Instance Variables [hide private]

Inherited from barVectorSlide: slideNumber, slideTemplate

Inherited from barVectorSlide (private): _labels, _metadata

Properties [hide private]
xml.dom.minidom.Document svgDocument
Generate XML DOM representation of the object.

Inherited from barSlideRenderer: bitmapSize, size

Inherited from barVectorSlide: labelIndex, labels, metadata

Inherited from object: __class__

Method Details [hide private]

__init__(self, slideTemplate='\n<svg baseProfile="full" id="body"\nheight="900"\nwidth="120..., rendererConfiguration={'ReferenceHeight': 900, 'ReferenceWidth': 1200, 'imageSize': ..., tracingConfiguration={'CacheLevel': 5, 'DetectUnlabelled': True, 'DumpDirectory': '..., slideNumber=0)
(Constructor)

 

Class requires providing following properties in order to work properly:

  • rendererConfiguration['ReferenceWidth']: (int) width of SVG drawing
  • rendererConfiguration['ReferenceHeight']: (int) height of SVG drawing
  • rendererConfiguration['imageSize'] : ((int, int)) size (width, height) of resulting bitmap image
Parameters:
  • slideTemplate (str) - SVG slide template
  • rendererConfiguration ({str : ?, ...}) - renderer configuration (see module description for details)
  • tracingConfiguration ({str : ?, ...}) - tracing configuration (see module description for details)
  • slideNumber (int) - slide number
Overrides: object.__init__

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

 

Add label to the slide.

Parameters:
  • key - dummy parameter
  • newLabel (barStructureLabel) - label to be added to the slide

__getitem__(self, key)
(Indexing operator)

 
Parameters:
  • key (str) - label identifier
Returns: barStructureLabel
label of requested identifier

__delitem__(self, key)
(Index deletion operator)

 

Remove label of requested identifier from the slide,

Parameters:
  • key (str) - label identifier

values(self)

 

Returns list of all svg paths as DOM Objects.

Returns: [DOM Object, ... ]
Overrides: barSlideRenderer.values

fromXML(cls, svgDocument, fixDrawing=False)
Class Method

 

Create object representing given SVG slide.

Parameters:
  • svgDocument (xml.dom.minidom.Document or str or file) - SVG slide (DOM XML or filename or file handler)
Returns: cls
created object

_fromXML_LoadPaths(cls, slide, svgdom)
Class Method

 

Part of XML parsing subroutine responsible for extracting SVG paths from provided XML element. This method should be overriden in subclasses if more features are required.

Parameters:
  • slide (barVectorSlide) - Slide to which paths extracted from svgdom will be assigned
  • svgdom (xml.dom.minidom.Document or str or file) - SVG slide (DOM XML or filename or file handler)
Returns: None
None

_fromXML_LoadLabels(cls, slide, svgdom)
Class Method

 

Part of XML parsing subroutine responsible for extracting labels and markers from provided XML element. This method can be overriden in subclasses if more features are required.

Parameters:
  • slide (barVectorSlide) - Slide to which labels extracted from svgdom will be assigned
  • svgdom (xml.dom.minidom.Document or str or file) - SVG slide (DOM XML or filename or file handler)
Returns: None
None

affineTransform(self, M)

 

Transform the location (in SVG coordinate system) of every label, marker and path in the slide.

Parameters:
  • M (numpy 3x3 array) - transformation matrix
Returns: barPretracedSlide
self
Overrides: barVectorSlide.affineTransform

__affineTransform(self, M)

 

Transform the location (in SVG coordinate system) of every label, marker and path in the slide.

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

parseMarkers(self)

 

Transform information contained in slide markers to slide medatata information. Remove markers from the slide.

getXMLelement(self)

 

Generate XML DOM representation of the object.

Returns: xml.dom.minidom.Document
generated XML DOM representation
Overrides: barObject.getXMLelement

To Do: Reimplement this in the nice way

modifyContours(self, newStrokeWidth=None, newStrokeColour=None)

 

Modify width and colour of the contours (paths).

Parameters:
  • newStrokeWidth (float) - new width of contour
  • newStrokeColour (str) - new colour of the contour in hexadecimal format with leading '#'

Property Details [hide private]

svgDocument

Generate XML DOM representation of the object.

Get Method:
getXMLelement(self) - Generate XML DOM representation of the object.
Type:
xml.dom.minidom.Document

To Do: Reimplement this in the nice way