Package bar :: Module parsers :: Class barVectorParser
[hide private]
[frames] | no frames]

Class barVectorParser


Class for creating CAF datasets from contour slides and created index. Following minimal data and code has to be provided:

  1. Provide: rendering renderingProperties, potraceProperties, tracerSettings, filenameTempates, indexerProps, slideRange, colorMapping.
  2. Subclass of barVectorParser with overriden __init__, parseAll methods.

Most useful information is provided in exemplary parsers.


Note: filenameTemplates attribute has to have pretraced slide name template

Instance Methods [hide private]
 
__init__(self, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
None
parseAll(self)
Performs tracing of all slides enumerated in self.slideRange.
barTracedSlideRenderer
parse(self, slideNumber, useIndexer=True, writeSlide=True, writeContourBack=True)
Returns: Traced slide with given slideNumber.
str
_getInputFilename(self, slideNumber, version=0)
Returns: Path to contour slide with given number

Inherited from barGenericParser: RGBToHTMLColor, getProperty, parseRange, reindex, setProperty, writeIndex

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

Class Variables [hide private]
list _requiredInternalData = ['outputDirectory', 'filenameTemplates...
Required instance attributtes.
Instance Variables [hide private]
str inputDirectory
Path to directory with contour slides.
dict structureColours
Dictionary holding structure abbreviations (keys) and translating them into path colous in CAF traced file (values).

Inherited from barGenericParser: filenameTemplates, outputDirectory, renderingProperties, slideRange, tracingProperties

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

 

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

Overrides: object.__init__
(inherited documentation)

parseAll(self)

 

Performs tracing of all slides enumerated in self.slideRange. Should be customized in each parser. Has the same effect as parseRange(slideRange[0],slideRange[-1]).

Returns: None
None
Overrides: barGenericParser.parseAll
(inherited documentation)

parse(self, slideNumber, useIndexer=True, writeSlide=True, writeContourBack=True)

 
Parameters:
  • slideNumber - Number of slide to parse
Returns: barTracedSlideRenderer
Traced slide with given slideNumber.

Performs all operation related to creating CAF slide from souce data. Should be customized in each parser.

Overrides: barGenericParser.parse
(inherited documentation)

_getInputFilename(self, slideNumber, version=0)

 
Parameters:
  • slideNumber (int) - number of contour slide for which path will be generated.
Returns: str
Path to contour slide with given number

Class Variable Details [hide private]

_requiredInternalData

Required instance attributtes. Without prividing them parsing cannot be invoked. Meaning of each attribute is explained below.
Type:
list
Value:
['outputDirectory',
 'filenameTemplates',
 'slideRange',
 'tracingProperties',
 'renderingProperties',
 'structureColours',
 'inputDirectory']

Instance Variable Details [hide private]

inputDirectory

Path to directory with contour slides. Number of contour slides has to be the same as lenght of the slideRange property.
Type:
str