[Insight-users] Fwd: bmp series reader
Luis Ibanez
luis.ibanez at kitware.com
Wed Jul 27 22:22:29 EDT 2005
Hi Diego,
When you say that your program didn't run
successfully do you mean that:
a) It crashed at run time ?
b) It produced a segmentation fault ?
c) It produced an "abort" message ?
d) It read the image but the pixel
content is wrong ?
BTW,
Do you have a series of .bmp images
and you want to convert them to a
series of .png ?
Are all the .bmp of the same size ?
Do they actually belong to a 3D volume ?
Please let us know,
Thansk
Luis
--------------------
Diego Parada wrote:
>
>
> ---------- Forwarded message ----------
> From: *Diego Parada* <icebishop at gmail.com <mailto:icebishop at gmail.com>>
> Date: 27-jul-2005 12:33
> Subject: bmp series reader
> To: insight-users at itk.org <mailto:insight-users at itk.org>.
>
> Hello.
>
> I like read a bmp series, the code is:
>
> typedef itk::RGBPixel< unsigned char > PixelType;
> const unsigned int Dimension = 3;
> typedef itk::Image< PixelType, Dimension > ImageType;
>
> typedef itk::ImageSeriesReader< ImageType > ReaderType;
> typedef itk::ImageFileWriter< ImageType > WriterType;
> typedef itk::NumericSeriesFileNames NameGeneratorType;
>
> ReaderType::Pointer reader = ReaderType::New();
> WriterType::Pointer writer = WriterType::New();
> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();
>
> nameGenerator->SetStartIndex( 2 );
> nameGenerator->SetEndIndex( 7 );
> nameGenerator->SetIncrementIndex( 1 );
>
> nameGenerator->SetSeriesFormat( "IRM%03d.bmp" );
>
> reader->SetImageIO( itk::BMPImageIO::New() );
>
> reader->SetFileNames( nameGenerator->GetFileNames() );
>
> try
> {
> reader->Update();
> }
> catch( itk::ExceptionObject & excp )
> {
> std::cerr << "Error reading the series " << std::endl;
> std::cerr << excp << std::endl;
> }
> reader->Delete();
> writer->Delete();
> nameGenerator->Delete();
>
> this compile whitout errors, but no run succefully.
>
> I like how can convert bmp to png in runtime
>
> thanks
>
>
> --
> Diego Armando Parada Cuervo
> Estudiante de Ingeniería de Sistemas y Computación
> Universidad Pedagógica y Tecnológica de Colombia
>
> --
> Diego Armando Parada Cuervo
> Estudiante de Ingeniería de Sistemas y Computación
> Universidad Pedagógica y Tecnológica de Colombia
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list