Eidolon
|
Inherits object.
Public Member Functions | |
def | __init__ (self, filename, position, orientation, dimensions, spacing=(1.0, 1.0), timestep=0, img=None, imgmin=0.0, imgmax=0.0) |
def | calculateDimensions (self) |
def | setShared (self, isShared) |
def | clone (self) |
def | crop (self, minx, miny, maxx, maxy) |
def | resize (self, x, y, fillVal=0) |
def | allocateImg (self, name, isShared=False) |
def | deallocateImg (self) |
def | setArrayImg (self, arr) |
def | setMinMaxValues (self, minv, maxv) |
def | readMinMaxValues (self) |
def | memSize (self) |
def | isParallel (self, otherimg, err=epsilon) |
def | isSameLocation (self, otherimg, err=epsilon) |
def | getDist (self, pos) |
def | getPlaneXi (self, pos) |
def | getPlaneDir (self, pos) |
def | getPlanePos (self, pos, isXiCoord=True, rotate=True) |
def | getPlanePosTransform (self, isXiCoord=True, rotate=True) |
def | getCorners (self) |
def | getRayIntersect (self, ray) |
def | getTransform (self) |
def | setTransform (self, trans) |
def | __str__ (self) |
Public Attributes | |
filename | |
position | |
orientation | |
dimensions | |
spacing | |
timestep | |
img | |
imgmin | |
imgmax | |
dimvec | |
orientinv | |
norm | |
center | |
Represents a loaded image with pixel data stored in a shared RealMatrix object.
def __init__ | ( | self, | |
filename, | |||
position, | |||
orientation, | |||
dimensions, | |||
spacing = (1.0,1.0) , |
|||
timestep = 0 , |
|||
img = None , |
|||
imgmin = 0.0 , |
|||
imgmax = 0.0 |
|||
) |
def __str__ | ( | self | ) |
def allocateImg | ( | self, | |
name, | |||
isShared = False |
|||
) |
def calculateDimensions | ( | self | ) |
Calculates `dimvec', `orientinv', `norm', and `center' from `position' and `orientation'. Call this after changing either of these members.
def clone | ( | self | ) |
def crop | ( | self, | |
minx, | |||
miny, | |||
maxx, | |||
maxy | |||
) |
Crop the image from image index (minx,miny) to (maxx-1,maxy-1) inclusive.
def deallocateImg | ( | self | ) |
def getCorners | ( | self | ) |
def getDist | ( | self, | |
pos | |||
) |
def getPlaneDir | ( | self, | |
pos | |||
) |
Returns the directional vector `pos' as the equivalent direction in plane xi coordinates.
def getPlanePos | ( | self, | |
pos, | |||
isXiCoord = True , |
|||
rotate = True |
|||
) |
Converts a point (plane xi coord if isXiCoord is true, image matrix index otherwise) into a world position.
def getPlanePosTransform | ( | self, | |
isXiCoord = True , |
|||
rotate = True |
|||
) |
def getPlaneXi | ( | self, | |
pos | |||
) |
Converts a vector `pos' into a xi value on the image plane with the result's z value being the distance from the plane, positive values above and negative below. Top left corner is (0,0,0), bottom right (1,1,0).
def getRayIntersect | ( | self, | |
ray | |||
) |
Returns the image xi coordinates of where the ray intersects the image, or None if no intersection.
def getTransform | ( | self | ) |
Get the transformation from unit quad to the image quad in world space.
def isParallel | ( | self, | |
otherimg, | |||
err = epsilon |
|||
) |
Returns True if thsi image is parallel with the image `otherimg'.
def isSameLocation | ( | self, | |
otherimg, | |||
err = epsilon |
|||
) |
def memSize | ( | self | ) |
def readMinMaxValues | ( | self | ) |
def resize | ( | self, | |
x, | |||
y, | |||
fillVal = 0 |
|||
) |
Extend or contract the image by `x' pixels on the left and right and `y' pixels on the top and bottom. This will change the column count by x*2 and row count by y*2.
def setArrayImg | ( | self, | |
arr | |||
) |
def setMinMaxValues | ( | self, | |
minv, | |||
maxv | |||
) |
def setShared | ( | self, | |
isShared | |||
) |
def setTransform | ( | self, | |
trans | |||
) |
Apply the transform object `trans' to this image. The translation component is used as the new position, the voxel size is scaled by the scale component (ie. scale of (1,1,1) preserves voxel size), and the rotational component is used as the orientation.
center |
dimensions |
dimvec |
filename |
img |
imgmax |
imgmin |
norm |
orientation |
orientinv |
position |
spacing |
timestep |