<div dir="ltr">I have a beam passing through the vtkImageData.While I scroll through the ImageData it should cut the beam and display it over the imagedata. Please see the screenshot.Its simply a beam from the x-ray machine.<br>
<br>I was able to cut spheresource and cube source and able to get contours with out this diagonals. But when I try to create it with hexahedron it becomes like this.<br><br>Thanks,<br><br>Jothy<br><br><br><br><div class="gmail_quote">
On Tue, May 18, 2010 at 3:56 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: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
If you don't clip it, you will not see the interior.<br>
<br>
I am still confused about what you are trying to do.<br>
<div><div></div><div class="h5"><br>
<br>
On Tue, May 18, 2010 at 10:41 AM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
> I have tried it earlier. It works fine when you display it as surface. But I<br>
> want to display it as a wireframe , I mean only the outline.So that you can<br>
> see the dose values and ROIs properly.<br>
><br>
> (I wonder, there must be someone on the list from the planning system<br>
> developers, but they keep their mouth tight!).<br>
><br>
> Thanks,<br>
><br>
> Jothy<br>
><br>
> On Tue, May 18, 2010 at 3:26 PM, Scott Johnson <<a href="mailto:Scott.Johnson@neuwave.com">Scott.Johnson@neuwave.com</a>><br>
> wrote:<br>
>><br>
>> Hello Jothy,<br>
>><br>
>><br>
>><br>
>> It looks like the plane is being rendered as wireframe. Try rendering it<br>
>> as a semi-transparent surface to see if it goes away. I’m not sure how to<br>
>> get just the outline.<br>
>><br>
>><br>
>><br>
>> -- Scott<br>
>><br>
>><br>
>><br>
>> From: <a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a> [mailto:<a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a>] On Behalf<br>
>> Of Jothy<br>
>> Sent: Tuesday, May 18, 2010 5:15 AM<br>
>> To: David Doria<br>
>> Cc: VTK<br>
>> Subject: Re: [vtkusers] How to create a cube with vtkPolyData<br>
>><br>
>><br>
>><br>
>> Screenshot is here!<br>
>><br>
>><br>
>> On Tue, May 18, 2010 at 11:12 AM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
>><br>
>> Hi David,<br>
>><br>
>> I tried the vtkHexahedron example. But, when I try to cut this I get a<br>
>> line across the cut plane . see the screenshot and also the code.<br>
>><br>
>> Could you please figure it out?<br>
>><br>
>> from vtk import*<br>
>><br>
>><br>
>> #Setup the coordinates of eight points<br>
>> #(the two faces must be in counter clockwise order as viewd from the<br>
>> outside)<br>
>> P0 = [0.0, 0.0, 0.0];<br>
>> P1 = [1.0, 0.0, 0.0];<br>
>> P2 = [1.0, 1.0, 0.0];<br>
>> P3 = [0.0, 1.0, 0.0];<br>
>> P4 = [0.0, 0.0, 1.0];<br>
>> P5 = [1.0, 0.0, 1.0];<br>
>> P6 = [1.0, 1.0, 1.0];<br>
>> P7 = [0.0, 1.0, 1.0];<br>
>><br>
>><br>
>> #Create the points<br>
>> points = vtkPoints();<br>
>> points.InsertNextPoint(P0);<br>
>> points.InsertNextPoint(P1);<br>
>> points.InsertNextPoint(P2);<br>
>> points.InsertNextPoint(P3);<br>
>> points.InsertNextPoint(P4);<br>
>> points.InsertNextPoint(P5);<br>
>> points.InsertNextPoint(P6);<br>
>> points.InsertNextPoint(P7);<br>
>><br>
>> #Create a hexahedron from the points<br>
>> hexa = vtkHexahedron();<br>
>> hexa.GetPointIds().SetId(0,0);<br>
>> hexa.GetPointIds().SetId(1,1);<br>
>> hexa.GetPointIds().SetId(2,2);<br>
>> hexa.GetPointIds().SetId(3,3);<br>
>> hexa.GetPointIds().SetId(4,4);<br>
>> hexa.GetPointIds().SetId(5,5);<br>
>> hexa.GetPointIds().SetId(6,6);<br>
>> hexa.GetPointIds().SetId(7,7);<br>
>><br>
>> #Add the hexahedron to a cell array<br>
>> hexs = vtkCellArray();<br>
>> hexs.InsertNextCell(hexa);<br>
>><br>
>> #Add the points and hexahedron to an unstructured grid<br>
>> uGrid =vtkUnstructuredGrid();<br>
>> uGrid.SetPoints(points);<br>
>> uGrid.InsertNextCell(hexa.GetCellType(), hexa.GetPointIds());<br>
>> aBeamMapper = vtkDataSetMapper()<br>
>> aBeamMapper.SetInput(uGrid)<br>
>> aBeamActor = vtkActor()<br>
>> aBeamActor.SetMapper(aBeamMapper)<br>
>> aBeamActor.AddPosition(0,0,0)<br>
>> aBeamActor.GetProperty().SetColor(1,1,0)<br>
>> aBeamActor.GetProperty().SetOpacity(0.60)<br>
>> aBeamActor.GetProperty().EdgeVisibilityOn()<br>
>> aBeamActor.GetProperty().SetEdgeColor(1,1,1)<br>
>> aBeamActor.GetProperty().SetLineWidth(1.5)<br>
>><br>
>> #create a plane to cut,here it cuts in the XZ direction (xz<br>
>> normal=(1,0,0);XY =(0,0,1),YZ =(0,1,0)<br>
>> plane=vtkPlane()<br>
>> plane.SetOrigin(0.5,0,0)<br>
>> plane.SetNormal(1,0,0)<br>
>><br>
>> #create cutter<br>
>> cutter=vtkCutter()<br>
>> cutter.SetCutFunction(plane)<br>
>> cutter.SetInput(aBeamActor.GetMapper().GetInput())<br>
>> cutter.Update()<br>
>> cutterMapper=vtkPolyDataMapper()<br>
>> cutterMapper.SetInputConnection( cutter.GetOutputPort())<br>
>><br>
>> #create plane actor<br>
>> planeActor=vtkActor()<br>
>> planeActor.GetProperty().SetColor(1,0.5,0.5)<br>
>> planeActor.GetProperty().SetLineWidth(2)<br>
>> planeActor.SetMapper(cutterMapper)<br>
>><br>
>> # Setup a renderer, render window, and interactor<br>
>> renderer = vtkRenderer()<br>
>> renderWindow = vtkRenderWindow()<br>
>> #renderWindow.SetWindowName("Test")<br>
>><br>
>> renderWindow.AddRenderer(renderer);<br>
>> renderWindowInteractor = vtkRenderWindowInteractor()<br>
>> renderWindowInteractor.SetRenderWindow(renderWindow)<br>
>><br>
>> #Add the actor to the scene<br>
>> renderer.AddActor(aBeamActor)<br>
>> renderer.AddActor(planeActor)<br>
>> renderer.SetBackground(0,0,0) # Background color white<br>
>><br>
>> #Render and interact<br>
>> renderWindow.Render()<br>
>><br>
>><br>
>> I think it has be passed through a filter. But what it's that??<br>
>><br>
>> Thanks,<br>
>><br>
>> Jothy<br>
>><br>
>><br>
>> On Mon, May 17, 2010 at 10:08 PM, David Doria <<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>><br>
>> wrote:<br>
>> > On Mon, May 17, 2010 at 5:03 PM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
>> >> Hi all,<br>
>> >><br>
>> >> I want to create a hexahedron using vtkPolyData. I think there is no<br>
>> >> example in wiki. I created it with a vtkHexaHedron but when I cut it<br>
>> >> it produces a line across the cut section.I don't want this. I am not<br>
>> >> able to solve this problem for many months.I used it passing through<br>
>> >> vtkstripper, vtkTriangle. Finally found that only if the input is of<br>
>> >> vtkPolyData, cutter will not produce that line across the cut section.<br>
>> >> Can some with kind enough :), add an example of how to create cube or<br>
>> >> cone with vtkPoldata.<br>
>> >><br>
>> >> Many thanks,<br>
>> >><br>
>> >> Jothy<br>
>> ><br>
>> > I don't really understand your question. The title and your last<br>
>> > sentence talk about cubes and cones<br>
>> ><br>
>> > <a href="http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Cube" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Cube</a><br>
>> > <a href="http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Display/Cone" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Display/Cone</a><br>
>> ><br>
>> > but the beginning talks about hexahedrons<br>
>> ><br>
>> > <a href="http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Hexahedron" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Hexahedron</a><br>
>> ><br>
>> > Let us know if these links do not help.<br>
>> ><br>
>> > David<br>
>> ><br>
>><br>
>><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<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>
</div></div></blockquote></div><br></div>