[Insight-developers] [Wrapping] Print problems

Benoit Regrain benoit.regrain at creatis.insa-lyon.fr
Wed Aug 10 08:07:52 EDT 2005


Hi,

I would print the content of an ITK object.
The python source code is following

With the first print, all works. The object is a smart pointer to an image
With the second print, I obtain an exception. The object is an itkImage
The exception is :
       itkLightObject_Print() takes exactly 3 arguments (2 given)

Is anyone reproduce that or am I only in this case ?
Cheers

-----------------------------------------------------------------

from InsightToolkit import *
import sys

def itkPrint(object, f=sys.stdout) :
   try:
      ss=itkStringStream()
      object.Print(ss.GetStream())
      print >> f, ss.GetString()
   except Exception,e:
      print Exception,e
      print >> f, repr(object)

img = itkImageUC2_New()
itkPrint(img)
itkPrint(img.GetPointer())


-----------------------------------------------------------------
Benoit Regrain
Ingénieur d'études CNRS (Creatis)
email : regrain at creatis.insa-lyon.fr
phone : (+33) (0) 4.72.43.82.58
fax : (+33) (0) 4.72.43.85.26
address :
   CREATIS - CNRS UMR5515
   INSA - Bâtiment Blaise Pascal
   7, avenue Jean Capelle
   F - 69621 Villeurbanne Cedex
-----------------------------------------------------------------



More information about the Insight-developers mailing list