[Insight-users] convert raw to dicom (create MetaImage header)

Luis Ibanez luis.ibanez at kitware.com
Tue Jul 8 12:47:17 EDT 2008


Hi Alex,


The simplest way to proceed, will be for you to
create a MetaImage header for your raw data.

The following page describes how to to this:
http://www.itk.org/HTML/Data.htm

The MetaImage header is an ASCII text file with
extension .mhd that will describe your raw file.

Its content should look like:

     NDims = 3
     DimSize = 181 217 181
     ElementType = MET_UCHAR
     ElementSpacing = 1.2   1.2   3.4
     Offset = 13.4  27.5  43.2
     ElementByteOrderMSB = False
     ElementDataFile = myFile.raw


Where, of course, you must replace the numerical data
with the correct values for your image.

Once you create this header, you must put it in the
same directory where your .raw file is, and then
you can pass the ".mhd" file as the input file
to the DicomSeriesReadImageWrite2.cxx example.


    Regards,


       Luis



----------------------------
alexandre govignon wrote:
> Can you tel me how can i convert a raw files in a dicom files... i
> modify the file: DicomSeriesReadImageWrite2.cxx, but it doesn't
> work...
> 
> I have this debugger error:
> 
> 
> exception in file writer
> 
> itk::ExceptionObject (0x17707f0)
> Location: "virtual void itk::GDCMImageIO::Write(const void*)"
> File: /Users/alex/Documents/Essai1Interface/Insight2/Code/IO/itkGDCMImageIO.cxx
> Line: 1233
> Description: itk::ERROR: GDCMImageIO(0x66a370): A Floating point
> buffer was passed but the stored pixel type was not specified.This is
> currently not supported
> 
> 
> Thank you


More information about the Insight-users mailing list