[Insight-users] Fwd: bmp series reader
Diego Parada
icebishop at gmail.com
Wed Jul 27 13:56:03 EDT 2005
---------- Forwarded message ----------
From: Diego Parada <icebishop at gmail.com>
Date: 27-jul-2005 12:33
Subject: bmp series reader
To: 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050727/7af3f080/attachment.html
More information about the Insight-users
mailing list