Eidolon
Public Member Functions | Public Attributes | Private Member Functions | List of all members
IRTKPluginMixin Class Reference
Inheritance diagram for IRTKPluginMixin:
Inheritance graph
Collaboration diagram for IRTKPluginMixin:
Collaboration graph

Public Member Functions

def init (self, plugid, win, mgr)
 
def getCWD (self)
 
def getNiftiFile (self, name)
 
def getLogFile (self, name)
 
def getLocalFile (self, name)
 
def getUniqueObjName (self, name)
 
def getTrackingDirs (self, root=None)
 
def addObject (self, obj)
 
def loadNiftiFiles (self, filenames, task)
 
def getUniqueShortName (self, comps, kwargs)
 
def getUniqueLocalFile (self, name)
 
def getServerAddrPort (self)
 
def setServerAddrPort (self, addr, port)
 
def saveToNifti (self, objs, setObjArgs=False)
 
def correctNiftiParams (self, sourceobj, destfile, makeProspective=False)
 
def applyImageDof (self, inname, outname, doffile, cwd, correctNifti=True)
 
def load3DTagSeries (self, tagobj, makeProspective, loadPlanes=False, makeDetag=True, spacing=vec3(1), tryFix=True)
 
def createSegObject (self, srcname, segtype)
 
def createTimeRegStack (self, template, stack, trname=None, loadObject=True)
 
def spatialCorrect (self, target, before, after, prefix, extras=[], xyOnly=True, trans=True, logfile=None, cwd=None)
 
def alignShortStack (self, saxname, segname, templatename=None)
 
def alignIntersectImages (self, volume, intersects, tempDir=None, numIters=1, dilation=5, moveScale=0.1, task=None)
 
def rigidRegisterStack (self, subjectname, rtargetname, htargetname, finalname, doffile, paramfile, correctNifti)
 
def rigidRegisterStackList (self, subjectname, intermedname, targetnames)
 
def readPolyNodes (self, filename)
 
def writePolyNodes (self, filename, nodes)
 
def createImageGrid (self, obj, w, h, d)
 
def createIsotropicObject (self, obj, cropEmpty, spacing=1.0, task=None)
 
def setObjectTimestep (self, objname, start, step, task=None)
 
def invertTimesteps (self, sourceobj)
 
def offsetTimesteps (self, sourceobj, suffix, value, makeProspective=False)
 
def resampleObject (self, srcname, templatename, isIsotropic)
 
def extractTimestepsToObject (self, srcname, indices=None, timesteps=None)
 
def reorderMulticycleImage (self, srcname, starttime, timestep, task)
 
def cropMotionObject (self, srcname, threshold, filtersize, task)
 
def emptyCropObject (self, imgobj, loadObj=True)
 
def refImageCrop (self, imgname, refname, mx, my)
 
def extendImageStack (self, stack, mx=0, my=0, mz=0, value=0)
 
def extendImageObject (self, obj, mx=0, my=0, mz=0, value=0, task=None)
 
def registerImage2D (self, src, tgt, tempDir=None, spacing=10, model='BSplineFFD')
 
def interpolateImages2D (self, im0, im1, numImgs, tempDir=None)
 
def interpolateImageObject (self, obj, numAddedSlices, tempDir=None, task=None)
 
def applyMotionTrack (self, obj_or_name, trackname_or_dir, addObject=True)
 
def applyMotionTrackPoints (self, dirname, pts)
 
def isServerAlive (self, serveraddr=None, serverport=None)
 
def sendServerMsg (self, msg, args=(), buffsize=4096, timeout=10.0, serveraddr=None, serverport=None)
 
def startMotionTrackServer (self, addr=None, port=None)
 
def startMotionTrackJob (self, trackname, maskname, dirname, adaptive, chosenparam)
 
def startGPUNRegMotionTrack (self, imgname, maskname, trackname, paramfile)
 
def startRegisterMotionTrack (self, imgname, maskname, trackname, paramfile, model=None, onefile=False, task=None)
 
def checkMotionTrackJobs (self, jids)
 

Public Attributes

 Nifti
 
 Dicom
 
 Meta
 
 Slice
 
 VTK
 
 CHeart
 
 Plot
 
 Segment
 
 serverdir
 
 irtkdir
 
 fixshort
 
 patient1e4
 
 patient1e6
 
 nreg_default
 
 gpu_nreg_default
 
 exesuffix
 
 irtkpath
 
 spatialcorrect
 
 rreg
 
 motiontrack
 
 gpu_nreg
 
 mirtkdir
 
 ffd_motion
 
 register
 
 info
 
 transimage
 
 transpts
 
 editimage
 
 decimatesurf
 
 convertdof
 
 composedofs
 

