예제 #1
0
    def testReadWrite(self):
        t = '(A:1,B:2,(C:3,D:4)E:5)F;'

        reader = vtk.vtkNewickTreeReader()
        reader.SetReadFromInputString(True)
        reader.SetInputString(t)
        reader.Update()

        writer = vtk.vtkNewickTreeWriter()
        writer.WriteToOutputStringOn()
        writer.SetInputData(reader.GetOutput())
        writer.Update()
        t_return = writer.GetOutputStdString()

        self.assertEqual(t,t_return)
예제 #2
0
    def testReadWrite(self):
        t = '(A:1,B:2,(C:3,D:4)E:5)F;'

        reader = vtk.vtkNewickTreeReader()
        reader.SetReadFromInputString(True)
        reader.SetInputString(t)
        reader.Update()

        writer = vtk.vtkNewickTreeWriter()
        writer.WriteToOutputStringOn()
        writer.SetInputData(reader.GetOutput())
        writer.Update()
        t_return = writer.GetOutputStdString()

        self.assertEqual(t, t_return)
예제 #3
0
import vtk

writer = vtk.vtkNewickTreeWriter()
writer.SetWriteToOutputString(True)
writer.SetInputData(input)
writer.Update()
output = writer.GetOutputString()
예제 #4
0
def VTKTreeToNewick(tree):
  writer = vtk.vtkNewickTreeWriter()
  writer.SetWriteToOutputString(1)
  writer.SetInputData(tree)
  writer.Update()
  return writer.GetOutputString()