[Insight-users] Write dataset raw problems
Diego Parada
icebishop at gmail.com
Wed Mar 15 15:23:23 EST 2006
Hi,
I wanto to write a dataset raw type, but the files that the writer creates
not hava data
Help me
The code is:
///////////////////////////////////////begin of the
code///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
==========================================================================
*/
/*
*/
/* RAW Dataset
Writer */
/* (c) 2006 Diego Armando Parada
Cuervo */
/*
*/
/* Writes a raw
dataset */
/*
*/
/*
==========================================================================
*/
#include "itkImageFileReader.h"
#include "itkRawImageIO.h"
#include "itkImageFileWriter.h"
#include "itkMetaImageIO.h"
#include "iostream.h"
void main()
{
const unsigned int Dimension = 3;
typedef unsigned char PixelType;
typedef itk::Image<PixelType, Dimension> ImageType;
typedef itk::ImageFileWriter< ImageType> WriterType; // lector
de series de imagenes
typedef itk::ImageFileReader< ImageType > ReaderType;
typedef itk::RawImageIO<PixelType,Dimension> RawIO;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
char *fileName = new char[20];
cout<<"Digite la ruta del archivo(*.mhd):";
cin>>fileName;
reader->SetFileName(fileName);
RawIO::Pointer m_rawIO = RawIO::New();
writer->SetFileName("c:/r.raw");
writer->SetInput(reader->GetOutput());
writer->SetImageIO(m_rawIO);
try
{
reader->Update();
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cerr << "ExceptionObject caught !" << std::endl;
std::cerr << err << std::endl;
}
}
/////////////////////////////////////////// end of the
code////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--
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/20060315/156557d4/attachment.htm
More information about the Insight-users
mailing list