__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:
-
(sx, sy, sz) - scaling in x,y,z directions. All scaling
values has to be positive, otherwise significant error will appear.
-
(tx, ty, tz) - Reference oordinates of the upper-left image corner
in stereotactic coordinate system (ty, tx) and maximum value of
bregma coordinate (tz).
-
(w, h) - width and height if the image.
-
(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:
-
Define origin of coordinate system in lower left corner (0,h) image
coordinates.
-
Define a scaling and translation matrices taking into account
stereotaxic axes direction
-
Define matrix describing bounding box.
-
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.
|