Eidolon
Public Member Functions | Public Attributes | List of all members
SharedImage Class Reference

Inherits object.

Collaboration diagram for SharedImage:
Collaboration graph

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
 

Detailed Description

Represents a loaded image with pixel data stored in a shared RealMatrix object.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  filename,
  position,
  orientation,
  dimensions,
  spacing = (1.0,1.0),
  timestep = 0,
  img = None,
  imgmin = 0.0,
  imgmax = 0.0 
)

Member Function Documentation

◆ __str__()

def __str__ (   self)

◆ allocateImg()

def allocateImg (   self,
  name,
  isShared = False 
)

◆ calculateDimensions()

def calculateDimensions (   self)
Calculates `dimvec', `orientinv', `norm', and `center' from `position' and `orientation'. Call this after
changing either of these members.
Here is the caller graph for this function:

◆ clone()

def clone (   self)

◆ crop()

def crop (   self,
  minx,
  miny,
  maxx,
  maxy 
)
Crop the image from image index (minx,miny) to (maxx-1,maxy-1) inclusive.
Here is the call graph for this function:

◆ deallocateImg()

def deallocateImg (   self)

◆ getCorners()

def getCorners (   self)

◆ getDist()

def getDist (   self,
  pos 
)

◆ getPlaneDir()

def getPlaneDir (   self,
  pos 
)
Returns the directional vector `pos' as the equivalent direction in plane xi coordinates.

◆ getPlanePos()

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.
Here is the caller graph for this function:

◆ getPlanePosTransform()

def getPlanePosTransform (   self,
  isXiCoord = True,
  rotate = True 
)

◆ getPlaneXi()

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).
Here is the caller graph for this function:

◆ getRayIntersect()

def getRayIntersect (   self,
  ray 
)
Returns the image xi coordinates of where the ray intersects the image, or None if no intersection.
Here is the call graph for this function:

◆ getTransform()

def getTransform (   self)
Get the transformation from unit quad to the image quad in world space.
Here is the caller graph for this function:

◆ isParallel()

def isParallel (   self,
  otherimg,
  err = epsilon 
)
Returns True if thsi image is parallel with the image `otherimg'.
Here is the caller graph for this function:

◆ isSameLocation()

def isSameLocation (   self,
  otherimg,
  err = epsilon 
)
Here is the call graph for this function:

◆ memSize()

def memSize (   self)

◆ readMinMaxValues()

def readMinMaxValues (   self)

◆ resize()

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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setArrayImg()

def setArrayImg (   self,
  arr 
)
Here is the call graph for this function:

◆ setMinMaxValues()

def setMinMaxValues (   self,
  minv,
  maxv 
)
Here is the caller graph for this function:

◆ setShared()

def setShared (   self,
  isShared 
)

◆ setTransform()

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.
Here is the call graph for this function:

Member Data Documentation

◆ center

center

◆ dimensions

dimensions

◆ dimvec

dimvec

◆ filename

filename

◆ img

img

◆ imgmax

imgmax

◆ imgmin

imgmin

◆ norm

norm

◆ orientation

orientation

◆ orientinv

orientinv

◆ position

position

◆ spacing

spacing

◆ timestep

timestep

The documentation for this class was generated from the following file: