[vtkusers] clip one vtkPolyData with another?

Alle Meije Wink alle_meije at yahoo.co.uk
Sun Feb 19 09:38:28 EST 2006


Returning to an old subject...

I started this thread last month when I tried to make a cut-plane in an
MRI image that (i) shows the grey values inside, and (ii) follows the
contours of the iso-surface that I created from the same data set.

I now have 2 scripts:
One script uses vtkCutter on the 3D data set. This makes it possible to
show the cutplanes with grey values. However, the edges of the cut-plane
are defined via grey value thresholding, resulting in a rough shape that
does not follow the iso-value. (1st attachment, result
http://www.wbic.cam.ac.uk/~amw71/SurfaceCut.png)

Another script has nicer cut-planes, where vtkCutter uses the planes and
the normals of the iso-surface (the clipcow way). The edges now look
much better, but I haven't managed to display the grey values on the
planes. I thought that this should be possible with vtkProbeFilter? I
tried this for one plane, but the only thing that shows up (very
vaguely) is a sort of inner contour (2nd attachment, result:
http://www.wbic.cam.ac.uk/~amw71/SurfaceCut2.png).

The volume that I use is http://www.wbic.cam.ac.uk/~amw71/HeadTemplate.vtk.

Would it be possible to combine the best of the two scripts? Any help on
this would be very welcome!

Best,
Alle Meije Wink

David.Pont at ensisjv.com wrote:
> Alle Meije Wink <alle_meije at yahoo.co.uk> wrote on 31/01/2006 21:59:14:
> 
>>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).
> 
> You were on the right track, clipping with a scalar threshold is what I
> meant.
> 
>>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:
> 
> Is this due to processing of the isosurface after marching cubes? ie
> smoothing etc? If so could you apply the same filters to the output of the
> clipped cut surfaces?
> 
>>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...
> 
> Unfortunately it is not possible to clip with polydata in vtk. There is a
> class named vtkImplicitSelectionLoop that might be worth a try. You would
> cut the isosurface (as you suggested above) with your planes to obtain a
> polyline. Use this with vtkImplicitSelectionLoop->SetLoop and then clip
> your cut surfaces with this 'implicit function'. Actually the geometry
> seems like it would be a bit awkward which may affect accuracy... and you
> may need to use a stripper as in the ClipCow example? The advantage should
> be that the clipper has the exact profile of the clipped brain surface to
> clip the cut planes with.
> 
>   regards
>      Dave P


-- 

  Brain Mapping Unit
  Dept. of Psychiatry
  University of Cambridge
  Downing Site
  Cambridge CB2 3EB

  tel: (+44) (0)1223 764676
  fax: (+44) (0)1223 336581

  alle_meije at yahoo.co.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SurfaceInsideOld.tcl
Type: application/x-tcl
Size: 3909 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060219/e16eef55/attachment.tcl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SurfaceInside.tcl
Type: application/x-tcl
Size: 6193 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060219/e16eef55/attachment-0001.tcl>


More information about the vtkusers mailing list