[Insight-users] No DICOM magic number found, but file appears to be DICOM...

Miller, James V (Research) millerjv at crd.ge.com
Mon Aug 23 08:44:11 EDT 2004


Wei-Lin,

ITK IO factory mechanism appears to be mistaking your images are DICOM
images.
Basically, from the bitpattern in your file, the IO factory mechanism
decided
that the beginning of the bitpattern matched the beginning of the bit
pattern
in a DICOM image.

It sounds like your images are raw binary images.  I would create a small
Meta format header that describes your data and run the program passing in 
the Meta header.  The Meta header is a small text file that has a .mhd
extension.  Below is a Meta header for a 3D image where the binary data is
in a file called HeadMRVolume.raw.  You can make a file similar to this for
2D files and 3D files.

NDims = 3
DimSize = 48 62 42
ElementSize = 4.000000e+000 4.000000e+000 4.000000e+000
ElementSpacing = 4.000000e+000 4.000000e+000 4.000000e+000
ElementType = MET_UCHAR
ElementByteOrderMSB = False
ElementDataFile = HeadMRVolume.raw

If you still get the error when using Meta images (which could happen if the
factory tests DICOM before Meta), then in your program, instantiate an 
itk::MetaImageIO and call SetImageIO on the ImageFileReader, passing in the 
MetaImageIO object.



-----Original Message-----
From: Wei-Lin Bee [mailto:tigerbee at MIT.EDU]
Sent: Friday, August 20, 2004 5:14 PM
To: Miller, James V (Research)
Subject: RE: [Insight-users] No DICOM magic number found, but file
appears to be DICOM...


Dear Jim,

My 2D image is not DICOM images and one image file consists of 256 X 256
pixels
X 16 channels X 16 bits = 2,048 KB.

3D image file consisting of 10 2D images comes 20,480 KB.


Best,
Tiger

Quoting "Miller, James V (Research)" <millerjv at crd.ge.com>:

> Are you images really DICOM images?  Or are they some other format that
ITK
> is mistaking as DICOM?
> 
> Jim
> 
> -----Original Message-----
> From: Wei-Lin Bee [mailto:tigerbee at MIT.EDU]
> Sent: Friday, August 20, 2004 3:40 PM
> To: insight-users at itk.org
> Subject: [Insight-users] No DICOM magic number found, but file appears
> to be DICOM...
> 
> 
> Dear Luis,
> 
> My multiphoton microscope image pixel type is 16 bit, and my goal is to do
> image
> registration and segmentation with ITK to get 3D image.
> 
> My first step should be registration, I tested my image file with
> ImageRegistration2.exe (cause pixeltype in this example is defined as
> unsighed
> short) in ITK source directly to see what the error messages I would have
so
> that I can get the right direction to go.
> 
> My error message is "No DICOM magic number found, but file appears to be
> DICOM.Proceeding without caution." After looking for answer from internet,
I
> got your answer as follows:
> 
> ============================================================
> Luis Ibanez luis . ibanez at kitware . com 
> Wed, 01 Oct 2003 16:40:17 -0400 
> 
> Hi Thimmaiah,
> Good news and bad news.
> 
> First, here are some the facts:
> 1) There are two DICOM readers in ITK
>     - DICOMImageIO
>     - DICOMImageIO2
> 2) DICOMImageIO reads your images without complaints.
>     This is the default reader registered in the IO
>     factories and therefore is the one used in the
>     demo application "ImageViewer".
> 3) DICOMImageIO2 does a more formal testing and
>     prints the message:
>    > No DICOM magic number found, but file appears to be DICOM.
>    > Proceeding without caution.
>     but still reads the image.
>     This is the reader used in "ApplicationModel"
>     and it is able to read the 3 slices and
>     create a volume with them.
> 4) VolView reads your DICOM images without
>     complaints, and display them correctly.
> 5) MRIConvert reject your images because they
>     are missing the Preamble.
>     "Preamble missing. Unable to read file"
> ---------------------------------------
> So,
> 
> The good news is:
>    You can read your DICOM slices IFF you use
>    the DICOMImageIO instead of DICOMImageIO2.
> 
>    So, when you configure the ImageSeriesReader,
>    please provide a DICOMImageIO, instead of a
>    DICOMImageIO2 object.
> 
> The bad news is:
> 
>    your DICOM files are suspicious (let's say
>    sloppy), and you may want to complaint with
>    your image provider because they don't fully
>    satisfy the DICOM standard.
> Regards,
>    Luis
> 
> =================================================================
> 
> I've learned from ItkSoftwareGuide,pp193-199 that itk::ImageFileReader and
> itk::ImageFileWriter are independent of any particular file format, and
> PixelType declaration plays an important role in format issue so I don't
> know
> whether I have to do is make new itkXXXImageIOFactory.h itkXXXImageIO.h
> itkXXXImageIO.cxx and itkXXXImageIOFactory.cxx.
> 
> I guess my question is not brand new one, please give me related reference
> if you've already replied.
> 
> 
> All the best,
> Tiger
> 
> ps.my system is InsightToolkit-1.8.0, VC7.NET 2003.
> 
> _______________________________________________
> 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