[Insight-users] Re: about MetaImageReadWrite

Luis Ibanez luis.ibanez@kitware.com
Sun, 23 Mar 2003 23:15:51 -0500


Hi Zhuo,

I'm not able to read your DICOM slice either.

Do your know if it is JPEG compressed ?
The ITK Dicom reader does not support compression.

The MetaImage header will work only if you DICOM
file has the binary data in raw format as the
las piece of data in the file. (again, not compressed)

---

About your questions:

1) Yes, from the DICOM files, you create
    just a meta image header file. This is done
    with MetaImageImporter

2) The header is small. It is a text file
    with less than 20 lines of text

3) Yes, the metaimage header MUST be placed
    in the same directory where the DICOM
    files are.

4) Using the program ImageReadWrite in
    available Insight/Examples/IO you can
    convert MetaImage files into VTK files.
    Note that you will have to replace the
    current Dimension=2 with Dimension=3,
    and recompile.

5) MetaImageReadWrite (in InsightApplications)
    and ImageReadWrite (in Insight/Examples) are
    both command line applications. If you execute
    them from the VisualStudio environment you will
    only receive this message:

                "press any to continue".


    Please open a console (MS-DOS window) or a Cygwin
    console if you have cygwin installed. Then
    execute the program from the console.


---

You may also want to give it a try to the
applications developed by Jolinda Smith. This
applications allows to read DICOM files from
a directory and write them in MetaImage format.
You can download the executable from

http://lcni.uoregon.edu/~jolinda/MRIConvert



Regards,



    Luis




---------------------------------
zhuo Chen wrote:
> Hi,luis
> Thank you for your so much help to me.
>            MetaImageImporter
> DICOM files------------------>Metaheader file(point to
> 
> 
> DICOM files, so it is very small and I don't need to
> 
> input the directory which my DICOM files locate)
> 
> copy to the directory which my DICOM files locate
> -------------------------------------------------->
> 
>                               MetaImageReadWrite 
> Metaheader file + DICOM files--------------------->
> 
> VTK files.
> 
> Is it all right?
> I am not able to read DICOM file.Can you help me read
> the DICOM file to check my input information.In my
> accessory I send you one DICOM file and my input
> information.Thank you very much!
> On the other hand, I have already execute
> MetaImageReadWrite and it shows "press any to
> continue". Nothing is asked to input and nothing is
> produced.I don't know the reason.
> 
> 
> _________________________________________________________
> Do You Yahoo!? 
> ????,????,NetVista A30 ??
> http://ad.cn.doubleclick.net/clk;5313999;7930402;p?http://www.ibm.com/cn/promotion/pc/netvista_a30/index.shtml
> 
> 
> ------------------------------------------------------------------------
> 
> What is the name of the '.mhd' file that you want to create? 
> Please include '.mhd' at the end. ------> DicomtoVtk.mhd
> 
> What is the dimensionality of your data<1,2,3,....>? ------>3
> 
> Assumeing dimension 0 is the 'x' dimension...
> How large is dimension 0 ------>512
> How large is dimension 1 ------>512
> How large is dimension 2 ------>18 (the total number of DICOM files)
> 
> Points in an image represent a measure in physical space.
>   Measures in physical space are done using a particular
>   aperature spacing - that is, what is the spacing of the 
>   points in your data...if you don't know/care,answer 1.
>  What is the point spacing in dimension 0? ------>0.44
>  What is the point spacing in dimension 1? ------>0.44
>  What is the point spacing in dimension 2? ------>5 (the spacing of two DICOM files in Z axis)
> 
> Images are taken of a particular location in space.
>   That is, they have an origin in space...if you don't
>   know/care, answer 0 for each dimension.
>  What is the origin in dimension 0? ------>0
>  What is the origin in dimension 1? ------>0
>  What is the origin in dimension 2? ------>0 (I don't know these information)
> 
> Is your data stored using MSB byte ordering?
>  Data written on a 'PC' is in 'Little-endian' byte order.
>  Data from almost every other machine is in 'Big-endian' byte order.
>  If your data  was written on a 'PC', enter 0.
>  Otherwise, if you data was written on a Mac/Sun/Other, enter 1.
>  ------>0
> 
> How many channels are stored at each point in your image?
>  For example, RGB images have 3 channels, and most medical images have a single channel.
>  ------>1
> 
> What is the 'type' of the elements in your data:
> 0 - signed char <one byte>
> 1 - unsigned char
> 2 - signed short <two byte>
> 3 - unsigned short
> 4 - signed int <four byte>
> 5 - unsigned int 
> 6 - float <four byte>
> 7 - double <eight byte>
> ------>4 (I don't know how to choose)
> 
> How is the data stored ?
>  0 - in one file
>  1 - in one file per slice <e.g., like dicom>
> ------>1
> 
> Size of the header that must be skipped to reach the data in the file(s)?
>   Enter 0 to not skip a header, -1 to have MetaImageReader automatically
>   calculate the headersize assuming the data is at the end of the file,
>   or enter the headersize.
> ------>-1
> 
> You've got two options when doing one file per slice:
>   0 - Listing the name of each slice in the .mhd file
>   1 - Specifying a 'fprintf' style string and min,max,and step values for integers
>       to be substituted into that string to specify the numbered files that are slices.
>       For example, use data.%3d to match data.000,data.001,data.002...If you don't
>       know what we are talking about,choose option 0.
> ------>0
> 
> What is the dimension of the data stored in files?
> It must be less than or equal to nDims<3> Enter 2 for typical image slice data.
> ------>2
> 
> Filename of slice 0 ------> DicomtoVtk0
> Filename of slice 1 ------> DicomtoVtk1
> Filename of slice 2 ------> DicomtoVtk2
> Filename of slice 3 ------> DicomtoVtk3
> Filename of slice 4 ------> DicomtoVtk4
> Filename of slice 5 ------> DicomtoVtk5
> Filename of slice 6 ------> DicomtoVtk6
> Filename of slice 7 ------> DicomtoVtk7
> Filename of slice 8 ------> DicomtoVtk8
> Filename of slice 9 ------> DicomtoVtk9
> Filename of slice 10 ------> DicomtoVtk10
> Filename of slice 11 ------> DicomtoVtk11
> Filename of slice 12 ------> DicomtoVtk12
> Filename of slice 13 ------> DicomtoVtk13
> Filename of slice 14 ------> DicomtoVtk14
> Filename of slice 15 ------> DicomtoVtk15
> Filename of slice 16 ------> DicomtoVtk16
> Filename of slice 17 ------> DicomtoVtk17
> 
> You are done!
> 
> Please press any key to continue!