Hi,<br>
<br>
You need set IOImage on the reader withi dicomIO (GDCMImageIO).<br>
<br>
The difference difference between series and volume is that the serie is for example<br>
IMR001.bmp<br>
IMR002.bmp<br>
IMR002.bmp<br>
.<br>
.<br>
.<br>
and the volume can be dicom multiframes or mhd format or raw format that they have <br>
a data 3Dmatrix whit the imaga slices.<br>
<br>
The Dicom format can be mono frame and multiframe.<br><br><div><span class="gmail_quote">2005/9/15, êÕþŸ˜ <<a href="mailto:m9421001@gmail.com">m9421001@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,Luis and all ITK user:<br><br>I want to read a meta image and use the data '<br>BrainProtonDensity3Slices.mha' & ' BrainProtonDensity3Slices.raw ' in<br>Insight\Examples\Data.<br>( I want to read a 3D raw image )<br>
<br>And then wirte the meta image into a volume of DICOM format.<br>(.mhd or .mha --> .dcm)<br><br><br>My code as follows :<br><br>#include "itkImageFileReader.h"<br>#include "itkImageFileWriter.h"
<br>#include "itkImage.h"<br>#include "itkRescaleIntensityImageFilter.h"<br>#include "itkMetaDataDictionary.h"<br>#include "itkMetaDataObject.h"<br>#include "itkGDCMImageIO.h"
<br><br>#include <list><br>#include <fstream><br><br>int main(int ac, char* av[])<br>{<br><br> if(ac < 3)<br> {<br> std::cerr << "Usage: " << av[0] << " InputMETAFile OutputDICOM\n";
<br> return EXIT_FAILURE;<br> }<br><br> typedef itk::Image<unsigned char, 3> ImageType;<br><br> typedef itk::ImageFileReader< ImageType > VolumeReaderType;<br><br> VolumeReaderType::Pointer reader = VolumeReaderType::New();
<br><br> reader->SetFileName( av[1] );<br><br> try<br> {<br> reader->Update();<br> }<br> catch (itk::ExceptionObject & e)<br> {<br> std::cerr << "exception in file reader " << std::endl;
<br> std::cerr << e.GetDescription() << std::endl;<br> std::cerr << e.GetLocation() << std::endl;<br> return EXIT_FAILURE;<br> }<br><br><br> typedef itk::GDCMImageIO ImageIOType;
<br><br> ImageIOType::Pointer gdcmImageIO = ImageIOType::New();<br><br><br> typedef itk::Image<unsigned char, 3> WriteType;<br> typedef itk::ImageFileWriter<WriteType> Writer1Type;<br> Writer1Type::Pointer writer1=Writer1Type::New();
<br><br> writer1->SetFileName( av[2] );<br> writer1->SetImageIO( gdcmImageIO );<br> writer1->SetInput( reader->GetOutput() );<br><br><br> try<br> {<br> writer1->Update();<br> }<br> catch (itk::ExceptionObject & e)
<br> {<br> std::cerr << "exception in file writer " << std::endl;<br> std::cerr << e.GetDescription() << std::endl;<br> std::cerr << e.GetLocation() << std::endl;<br>
return EXIT_FAILURE;<br> }<br><br><br><br> return EXIT_SUCCESS;<br><br>}<br><br>My code can run,but the DICOM image in output is not correctly.<br>It has a problem like loss some information in output file.<br><br>
My questions:<br>1)Is it right to read the 3D meta image use ImageFileReader directly?<br>2)Is it right to write the data into a volume of DICOM use<br>ImageFileWriter directly?<br>3)What are difference between series and volume?
<br>4)If I want to get a 3D DICOM file in one file.Is it a volume?<br><br>Thanks a lot. : -)<br> Wordon<br>_______________________________________________<br>Insight-users mailing list
<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div><br><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