[ITK] [ITK-users] suppressing print statements when using Python wrappers

Harnish, Roy Roy.Harnish at ucsf.edu
Mon May 23 21:56:31 EDT 2016


Hi,

I'm wondering if anyone else is getting lots output to the console when using the Python wrappers? If I try to run the SNIPPET below with an itkImage:

<itkImagePython.itkImageSS3; proxy of <Swig Object of type 'itkImageSS3 *' at 0x7f1ec3bc5060> >

I get many lines of print statements. Would like to know how to suppress.

Thanks for any info.

Roy


SNIPPET:

def itkImage_orient_to_axial(itkImage, itkImageType):
    orienterType = itk.OrientImageFilter[ itkImageType, itkImageType ]
    orienter     = orienterType.New()
    orienter.UseImageDirectionOn()
    orienter.SetGivenCoordinateDirection(itkImage.GetDirection())
    orienter.SetInput( itkImage )
    orienter.SetDesiredCoordinateOrientationToAxial()
    orienter.Update()
    return orienter.GetOutput()

itkImage_axial = itkImage_orient_to_axial(itkImage,imageType)


OUTPUT:

itkOrientImageFilterISS3ISS3: 0.343294itkOrientImageFilterISS3ISS3: 0.346615itkOrientImageFilterISS3ISS3: 0.349935itkOrientImageFilterISS3ISS3: 0.353255itkOrientImageFilterISS3ISS3: 0.356575itkOrientImageFilterISS3ISS3: 0.359896itkOrientImageFilterISS3ISS3: 0.363216itkOrientImageFilterISS3ISS3: 0.366536itkOrientImageFilterISS3ISS3: 0.369857itkOrientImageFilterISS3ISS3: 0.373177itkOrientImageFilterISS3ISS3: 0.376497itkOrientImageFilterISS3ISS3: 0.379818itkOrientImageFilterISS3ISS3: 0.383138itkOrientImageFilterISS3ISS3: 0.386458itkOrientImageFilterISS3ISS3: 0.389779itkOrientImageFilterISS3ISS3: 0.393099itkOrientImageFilterISS3ISS3: 0.396419itkOrientImageFilterISS3ISS3: 0.399740itkOrientImageFilterISS3ISS3: 0.403060itkOrientImageFilterISS3ISS3: 0.406380itkOrientImageFilterISS3ISS3: 0.409701itkOrientImageFilterISS3ISS3: 0.413021itkOrientImageFilterISS3ISS3: 0.416341itkOrientImageFilterISS3ISS3: 0.419661itkOrientImageFilterISS3ISS3: 0.422982itkOrientImageFilterISS3ISS3: 0.426302itkOrientImageFilterISS3ISS3: 0.429622itkOrientImageFilterISS3ISS3: 0.432943itkOrientImageFilterISS3ISS3: 0.436263itkOrientImageFilterISS3ISS3: 0.439583itkOrientImageFilterISS3ISS3: 0.442904itkOrientImageFilterISS3ISS3: 0.446224itkOrientImageFilterISS3ISS3: 0.449544itkOrientImageFilterISS3ISS3: 0.452865itkOrientImageFilterISS3ISS3: 0.456185itkOrientImageFilterISS3ISS3: 0.459505itkOrientImageFilterISS3ISS3: 0.462825itkOrientImageFilterISS3ISS3: 0.466146itkOrientImageFilterISS3ISS3: 0.469466itkOrientImageFilterISS3ISS3: 0.472786itkOrientImageFilterISS3ISS3: 0.476107itkOrientImageFilterISS3ISS3: 0.479427itkOrientImageFilterISS3ISS3: 0.482747itkOrientImageFilterISS3ISS3: 0.486068itkOrientImageFilterISS3ISS3: 0.489388itkOrientImageFilterISS3ISS3: 0.492708itkOrientImageFilterISS3ISS3: 0.496029itkOrientImageFilterISS3ISS3: 0.499349itkOrientImageFilterISS3ISS3: 0.502669itkOrientImageFilterISS3ISS3: 0.505990itkOrientImageFilterISS3ISS3: 0.509310itkOrientImageFilterISS3ISS3: 0.512630itkOrientImageFilterISS3ISS3: 0.515951itkOrientImageFilterISS3ISS3: 0.519271itkOrientImageFilterISS3ISS3: 0.522591itkOrientImageFilterISS3ISS3: 0.525911itkOrientImageFilterISS3ISS3: 0.529232itkOrientImageFilterISS3ISS3: 0.532552itkOrientImageFilterISS3ISS3: 0.535872itkOrientImageFilterISS3ISS3: 0.539193itkOrientImageFilterISS3ISS3: 0.542513itkOrientImageFilterISS3ISS3: 0.545833itkOrientImageFilterISS3ISS3: 0.549154itkOrientImageFilterISS3ISS3: 0.552474itkOrientImageFilterISS3ISS3: 0.555794itkOrientImageFilterISS3ISS3: 0.559115itkOrientImageFilterISS3ISS3: 0.562435itkOrientImageFilterISS3ISS3: 0.565755itkOrientImageFilterISS3ISS3: 0.569075itkOrientImageFilterISS3ISS3: 0.572396itkOrientImageFilterISS3ISS3: 0.575716itkOrientImageFilterISS3ISS3: 0.579036itkOrientImageFilterISS3ISS3: 0.582357itkOrientImageFilterISS3ISS3: 0.585677itkOrientImageFilterISS3ISS3: 0.588997itkOrientImageFilterISS3ISS3: 0.592318itkOrientImageFilterISS3ISS3: 0.595638itkOrientImageFilterISS3ISS3: 0.598958itkOrientImageFilterISS3ISS3: 0.602279itkOrientImageFilterISS3ISS3: 0.605599itkOrientImageFilterISS3ISS3: 0.608919itkOrientImageFilterISS3ISS3: 0.612240itkOrientImageFilterISS3ISS3: 0.615560itkOrientImageFilterISS3ISS3: 0.618880itkOrientImageFilterISS3ISS3: 0.622200itkOrientImageFilterISS3ISS3: 0.625521itkOrientImageFilterISS3ISS3: 0.628841itkOrientImageFilterISS3ISS3: 0.632161itkOrientImageFilterISS3ISS3: 0.635482itkOrientImageFilterISS3ISS3: 0.638802itkOrientImageFilterISS3ISS3: 0.642122itkOrientImageFilterISS3ISS3: 0.645443itkOrientImageFilterISS3ISS3: 0.648763itkOrientImageFilterISS3ISS3: 0.652083itkOrientImageFilterISS3ISS3: 0.655404itkOrientImageFilterISS3ISS3: 0.658724itkOrientImageFilterISS3ISS3: 0.662044itkOrientImageFilterISS3ISS3: 0.665365itkOrientImageFilterISS3ISS3: 0.666667itkOrientImageFilterISS3ISS3: 0.666667itkOrientImageFilterISS3ISS3: 1.000000



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160524/80bb5a70/attachment-0001.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list