Package bar :: Package rec :: Module structure_holder :: Class structureHolder
[hide private]
[frames] | no frames]

Class structureHolder

Main class for generating and processing slides.

Nested Classes [hide private]
  clsIndexHolder
  clsSlide
barTracedSlide class extension with method necessary to render CAF slide.
Instance Methods [hide private]
 
__init__(self, indexFilename, tracedFilesDirectory)
 
__initializeVolume(self)
Calculates dimenstions, allocates memory of volume and creates vtkStructure for managing defined volume.
 
__defineOriginAndSpacing(self)
Makes some preparations to calculating origin and spacing of volume.
 
__calcOriginAndSpacing(self, (sx, sy, sz), (tx, ty, tz), (w, h), (bx, by, bz))
Calculates origin of volumetric coordinate system and spacing in x,y and z dimensions.
 
__processModelGeneration(self)
Performs all operation related to rasterizing slides and putting this rasterized data into volume:
 
__processSingleSlide(self, slideNumber, (planes, coor))
 
_loadSlide(self, slideNumber, structuresToInclude=None, version=0)
 
__getFlips(self)
 
__flushCache(self)
 
__initModelGeneration(self, xyRes, ignoreBbx=False)
 
_checkEqualSpacing(self, roundoff=5)
 
__getStructureList(self, rootElementName, ignoreBbx=False)
 
handleAllModelGeneration(self, rootElementName, xyRes, zRes, VolumeMargin=10, ignoreBoundingBox=False)
 
getSlidesSpan(self, rootElementName)
 
getDefaultZres(self)
Method Details [hide private]

__initializeVolume(self)

 

Calculates dimenstions, allocates memory of volume and creates vtkStructure for managing defined volume.

Returns:
None.

__defineOriginAndSpacing(self)

 

Makes some preparations to calculating origin and spacing of volume. Actial calculation are performed by __calcOriginAndSpacing function.

Returns:
Origin of vtk volume and spacing between consecitive pixels.

__calcOriginAndSpacing(self, (sx, sy, sz), (tx, ty, tz), (w, h), (bx, by, bz))

 

Calculates origin of volumetric coordinate system and spacing in x,y and z dimensions.

Function takes following arguments:

  1. (sx, sy, sz) - scaling in x,y,z directions. All scaling values has to be positive, otherwise significant error will appear.
  2. (tx, ty, tz) - Reference oordinates of the upper-left image corner in stereotactic coordinate system (ty, tx) and maximum value of bregma coordinate (tz).
  3. (w, h) - width and height if the image.
  4. (bx, by, bz) - bounding box corner calculates in some VERY SPECIAL described elsewhere. If you want to understand it - follow documentation of __defineOriginAndSpacing

Origin of the volumetric coordinate system is located in point where all coordinates have their lowest values. That happens because spacing has to be posivite every coordinate is "more positive" that previous. In such case we start from the lowest coordinate possible.

What do we do in this function:

  1. Define origin of coordinate system in lower left corner (0,h) image coordinates.
  2. Define a scaling and translation matrices taking into account stereotaxic axes direction
  3. Define matrix describing bounding box.
  4. Use all matrices defined above to calculate new origin.
Returns:
((numpy 3x1 array),(3x1)): spatial coordinates of vtk coordinate system origin and spacing in x,y and z directions.

__processModelGeneration(self)

 

Performs all operation related to rasterizing slides and putting this rasterized data into volume:

  1. Define volume
  2. Define indexes of slides that will be parsed
  3. Parse all slides one by one
Returns:
None