[Insight-users] How to write/read a single 3D Dicom image

Luis Ibanez luis.ibanez at kitware.com
Tue Jun 21 19:03:40 EDT 2005


Hi Kai,

You should use the ImageSeriesReader and ImageSeriesWriter classes.

You will find examples on how to Read and Write 3D images to and
from DICOM files in the ITK Software Guide


           http://www.itk.org/ItkSoftwareGuide.pdf


Regards,


    Luis


---------------------
Kai Li wrote:
> Hi,
>   I tried to write a 3D image to a file in Dicom format but didn't
> succeed. Here's what I did:
> 
> typedef itk::ImageFileWriter ImageFileWriterType;
> typedef typename ImageFileWriterType::Pointer ImageFileWriterPointer;
> ImageFileWriterPointer writer = ImageFileWriterType::New();
> writer->SetInput(image);
> writer->SetFilename("MyDicomImage.dcm");
> writer->Update();
> 
> Finding the above code does not work, I inserted the following two lines
> before the writer->Update, but without any luck:
> 
> itk::GDCMImageIO::Pointer gdcmImageIO = itk::GDCMImageIO::New();
> writer->SetImageIO(gdcmImageIO);
> 
> Instead of GDCMImageIO, I also tried itk::DicomImageIO with the same
> result.
> 
> Any help is appreciated.
> 
> Kai
> _______________________________________________
> 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