[vtkusers] error in using vtkCellLocator::IntersectWithLine
xujf
xujf at sjtu.edu.cn
Mon Apr 5 21:31:15 EDT 2004
>xujf wrote:
>> 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
>xujf,
> Just after tolerance add:
>
>filter.Update()
>print filter.GetOutput().GetNumberOfCells()
>
>If it is equal to zero you won\'t be able to go any furhter.
>Mathieu
Hi,Mathieu:
Thanks very much for your help.
I add these two sentences in my programe:
filter.Update()
print filter.GetOutput().GetNumberOfCells()
the result is 1839638.it is not zero.
still the sentence in my programe"returnState=myCellLocator.IntersectWithLine(center,point,tolerance,t,intersectionPoint,parametricCoords,subCellID,cellID)"
has an error:
AttributeError :IntersectWithLine
Best Regards!
More information about the vtkusers
mailing list