Hi,<br><br>I wanto to write a dataset raw type, but the files that the writer creates not hava data<br>Help me<br><br>The code is:<br>///////////////////////////////////////begin of the code///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<br>/* ========================================================================== */<br>/* */<br>/* RAW Dataset Writer */
<br>/* (c) 2006 Diego Armando Parada Cuervo */<br>/* */<br>/* Writes a raw dataset */
<br>/* */<br>/* ========================================================================== */<br><br>#include "itkImageFileReader.h"<br>
#include "itkRawImageIO.h"<br>#include "itkImageFileWriter.h"<br>#include "itkMetaImageIO.h"<br>#include "iostream.h"<br><br><br>void main()<br>{<br> <br> const unsigned int Dimension = 3;
<br><br> typedef unsigned char PixelType; <br> <br> typedef itk::Image<PixelType, Dimension> ImageType;<br> <br> typedef itk::ImageFileWriter< ImageType> WriterType; // lector de series de imagenes
<br> <br> typedef itk::ImageFileReader< ImageType > ReaderType;<br><br> typedef itk::RawImageIO<PixelType,Dimension> RawIO;<br><br> ReaderType::Pointer reader = ReaderType::New();<br> <br>
WriterType::Pointer writer = WriterType::New();<br> <br><br><br> char *fileName = new char[20];<br><br> cout<<"Digite la ruta del archivo(*.mhd):";<br><br> cin>>fileName;<br><br> reader->SetFileName(fileName);
<br><br><br> RawIO::Pointer m_rawIO = RawIO::New();<br> <br> <br> writer->SetFileName("c:/r.raw"); <br> writer->SetInput(reader->GetOutput());<br> writer->SetImageIO(m_rawIO); <br> <br>
try<br> {<br> reader->Update();<br> writer->Update();<br> }<br> catch( itk::ExceptionObject & err )<br> {<br> std::cerr << "ExceptionObject caught !" << std::endl;
<br> std::cerr << err << std::endl;<br> } <br><br>}<br>/////////////////////////////////////////// end of the code////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<br clear="all"><br>-- <br>Diego Armando Parada Cuervo<br>Estudiante de Ingeniería de Sistemas y Computación<br>Universidad Pedagógica y Tecnológica de Colombia