[Insight-users] Reading Tif images

Julien Jomier jjomier at cs.unc.edu
Tue, 27 Apr 2004 12:58:51 -0400


Hi Mike,

itkTIFFImageIO was added after the 1.4 release. You should update your
current ITK version to be able to read TIFF images. (This feature is
implemented in ITK 1.6)
You can download ITK 1.6 at http://www.itk.org/HTML/Download.php or via =
CVS.

regards,

Julien

> -----Original Message-----
> From: insight-users-admin at itk.org=20
> [mailto:insight-users-admin at itk.org] On Behalf Of Michael Hawrylycz
> Sent: Tuesday, April 27, 2004 12:45 PM
> To: Luis Ibanez
> Cc: insight-users at itk.org
> Subject: RE: [Insight-users] Reading Tif images
>=20
>=20
>  Hi Luis,
>=20
> I tried exactly as you are indicating on Visual Studio 6.  I=20
> get the following exception
>=20
> Input File Name imagetest.tif
> We are here!=20
> ExceptionObject caught !
>=20
> itk::ExceptionObject (00E7F9A4)
> Location: "Unknown"=20
> File: D:\Source\Insight-1.4\Code\IO\itkImageFileWriter.txx
> Line: 143
> Description: itk::ERROR: ImageFileWriter(00231440): No=20
> ImageIO set, or none could be created.
>=20
> Which makes me think that maybe I'm not finding all of ITK? =20
> I have left most of the ITK source on the CD and using Cmake=20
> to do the local builds on C Drive...Any problem with that?
>=20
> Thanks,
>=20
> Mike
>=20
>=20
> Mike Hawrylycz, Ph.D.
> Director, Informatics
> Allen Institute of Brain Science
> mikeh at alleninstitute.org
> (206) 548-7011
>=20
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]=20
> Sent: Monday, April 26, 2004 6:49 PM
> To: Michael Hawrylycz
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] Reading Tif images
>=20
>=20
> Hi Michael,
>=20
> The ImageFileReader is capable of reading TIFF images.
>=20
> Did you tried adding a try/catch block around the Update()
> call of the reader ?
>=20
>=20
> The code should be simply
>=20
>=20
>     typedef itk::Image< PixelType, Dimension > ImageType;
>     typedef itk::ImageFileReader< ImageType  > ReaderType;
>=20
>     ReaderType::Poiner  reader =3D ReaderType::New();
>=20
>     reader->SetFileName("myImage.tif");
>=20
>     try
>       {
>       reader->Update();
>       }
>     catch( itk::ExceptionObject & excp )
>       {
>       std::cerr << excp << std::endl;
>       }
>=20
>=20
>=20
> If something fails on the reading process, the reader will=20
> throw an exception. When that happens, it is illuminating to=20
> print out the exception. Its description is usually a good=20
> indication of the source of the problem.
>=20
>=20
> Please let us know what you find,
>=20
>=20
>      Thanks
>=20
>=20
>        Luis
>=20
>=20
> --------------------------
> Michael Hawrylycz wrote:
>=20
> > =20
> >  Hi,
> >=20
> >  I am trying to read in a tif image using=20
> itkImageFileReader, but my=20
> > sense is that these methods don't recognize that format.  Is there=20
> > another way of doing this?
> >=20
> > Thanks,
> >=20
> > Mike
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org=20
> > http://www.itk.org/mailman/listinfo/insight-users
> >=20
>=20
>=20
>=20
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org=20
> http://www.itk.org/mailman/listinfo/insight-> users
>=20