[vtkusers] clip one vtkPolyData with another?

Alle Meije Wink alle_meije at yahoo.co.uk
Tue Jan 31 03:59:14 EST 2006


Hi Dave,

Do you mean create a vtkClipPolyData without specifying either a scalar
threshold or an implicit function? I think what happens then is that
vtkClipPolyData provides its own scalar threshold (by the looks of it).

The result that I get now (also using a scalar threshold) is nearly
right, in that it follows the boundary of the segmented brain. It is not
completely right though -the cutp lanes go a little outside the brain-
and the cut of the voxel data is much rougher than the iso-surface:

http://www.wbic.cam.ac.uk/~amw71/SurfaceCut.png

That is why I thought that if you make a contour (either 3D by using the
iso surface or 2D by creating a vtkContourFilter on the cut surfaces) it
wolud be possible to use that for clipping. I tried by making just the
contour(s) and got a completely empty result.

Is it necessary to generate the normals of the contour first (this
happens in the ClipCow example as well) to determine what is inside and
what is outside? Otherwise it is probably something that is not possible
with VTK...

Thanks for your suggestions!

Alle Meije

>  Hi Alle,
>    If I understand correctly you started with a volume (MRI data). In this
> case you might be able to clip your cut surfaces with vtkClipPolydata. I
> have never done this but according to the documentation: "If a ClipFunction
> is not specified, or GenerateClipScalars is off (the default), then the
> input's scalar data will be used to clip the polydata."  Try using
> vtkClipPolyData->SetValue to specify the same value used with marching
> cubes? There is also vtkImplicitDataSet, use the volume as the input data
> set, then use this as the implicit function with vtkClipPolyData. The
> obvious problem I can forsee in either case is that the volume scalar data
> may not be monotonic and clipping may occur at other positions within the
> volume..?
> 
> For the more general problem of clipping polydata with polydata I have also
> seen the GTS library:
> 
> http://gts.sourceforge.net/index.html
> 
>   regards
>     Dave P.
> 
>>Hi Obada,
>>
>>Thanks for you suggestions. I had already read Steve's email, and based
>>on that info I started with a 2d contour:
>>
>>1. make the cut planes with vtkCutter in the usual way
>>    (this generates the cut planes, but they extend to the bounding box)
>>2. make a 2d contour in the cut planes
>>    (this would generate a contour in exactly the same plane
>>     so -hopefully?- avoiding the roundoff errors etc)
>>3. clip the 2D cut surface with the 2D contour
>>
>>Same result...
>>
>>I tried using implicit functions from the iso-surface, the original
>>data, all sorts of contours, etc. but to no avail.
>>
>>I do not really understand your suggestion at the end. Does that do the
>>same thing as I tried with my 2D contour?

		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com



More information about the vtkusers mailing list