[IPython-user] completion

John Hunter jdhunter at ace.bsd.uchicago.edu
Tue Feb 22 16:48:03 CST 2005


>>>>> "Fernando" == Fernando Perez <Fernando.Perez at colorado.edu> writes:
    Fernando> for quick tests, lighter than loading ITK (which
    Fernando> probably takes a good 1/2 hour :).

Come on now, you need a faster machine.  It only takes a bit over 10
seconds to import the library on my 3GHz P4!  Still feels like an
eternity...

I just finished my hello world script that loads an image in ITK and
displays it in VTK.  And it only took me two hours to figure out!

    import ConnectVTKITK as connect

    reader = connect.itkImageFileReaderF2_New()
    reader.SetFileName('/home/jdhunter/media/images/leo_ratner.jpg')

    itkExport = connect.itkVTKImageExportF2_New()
    itkExport.SetInput(reader.GetOutput())

    vtkImport = connect.vtkImageImport()
    connect.ConnectITKF2ToVTK(itkExport.GetPointer(), vtkImport)

    viewer = connect.vtkImageViewer()
    viewer.SetInput(vtkImport.GetOutput())
    viewer.Render()

Intuitive, no?

JDH




More information about the IPython-user mailing list