<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none"></DIV></DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi</DIV>
<DIV>&nbsp;</DIV>
<DIV>In Cutter code there is problem </DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><FONT face="Times New Roman">cutter.SetInput(pdb.GetInput())</FONT></DIV>
<DIV><FONT face="Times New Roman">should be</FONT></DIV>
<DIV><FONT face="Times New Roman">cutter.SetInput(pdb.GetOutput())</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><FONT face="Times New Roman">Alex</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV><FONT size=3 face=Calibri></FONT>&nbsp;</DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=zhixiuli@gmail.com 
href="mailto:zhixiuli@gmail.com">zhixiu li</A> </DIV>
<DIV><B>Sent:</B> Wednesday, April 25, 2012 9:35 AM</DIV>
<DIV><B>To:</B> <A title=alexdowson@hotmail.com 
href="mailto:alexdowson@hotmail.com">alex Dowson</A> </DIV>
<DIV><B>Subject:</B> Re: [vtkusers] cutter for vtkGlyph3D</DIV></DIV></DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV class=gmail_extra>Here is my code.<BR>PDB format is a format for protein 
structure.<BR>Basicly it has n atoms and each atom has x.y,z coordinate. It is 
like a network. I attach a pdb file for you~<BR>The visualization of the pdb is 
fine. The only thing is the cutting doesn't work<BR><BR>Thank you very 
much!<BR><BR><BR>&nbsp;<BR>import vtk<BR>import sys<BR>&nbsp;<BR><BR>pdb = 
vtk.vtkPDBReader()<BR>pdb.SetFileName(sys.argv[1])<BR>pdb.SetHBScale(1.0)<BR>pdb.SetBScale(1.0)<BR>pdb.Update()<BR><BR>#create 
a plane to cut,here it cuts in the XZ direction (xz normal=(1,0,0);XY 
=(0,0,1),YZ 
=(0,1,0)<BR>plane=vtk.vtkPlane()<BR>plane.SetOrigin(0,0,0)<BR>plane.SetNormal(10,0,0)<BR>&nbsp;<BR>#create 
cutter<BR>cutter=vtk.vtkCutter()<BR>cutter.SetCutFunction(plane)<BR>cutter.SetInput(pdb.GetInput())<BR>cutter.Update()<BR>cutterMapper=vtk.vtkPolyDataMapper()<BR>cutterMapper.SetInputConnection(cutter.GetOutputPort())<BR>&nbsp;<BR>#create 
plane 
actor<BR>planeActor=vtk.vtkActor()<BR>planeActor.GetProperty().SetColor(1.0,0.8,0)<BR>planeActor.GetProperty().SetLineWidth(2)<BR>planeActor.SetMapper(cutterMapper)<BR>&nbsp;<BR>&nbsp;<BR>#create 
renderers and add actors of plane and cube<BR>ren = 
vtk.vtkRenderer()<BR>ren.AddActor(planeActor)<BR><BR><BR>#creat atom 
sphere<BR>sphere = vtk.vtkSphereSource()<BR>sphere.SetCenter(0, 0, 
0)<BR>sphere.SetRadius(1)<BR>sphere.SetThetaResolution(10)<BR>sphere.SetPhiResolution(10)<BR><BR>glyph 

vtk.vtkGlyph3D()<BR>glyph.SetInputConnection(pdb.GetOutputPort())<BR>glyph.SetOrient(1)<BR>glyph.SetColorMode(1)<BR># 
// 
glyph.ScalingOn()<BR>glyph.SetScaleMode(2)<BR>glyph.SetScaleFactor(.25)<BR>glyph.SetSourceConnection(sphere.GetOutputPort())<BR><BR>atomMapper 

vtk.vtkPolyDataMapper()<BR>atomMapper.SetInputConnection(glyph.GetOutputPort())<BR>atomMapper.ImmediateModeRenderingOn()<BR>atomMapper.UseLookupTableScalarRangeOff()<BR>atomMapper.ScalarVisibilityOn()<BR>atomMapper.SetScalarModeToDefault()<BR><BR>atom 

vtk.vtkLODActor()<BR>atom.SetMapper(atomMapper)<BR>atom.GetProperty().SetRepresentationToSurface()<BR>atom.GetProperty().SetInterpolationToGouraud()<BR>atom.GetProperty().SetAmbient(0.15)<BR>atom.GetProperty().SetDiffuse(0.85)<BR>atom.GetProperty().SetSpecular(0.1)<BR>atom.GetProperty().SetSpecularPower(30)<BR>atom.GetProperty().SetSpecularColor(1, 
1, 
1)<BR>atom.SetNumberOfCloudPoints(30000)<BR>ren.AddActor(atom)<BR><BR><BR>#connection 
between atoms<BR>tube = 
vtk.vtkTubeFilter()<BR>tube.SetInputConnection(pdb.GetOutputPort())<BR>tube.SetNumberOfSides(10)<BR>tube.CappingOff()<BR>tube.SetRadius(0.2)<BR>tube.SetVaryRadius(0)<BR>tube.SetRadiusFactor(10)<BR><BR>bondMapper 

vtk.vtkPolyDataMapper()<BR>bondMapper.SetInputConnection(tube.GetOutputPort())<BR>bondMapper.ImmediateModeRenderingOn()<BR>bondMapper.UseLookupTableScalarRangeOff()<BR>bondMapper.ScalarVisibilityOff()<BR>bondMapper.SetScalarModeToDefault()<BR><BR>bond 

vtk.vtkLODActor()<BR>bond.SetMapper(bondMapper)<BR>bond.GetProperty().SetRepresentationToSurface()<BR>bond.GetProperty().SetInterpolationToGouraud()<BR>bond.GetProperty().SetAmbient(0.15)<BR>bond.GetProperty().SetDiffuse(0.85)<BR>bond.GetProperty().SetSpecular(0.1)<BR>bond.GetProperty().SetSpecularPower(30)<BR>bond.GetProperty().SetSpecularColor(1, 
1, 1)<BR>bond.GetProperty().SetDiffuseColor(1.0000, 0.8941, 
0.70981)<BR><BR>ren.AddActor(bond)<BR><BR>#Add renderer to renderwindow and 
render<BR>renWin = 
vtk.vtkRenderWindow()<BR>renWin.AddRenderer(ren)<BR>renWin.SetSize(600, 
600)<BR>iren = 
vtk.vtkRenderWindowInteractor()<BR>iren.SetRenderWindow(renWin)<BR>ren.SetBackground(0,0,0)<BR>renWin.Render()<BR>iren.Start()<BR><BR><BR>
<DIV class=gmail_quote>On Tue, Apr 24, 2012 at 11:48 PM, alex Dowson <SPAN 
dir=ltr>&lt;<A href="mailto:alexdowson@hotmail.com" 
target=_blank>alexdowson@hotmail.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE 
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
class=gmail_quote>
  <DIV dir=ltr>
  <DIV dir=ltr>
  <DIV style="FONT-FAMILY: 'Calibri'; FONT-SIZE: 12pt">
  <DIV>Hi</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Check you PDBReader FileName path . If is not locating file then output 
  will be empty and you will get this error due to empty output. Also I still 
  donot know</DIV>
  <DIV>what is PDB format so is it triangulated polydata ?</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Alex</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV 
  style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
  <DIV style="FONT: 10pt tahoma">
  <DIV>&nbsp;</DIV>
  <DIV style="BACKGROUND: #f5f5f5">
  <DIV><B>From:</B> <A title=zhixiuli@gmail.com href="mailto:zhixiuli@gmail.com" 
  target=_blank>zhixiu li</A> </DIV>
  <DIV><B>Sent:</B> Wednesday, April 25, 2012 9:14 AM</DIV>
  <DIV><B>To:</B> <A title=alexdowson@hotmail.com 
  href="mailto:alexdowson@hotmail.com" target=_blank>alex Dowson</A> </DIV>
  <DIV>
  <DIV class=h5>
  <DIV><B>Subject:</B> Re: [vtkusers] cutter for 
  vtkGlyph3D</DIV></DIV></DIV></DIV></DIV>
  <DIV>&nbsp;</DIV></DIV>
  <DIV>
  <DIV class=h5>
  <DIV 
  style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
  <DIV class=gmail_extra>Thank you.<BR>But after I tried your method,I got this 
  kind of error:<BR>ERROR: In ..\..\vtk-5.8.0\Filtering\vtkExecutive.cxx, line 
  377<BR>vtkStreamingDemandDrivenPipeline (02B1D470): Attempt to get input 
  information vector from input port index 0 for algorithm 
  vtkPDBReader(02B1D150), which has 0 input ports.<BR><BR>ERROR: In 
  ..\..\vtk-5.8.0\Filtering\vtkExecutive.cxx, line 
  377<BR>vtkStreamingDemandDrivenPipeline (02B1D470): Attempt to get input 
  information vector from input port index 0 for algorithm 
  vtkPDBReader(02B1D150), which has 0 input ports.<BR><BR>ERROR: In 
  ..\..\vtk-5.8.0\Filtering\vtkExecutive.cxx, line 
  377<BR>vtkStreamingDemandDrivenPipeline (02B1D470): Attempt to get input 
  information vector from input port index 0 for algorithm 
  vtkPDBReader(02B1D150), which has 0 input ports.<BR><BR>ERROR: In 
  ..\..\vtk-5.8.0\Filtering\vtkDemandDrivenPipeline.cxx, line 
  727<BR>vtkStreamingDemandDrivenPipeline (02B360A8): Input port 0 of algorithm 
  vtkStructuredGridOutlineFilter(02B24EB0) has 0 connections but is not 
  optional.<BR><BR>ERROR: In 
  ..\..\vtk-5.8.0\Filtering\vtkDemandDrivenPipeline.cxx, line 
  727<BR>vtkStreamingDemandDrivenPipeline (02B33170): Input port 0 of algorithm 
  vtkStructuredGridGeometryFilter(02B32C00) has 0 connections but is not 
  optional.<BR><BR>ERROR: In 
  ..\..\vtk-5.8.0\Filtering\vtkDemandDrivenPipeline.cxx, line 
  727<BR>vtkStreamingDemandDrivenPipeline (02B2FEB8): Input port 0 of algorithm 
  vtkCutter(02B2BE00) has 0 connections but is not optional.<BR><BR>ERROR: In 
  ..\..\vtk-5.8.0\Filtering\vtkDemandDrivenPipeline.cxx, line 
  727<BR>vtkStreamingDemandDrivenPipeline (02B360A8): Input port 0 of algorithm 
  vtkStructuredGridOutlineFilter(02B24EB0) has 0 connections but is not 
  optional.<BR><BR>ERROR: In 
  ..\..\vtk-5.8.0\Filtering\vtkDemandDrivenPipeline.cxx, line 
  727<BR>vtkStreamingDemandDrivenPipeline (02B33170): Input port 0 of algorithm 
  vtkStructuredGridGeometryFilter(02B32C00) has 0 connections but is not 
  optional.<BR><BR>ERROR: In 
  ..\..\vtk-5.8.0\Filtering\vtkDemandDrivenPipeline.cxx, line 
  727<BR>vtkStreamingDemandDrivenPipeline (02B2FEB8): Input port 0 of algorithm 
  vtkCutter(02B2BE00) has 0 connections but is not optional.<BR><BR><BR>
  <DIV class=gmail_quote>On Tue, Apr 24, 2012 at 11:38 PM, alex Dowson <SPAN 
  dir=ltr>&lt;<A href="mailto:alexdowson@hotmail.com" 
  target=_blank>alexdowson@hotmail.com</A>&gt;</SPAN> wrote:<BR>
  <BLOCKQUOTE 
  style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
  class=gmail_quote>
    <DIV dir=ltr>
    <DIV dir=ltr>
    <DIV style="FONT-FAMILY: 'Calibri'; FONT-SIZE: 12pt">
    <DIV>Hi</DIV>
    <DIV>&nbsp;</DIV>
    <DIV>You can try like this</DIV>
    <DIV>&nbsp;</DIV>plane = vtk.vtkPlane()<BR>plane.SetOrigin(0,0,0) 
    <DIV><BR>plane.SetNormal(0.17, 0, 0.9579)<BR>planeCut = 
    vtk.vtkCutter()<BR></DIV>planeCut.SetInput(pdb.GetOutput())<BR>planeCut.SetCutFunction(plane) 

    <DIV 
    style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
    <DIV style="FONT: 10pt tahoma">
    <DIV><FONT size=3 face=Calibri></FONT>&nbsp;</DIV>
    <DIV><FONT size=3 face=Calibri></FONT>&nbsp;</DIV>
    <DIV><FONT size=3 face=Calibri></FONT>&nbsp;</DIV>
    <DIV>&nbsp;</DIV>
    <DIV style="BACKGROUND: #f5f5f5">
    <DIV><B>From:</B> <A title=zhixiuli@gmail.com 
    href="mailto:zhixiuli@gmail.com" target=_blank>zhixiu li</A> </DIV>
    <DIV><B>Sent:</B> Wednesday, April 25, 2012 8:48 AM</DIV>
    <DIV><B>To:</B> <A title=vtkusers@vtk.org href="mailto:vtkusers@vtk.org" 
    target=_blank>vtkusers</A> </DIV>
    <DIV><B>Subject:</B> Re: [vtkusers] cutter for vtkGlyph3D</DIV></DIV></DIV>
    <DIV>&nbsp;</DIV></DIV>
    <DIV 
    style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
    <DIV>
    <DIV>
    <DIV class=gmail_extra>Sorry, I didn't say it clearly.<BR>I read the pdb 
    by<BR>pdb = vtk.vtkPDBReader()<BR>pdb.SetFileName(sys.argv[1])<BR><BR>And I 
    want to cut the pdb by the plain and its cutter<BR><BR>plane = 
    vtk.vtkPlane()<BR>plane.SetOrigin(??????????????????????what should I put in 
    here)<BR>plane.SetNormal(0.17, 0, 0.9579)<BR>planeCut = 
    vtk.vtkCutter()<BR>planeCut.SetInput(????????????????????what should I put 
    in here)<BR>planeCut.SetCutFunction(plane)<BR><BR><BR>Thank you!<BR><BR><BR>
    <DIV class=gmail_quote>On Tue, Apr 24, 2012 at 11:04 PM, zhixiu li <SPAN 
    dir=ltr>&lt;<A href="mailto:zhixiuli@gmail.com" 
    target=_blank>zhixiuli@gmail.com</A>&gt;</SPAN> wrote:<BR>
    <BLOCKQUOTE 
    style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
    class=gmail_quote>Dear ALL,<BR>I have a pdb file and I want to use the 
      pdbreader to read the pdb file. And use use vtkGlyph3D for each atom (each 
      points ) of the pdb. I want to use a plain to cut this pdb and show the 
      cutting plain of the pdb. How do I combine vtkCutter and vtkGlyph3D to 
      achieve the aim? Thank you. <BR></BLOCKQUOTE></DIV>
    <DIV>&nbsp;</DIV></DIV></DIV></DIV>
    <HR>
    _______________________________________________<BR>Powered by <A 
    href="http://www.kitware.com" target=_blank>www.kitware.com</A><BR><BR>Visit 
    other Kitware open-source projects at <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: <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></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV>
  <DIV>&nbsp;</DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV>
<DIV>&nbsp;</DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></BODY></HTML>