[Insight-developers] DICOM files without preambles

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Jul 8 12:49:06 EDT 2010


On Thu, Jul 8, 2010 at 6:42 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Mathieu,
>
> In itkGDCMImageIO (using gdcm v1) do you recall why we require a
> preamble to be present to satisfy CanReadFile? Some Slicer folks have
> files without preambles and this precludes them from being recognized
> as Dicom files. GDCMImageIO can read these files however.
>
> I'm referring to the test in itkGDCMImageIO that looks like this:
>
>  bool preamble;
>  if( gdcm::Document::CanReadFile(file, preamble) )
>    {
>    // By default only support DICOM with preamble (DICM magic number):
>    return preamble;
>    }
>
> I would like to change the code to this: (perhaps with a warning about
> a missing preamble)
>  bool preamble;
>  if( gdcm::Document::CanReadFile(file, preamble) )
>    {
>    return true;
>    }

This should be fine. I believe the reason was that someone found a
binary blob that was detected as DICOM but should not have. So as a
quick fix I use the value of dicom_preamble to decide if GDCMImageIO
could read the file or not.

Please get in touch with Steve, I know he opened a bug report just for
that issue.


Thanks !
-- 
Mathieu


More information about the Insight-developers mailing list