[vtkusers] error in using vtkCellLocator::IntersectWithLine

xujf xujf at sjtu.edu.cn
Sat Apr 3 03:37:55 EST 2004


Hi,vtkusers:
   I get an isosurface using vtkImageMarchingCubes,and I get a line using vtklinesource.
I want to get the point of intersection of the isosurface and the line.In order to get
the point of intersection,I use vtkCellLocator::IntersectWithLine.But error is found:
AttributeError:IntersectWithLine.

this is my programe:(written in python)

import sys,os 
from paths import *
from vtkMINCReader import *

reader=vtkMINCReader()
reader.SetFileName("E:/picture/brain.mnc")

filter=vtkImageMarchingCubes()
filter.SetInput(reader.GetOutput())
filter.SetValue(0,1200)

tolerance=100.0

myCellLocator=vtkCellLocator()
myCellLocator.SetDataSet(filter.GetOutput())
myCellLocator.AutomaticOn()
myCellLocator.CacheCellBoundsOn()
myCellLocator.SetTolerance(tolerance)
###myCellLocator.BuildLocator()         ##if I add this sentence in the program,another error will appear:vtkCellLocator:No cell to subdivide

point1=[]
point1.append(0.0)
point1.append(0.0)
point1.append(0.0)

point2=[]
point2.append(100.0)
point2.append(100.0)
point2.append(100.0)

returnState=myCellLocator.IntersectWithLine(point1[0],point1[1],point1[2],
                                            point2[0],point2[1],point2[2],
                                            tolerance,
                                            t,
                                            intersectionPoint,
                                            parametricCoords
                                            subCellID,
                                            cellID)


I don\'t know what\'s wrong with my program?

Best Regards!
xujf
 


More information about the vtkusers mailing list