[Insight-users] Abnormal program termination error.....Help

Julien Jomier jjomier at cs.unc.edu
Sun, 15 Feb 2004 18:36:35 -0500


Hi,

Currently ITK doesn't support BMP images.

You may try converting this BMP image to a format like PNG or JPEG, for
which ITK has readers. I you are familiar with VTK you can use it to =
read
(and write) BMP images then use the itkVTKImageToImageFilter in order to
convert the vtkImageData into an itk::Image.

You can take a look at
http://www.itk.org/pipermail/insight-users/2003-June/003952.html if you =
want
to create your own BMP reader for ITK.

I've added a feature request in the Bug Tracker.

Julien

> -----Original Message-----
> From: insight-users-admin at itk.org=20
> [mailto:insight-users-admin at itk.org] On Behalf Of Sentil Balaji
> Sent: Sunday, February 15, 2004 1:49 AM
> To: insight-users at itk.org
> Subject: [Insight-users] Abnormal program termination error.....Help
>=20
>=20
> Hey All,
>=20
>       I am trying to read and write a .bmp image.I
> used the itkImageFileReader but I got an 'abnormal
> program termination error'.I read the mailing list
> archives and I found that I should use 'try' and
> 'catch'.I got the program executing without an error
> but no '.bmp 'file was written.The code is
> below:Please comment whether am I doing the try and
> catch properly , any corrections for a  better
> solution is welcome...Many Thanks
>=20
> ------------------------------------
> CODE
>=20
> ----------------------------------
>=20
> #include <ITK/itkImageFileReader.h>
> #include <ITK/itkImageFileWriter.h>
> #include <ITK/itkImage.h>
> BOOL main()
> {
> 	typedef itk::Image<unsigned char,2> Imagetype;
> 	typedef itk::ImageFileReader<Imagetype> Readertype;
> 	typedef itk::ImageFileWriter<Imagetype> Writertype;
> 	Readertype ::Pointer reader=3DReadertype::New();
> 	reader->SetFileName("C:/SLICES/ADD10.bmp");
> 	try=20
> 	{
>     reader->Update();
> 	}
> 	catch(itk::ExceptionObject exp)
> 	{
> 		return FALSE;
> =09
> 	}
> 	Imagetype::Pointer ir=3Dreader->GetOutput();
> 	Writertype ::Pointer writer=3DWritertype::New();
> 	writer->SetInput(ir);
> 	writer->SetFileName("C:/SLICES/ITKWRITE.bmp");
> 	writer->Write();
> 	return TRUE;
> =09
> }
> 	=09
> ----------------------------------------------
>  =20
> =20
>     =20
>=20
> ______________________________________________________________
> __________
> Yahoo! India Insurance Special: Be informed on the best=20
> policies, services, tools and more.=20
> Go to: http://in.insurance.yahoo.com/licspecial/index.html
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org=20
> http://www.itk.org/mailman/listinfo/insight-> users
>=20