Private Member Functions

def _removeNamedObjs (self, names)
 
def _checkProgramTask (self, result)
 

Member Function Documentation

◆ _checkProgramTask()

def _checkProgramTask (   self,
  result 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _removeNamedObjs()

def _removeNamedObjs (   self,
  names 
)
private
Here is the caller graph for this function:

◆ addObject()

def addObject (   self,
  obj 
)
Add an object to the current context (ie. project). If the object is already present, this method should still
succeed but still do the internal bookkeeping operations needed (ie. save the project).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ alignIntersectImages()

def alignIntersectImages (   self,
  volume,
  intersects,
  tempDir = None,
  numIters = 1,
  dilation = 5,
  moveScale = 0.1,
  task = None 
)
Here is the call graph for this function:

◆ alignShortStack()

def alignShortStack (   self,
  saxname,
  segname,
  templatename = None 
)
Here is the call graph for this function:

◆ applyImageDof()

def applyImageDof (   self,
  inname,
  outname,
  doffile,
  cwd,
  correctNifti = True 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyMotionTrack()

def applyMotionTrack (   self,
  obj_or_name,
  trackname_or_dir,
  addObject = True 
)
Apply the motion track data in `trackname_or_dir' to `obj_or_name'. The value `obj_or_name' is either a mesh
or image SceneObject, or the name of one in the current context. The value `trackname_or_dir' is the path
to a directory containing tracking information or the name of one in the current context. If `addObject' is
True then the resulting SceneObject produced by applying the tracking information is added to the current
context. Return value is the time-dependent SceneObject containing the tracking information, or a Future
containing this object if the method was called outside of the task thread.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyMotionTrackPoints()

def applyMotionTrackPoints (   self,
  dirname,
  pts 
)
Simple synchronous method applying the motion track data in `dirname' to the list of vec3 points `pts'.
Returns map of timesteps to motion tracked points at those times. This method blocks while the tracking
is applied to the points so it shouldn't be expected to be instantaneous.
Here is the call graph for this function:

◆ checkMotionTrackJobs()

def checkMotionTrackJobs (   self,
  jids 
)
Here is the call graph for this function:

◆ correctNiftiParams()

def correctNiftiParams (   self,
  sourceobj,
  destfile,
  makeProspective = False 
)
Corrects the parameters in the NIfTI file `destfile' with those in the ImageSceneObject or filename `sourceobj'.
IRTK munges timestep values amongst other things so use this to reset them to what they were in the original.
If `makeProspective' is True then half of the average difference between timesteps is added to each time.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createImageGrid()

def createImageGrid (   self,
  obj,
  w,
  h,
  d 
)
Here is the call graph for this function:

◆ createIsotropicObject()

def createIsotropicObject (   self,
  obj,
  cropEmpty,
  spacing = 1.0,
  task = None 
)
Here is the call graph for this function:

◆ createSegObject()

def createSegObject (   self,
  srcname,
  segtype 
)
Here is the call graph for this function:

◆ createTimeRegStack()

def createTimeRegStack (   self,
  template,
  stack,
  trname = None,
  loadObject = True 
)
Create a new image series by temporally registering `stack' to `template'. This involves selecting timesteps
in `stack' which are closest to the timesteps in `template', then copying the images for these timesteps into
the resulting object. Eg. if `template' has timesteps [0,7] and `stack' has [0,4,6,10], the resulting object
will have 2 timesteps [0,7] whose images are copied from timesteps 0 and 6 in `stack'. This assumes that
`template' has fewer timesteps that `stack'.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cropMotionObject()

def cropMotionObject (   self,
  srcname,
  threshold,
  filtersize,
  task 
)
Here is the call graph for this function:

◆ emptyCropObject()

def emptyCropObject (   self,
  imgobj,
  loadObj = True 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extendImageObject()

def extendImageObject (   self,
  obj,
  mx = 0,
  my = 0,
  mz = 0,
  value = 0,
  task = None 
)
Given image object or name `obj', extend the images by `mx' and `my' and add `mz' images on the above and
below the stack. The new image areas are filled with `value'. This returns a Future containing the object
added to the scene. This differs from extendImageStack() by adding the new object to the scene rather than
just returning it and saving it to a NIfTI file, as well as being implemented as a task method.
Here is the call graph for this function:

◆ extendImageStack()

def extendImageStack (   self,
  stack,
  mx = 0,
  my = 0,
  mz = 0,
  value = 0 
)
Given image stack named by `stack', extend the images by `mx' and `my' and add `mz' images on the above and
below the stack. The new image areas are filled with `value'. This returns the extend object and a list with
the NIfTI filename it was saved to.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractTimestepsToObject()

def extractTimestepsToObject (   self,
  srcname,
  indices = None,
  timesteps = None 
)
Here is the call graph for this function:

◆ getCWD()

def getCWD (   self)
This method must be overridden to return the current working directory (ie. project directory).
Here is the caller graph for this function:

◆ getLocalFile()

def getLocalFile (   self,
  name 
)
Get a file with name `name' in the current context (ie. project directory).
Here is the caller graph for this function:

◆ getLogFile()

def getLogFile (   self,
  name 
)
Get the log file in the current context starting with `name', '.log' is appended to the filename if not already present.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNiftiFile()

def getNiftiFile (   self,
  name 
)
Get the NIfTI file in the current context starting with `name', '.nii' is appended to the filename.
Here is the caller graph for this function:

◆ getServerAddrPort()

def getServerAddrPort (   self)
Returns the server address and port, default is ('localhost',15000).
Here is the caller graph for this function:

◆ getTrackingDirs()

def getTrackingDirs (   self,
  root = None 
)
Returns a list of absolute path directory names in the current context or in `root' containing tracking information.

◆ getUniqueLocalFile()

def getUniqueLocalFile (   self,
  name 
)
Get a version of the filename `name' which is guarranteed to be unique in the current context.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUniqueObjName()

def getUniqueObjName (   self,
  name 
)
Get a unique object name which won't cause files to be overwritten.
Here is the caller graph for this function:

◆ getUniqueShortName()

def getUniqueShortName (   self,
  comps,
  kwargs 
)
Create a name guaranteed to be unique in the current context using the given arguments with createShortName().
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

def init (   self,
  plugid,
  win,
  mgr 
)

◆ interpolateImageObject()

def interpolateImageObject (   self,
  obj,
  numAddedSlices,
  tempDir = None,
  task = None 
)
Here is the call graph for this function:

◆ interpolateImages2D()

def interpolateImages2D (   self,
  im0,
  im1,
  numImgs,
  tempDir = None 
)
Generate an interpolation stack between 2D images `im0` and `im1` with `numImgs' total number of images.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ invertTimesteps()

def invertTimesteps (   self,
  sourceobj 
)
Here is the call graph for this function:

◆ isServerAlive()

def isServerAlive (   self,
  serveraddr = None,
  serverport = None 
)
Attempts to connect to the server, if this fails the server isn't running or isn't accessible so return False.
If `serveraddr' or `serverport' are given, these values are used instead of those given by getServerAddrPort().
Here is the call graph for this function:

◆ load3DTagSeries()

def load3DTagSeries (   self,
  tagobj,
  makeProspective,
  loadPlanes = False,
  makeDetag = True,
  spacing = vec3(1),
  tryFix = True 
)
Load the 3D TAG image series and process it into a time-dependent volume combining the 3 magnitude orientations.
This assumes `tagobj' contains images for 3 orientations in an overlapping volume, with phase and magnitude
volumes for each orientation and timestep. This ignores the phase images which are assumed to have negative
minimum image values, while the magnitude images should have 0 as the minimum value.
Here is the call graph for this function:

◆ loadNiftiFiles()

def loadNiftiFiles (   self,
  filenames,
  task 
)
Loads the given NIfTI file paths. The argument `filenames' can be a list of paths, or a Future returning such
a list. The result value is a Future which eventually will hold the loaded ImageSceneObject instances. Each
loaded file is added to the current context by being passed to addObject().
Here is the call graph for this function:
Here is the caller graph for this function:

◆ offsetTimesteps()

def offsetTimesteps (   self,
  sourceobj,
  suffix,
  value,
  makeProspective = False 
)
Here is the call graph for this function:

◆ readPolyNodes()

def readPolyNodes (   self,
  filename 
)
Here is the caller graph for this function:

◆ refImageCrop()

def refImageCrop (   self,
  imgname,
  refname,
  mx,
  my 
)
Here is the call graph for this function:

◆ registerImage2D()

def registerImage2D (   self,
  src,
  tgt,
  tempDir = None,
  spacing = 10,
  model = 'BSplineFFD' 
)
Register the 2D image `src` to `tgt`, returning the X and Y deformation fields to do so. The `tmpdir` directory 
path is used for temporary information. The `plugin` object is expected to be an IRTK plugin instance. The 
`spacing` value specifies the spacing between control points. The `model` field is either 'BSplineFFD' or 
'Rigid' to specify the deformation model.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reorderMulticycleImage()

def reorderMulticycleImage (   self,
  srcname,
  starttime,
  timestep,
  task 
)
Here is the call graph for this function:

◆ resampleObject()

def resampleObject (   self,
  srcname,
  templatename,
  isIsotropic 
)
Here is the call graph for this function:

◆ rigidRegisterStack()

def rigidRegisterStack (   self,
  subjectname,
  rtargetname,
  htargetname,
  finalname,
  doffile,
  paramfile,
  correctNifti 
)
Determine the rigid registration dof file to register image series `rtargetname' to series `subjectname' then
apply this registration to series `htargetname' to produce series `finalname'. This will create time registered
versions of `subjectname' and/or `rtargetname' as needed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rigidRegisterStackList()

def rigidRegisterStackList (   self,
  subjectname,
  intermedname,
  targetnames 
)
Rigidly register the images in `targetnames' to the image `subjectname'. If `intermedname' is neither "None"
nor None, determine what the deformation is to rreg this to `subjectname' and apply that deformation to the
images in `targetnames'. Otherwise determine the deformation for each image in `targetnames' and apply that
deformation to the image, ie. rreg each image independently using their own image features.
Here is the call graph for this function:

◆ saveToNifti()

def saveToNifti (   self,
  objs,
  setObjArgs = False 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendServerMsg()

def sendServerMsg (   self,
  msg,
  args = (),
  buffsize = 4096,
  timeout = 10.0,
  serveraddr = None,
  serverport = None 
)
Sends a message to a currently running server.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setObjectTimestep()

def setObjectTimestep (   self,
  objname,
  start,
  step,
  task = None 
)
Here is the call graph for this function:

◆ setServerAddrPort()

def setServerAddrPort (   self,
  addr,
  port 
)
Set the server address and port, setting a value as None will keep existing value.
Here is the caller graph for this function:

◆ spatialCorrect()

def spatialCorrect (   self,
  target,
  before,
  after,
  prefix,
  extras = [],
  xyOnly = True,
  trans = True,
  logfile = None,
  cwd = None 
)
Determine the correction for `target'.nii necessary to align the images spatially, then apply this correction
to `before'.nii to produce `after'.nii, also apply the correction to every i in `extras' which produces and
`prefix'`i'.nii for each.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startGPUNRegMotionTrack()

def startGPUNRegMotionTrack (   self,
  imgname,
  maskname,
  trackname,
  paramfile 
)
Here is the call graph for this function:

◆ startMotionTrackJob()

def startMotionTrackJob (   self,
  trackname,
  maskname,
  dirname,
  adaptive,
  chosenparam 
)
Here is the call graph for this function:

◆ startMotionTrackServer()

def startMotionTrackServer (   self,
  addr = None,
  port = None 
)
Starts the server on the local machine if it isn't running and returns the process object, does nothing otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startRegisterMotionTrack()

def startRegisterMotionTrack (   self,
  imgname,
  maskname,
  trackname,
  paramfile,
  model = None,
  onefile = False,
  task = None 
)
Motion tracking using MIRTK register program.
Here is the call graph for this function:

◆ writePolyNodes()

def writePolyNodes (   self,
  filename,
  nodes 
)
Here is the caller graph for this function:

Member Data Documentation

◆ CHeart

CHeart

◆ composedofs

composedofs

◆ convertdof

convertdof

◆ decimatesurf

decimatesurf

◆ Dicom

Dicom

◆ editimage

editimage

◆ exesuffix

exesuffix

◆ ffd_motion

ffd_motion

◆ fixshort

fixshort

◆ gpu_nreg

gpu_nreg

◆ gpu_nreg_default

gpu_nreg_default

◆ info

info

◆ irtkdir

irtkdir

◆ irtkpath

irtkpath

◆ Meta

Meta

◆ mirtkdir

mirtkdir

◆ motiontrack

motiontrack

◆ Nifti

Nifti

◆ nreg_default

nreg_default

◆ patient1e4

patient1e4

◆ patient1e6

patient1e6

◆ Plot

Plot

◆ register

register

◆ rreg

rreg

◆ Segment

Segment

◆ serverdir

serverdir

◆ Slice

Slice

◆ spatialcorrect

spatialcorrect

◆ transimage

transimage

◆ transpts

transpts

◆ VTK

VTK

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