parameters: (self,xy)
docstring: calculate the current level trace view if the
      mouse is inside the volume extent
docstring_summary: calculate the current level trace view if the
      mouse is inside the volume extent
docstring_tokens: calculate the current level trace view if the mouse is inside the volume extent
function: def preview(self,xy):
      """calculate the current level trace view if the
      mouse is inside the volume extent"""
      self.xyPoints.Reset()
      backgroundImage = EditUtil.getBackgroundImage()
      ijk = self.logic.backgroundXYToIJK( xy )
      dimensions = backgroundImage.GetDimensions()
      for index in range(3):
        # tracingFilter crashes if it receives a seed point at the edge of the image,
        # so only accept the point if it is inside the image and is at least one pixel away from the edge
        if ijk[index] < 1 or ijk[index] >= dimensions[index]-1:
          return
      self.tracingFilter.SetInputData( EditUtil.getBackgroundImage() )
      self.tracingFilter.SetSeed( ijk )
  
      # select the plane corresponding to current slice orientation
      # for the input volume
      ijkPlane = self.logic.sliceIJKPlane()
      if ijkPlane == 'JK':
        self.tracingFilter.SetPlaneToJK()
      if ijkPlane == 'IK':
        self.tracingFilter.SetPlaneToIK()
      if ijkPlane == 'IJ':
        self.tracingFilter.SetPlaneToIJ()
  
      self.tracingFilter.Update()
      polyData = self.tracingFilter.GetOutput()
  
      backgroundLayer = self.logic.sliceLogic.GetBackgroundLayer()
      self.ijkToXY.DeepCopy( backgroundLayer.GetXYToIJKTransform() )
      self.ijkToXY.Inverse()
      self.ijkToXY.TransformPoints( polyData.GetPoints(), self.xyPoints )
  
      self.polyData.DeepCopy( polyData )
      self.polyData.GetPoints().DeepCopy( self.xyPoints )
      self.sliceView.scheduleRender()
function_tokens: def preview ( self , xy ) : self . xyPoints . Reset ( ) backgroundImage = EditUtil . getBackgroundImage ( ) ijk = self . logic . backgroundXYToIJK ( xy ) dimensions = backgroundImage . GetDimensions ( ) for index in range ( 3 ) : # tracingFilter crashes if it receives a seed point at the edge of the image, # so only accept the point if it is inside the image and is at least one pixel away from the edge if ijk [ index ] < 1 or ijk [ index ] >= dimensions [ index ] - 1 : return self . tracingFilter . SetInputData ( EditUtil . getBackgroundImage ( ) ) self . tracingFilter . SetSeed ( ijk ) # select the plane corresponding to current slice orientation # for the input volume ijkPlane = self . logic . sliceIJKPlane ( ) if ijkPlane == 'JK' : self . tracingFilter . SetPlaneToJK ( ) if ijkPlane == 'IK' : self . tracingFilter . SetPlaneToIK ( ) if ijkPlane == 'IJ' : self . tracingFilter . SetPlaneToIJ ( ) self . tracingFilter . Update ( ) polyData = self . tracingFilter . GetOutput ( ) backgroundLayer = self . logic . sliceLogic . GetBackgroundLayer ( ) self . ijkToXY . DeepCopy ( backgroundLayer . GetXYToIJKTransform ( ) ) self . ijkToXY . Inverse ( ) self . ijkToXY . TransformPoints ( polyData . GetPoints ( ) , self . xyPoints ) self . polyData . DeepCopy ( polyData ) self . polyData . GetPoints ( ) . DeepCopy ( self . xyPoints ) self . sliceView . scheduleRender ( )