[vtkusers] error in using vtkCellLocator::IntersectWithLine
Mathieu Malaterre
mathieu.malaterre at kitware.com
Tue Apr 6 08:31:04 EDT 2004
xujf wrote:
>>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
>
Xujf,
I am sorry, could you please resend me your sample python code ? I
delete your mail and the archive is not able to parse your mails:
http://vtk.org/pipermail/vtkusers/2004-April/023464.html
Mathieu
More information about the vtkusers
mailing list