Thanks for your help, but your suggestion isn't working for me. Here is a snippet of my code, could you please let me know what I'm doing wrong.<div><br></div><div>Thanks</div><div><br></div><div><div> vtkPlane cutPlane = new vtkPlane();</div>
<div> switch (orientation) {</div><div> case OrthoPanel.ORIENTATION_XY:</div><div> cutPlane.SetNormal(0, 0, 1);</div><div> break;</div><div> case OrthoPanel.ORIENTATION_XZ:</div><div>
cutPlane.SetNormal(0, 1, 0);</div><div> break;</div><div> case OrthoPanel.ORIENTATION_YZ:</div><div> cutPlane.SetNormal(1, 0, 0);</div><div> break;</div><div> }</div>
<div> vtkCutter cutter = new vtkCutter();</div><div><br></div><div> vtkImageData imageData = imageViewer.GetInput();</div><div> double[] bounds = imageData.GetBounds();</div><div> double spacing = imageData.GetSpacing();</div>
<div><br></div><div> cutter.SetInput(organ);</div><div> for (double cutLoc = bounds[0]; cutLoc <= bounds[1]; cutLoc+=spacing[0]) {</div><div> double[] cutOrigin = new double[3];</div><div> cutOrigin[orientation] = cutLoc;</div>
<div> cutPlane.SetOrigin(cutOrigin);</div><div> cutter.SetCutFunction(cutPlane);</div><div> cutter.Update();</div><div><br></div><div> if (cutter.GetOutput().GetNumberOfPoints() == 0)</div><div>
continue;</div><div><br></div><div> vtkStripper stripper = new vtkStripper();</div><div> stripper.SetInputConnection(cutter.GetOutputPort());</div><div> stripper.Update();</div><div> vtkPolyData stripData = stripper.GetOutput();</div>
<div> }</div><br><div class="gmail_quote">On Tue, Nov 2, 2010 at 8:42 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Run vtkStripper on the output of vtkCutter. It will order the<br>
polylines properly.<br>
<div><div></div><div class="h5"><br>
On Tue, Nov 2, 2010 at 9:59 PM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>> wrote:<br>
> I have a 3D vtkPolyData mesh that I wish to convert into 2D<br>
> vtkContourWidgets. The poly data was generated with vtkMarchingCubes3D. My<br>
> process is to run vtkCutter on each slice of the poly data and use that as<br>
> seed data to create my contour widgets. However, when I create my contour<br>
> widgets the points are all out of order. I found the following post that<br>
> seems to be stating what I want to do<br>
> <a href="http://vtk.1045678.n5.nabble.com/question-about-vtkContourWidget-vtkContourRepresentation-td1255118.html#a3247766" target="_blank">http://vtk.1045678.n5.nabble.com/question-about-vtkContourWidget-vtkContourRepresentation-td1255118.html#a3247766</a><br>
> however, this example is written in C++ and I'm working in Java, and there<br>
> doesn't appear to be any vtkCellArray.GetNextCell() method in Java's VTK.<br>
> 1. Is this the solution to my problem?<br>
> 2. If so can someone please translate this code into Java, and if this<br>
> isn't the solution I'm looking for, can someone suggest one?<br>
> Thanks<br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br></div>