[Insight-users] disabling unknown field warnings with tif reader

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Aug 22 12:20:38 EDT 2007


Hi Bill,

Thanks for the advice - it works just nice. The SuppressWarningsOn/ 
Off would be a good option, but I will use the most simple option for  
now :-)

For the python users: the problem is to do that from python. It can  
be done quite easily with ctypes :

   import ctypes
   libtiff = ctypes.cdll.LoadLibrary("/usr/lib/libtiff.so")
   libtiff.TIFFSetWarningHandler(0)

And that's all, it works :-)

Gaëtan



Le 22 août 07 à 17:10, Bill Lorensen a écrit :

> Gaetan,
>
> There is a call in the itktiff library: TIFFSetWarningHandler that  
> sets a global variable to a handler for the warnings. If you call  
> it with a 0 argument, I think it will suppress the warnings.
>
> A more general solution would be to add a virtual  
> SuppressWarningsOn/Off method to itkImageIOBase. Then each ImageIO  
> could perform IO specific warning suppression. The ImageFileReader  
> and ImageFileWriter could have the same methods and call the image  
> IO's SuppressWarningsOn/Off.
>
> Bill
>
> On 8/22/07, Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr> wrote:
>
> Hi,
>
> Is it possible to disable the warnings about unknown fields with the
> tif readers ?
>
> I'm building a 3D image from several 2D tif images (up to 120) with
> an ImageSeriesReader, and I get one warning per 2D image - that's
> pretty annoying, especially while working in interactive mode in the
> console!
>
> Thanks,
>
> Gaëtan
>
>
> --
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr
>
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>

--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: =?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?=
Url : http://public.kitware.com/pipermail/insight-users/attachments/20070822/da8f1c01/PGP.pgp


More information about the Insight-users mailing list