[Insight-users] load a CT scan (DICOM)

Steve Pieper pieper@alum.mit.edu
Fri, 13 Sep 2002 14:06:39 -0400


Hi Alberto - in addition to the excellent description below, you might 
keep in mind that CT images won't always be uniformly spaced in Z 
depending on the acquition protocol (e.g. sometimes you'll see slices 
1mm apart in an area of particular interest and 3mm apart in other parts 
of the anatomy).  In the dicom tags be sure to look at SliceLocation of 
adjacent slices and not SliceThickness since CT slices often overlap.

A very nice set of tools for working with dicom data is DCMTK, available 
from http://dicom.offis.de which includes both canned command line 
applications and a nice c++ class library.

Good luck,
Steve

Stephen R. Aylward wrote:
> Hi,
> 
> The answer may be simple...Sometimes dicom transfers occur in order - so 
> the file numbers actually correspond (by luck) to how the slices should 
> be ordered to create a 3D volume.
> 
> In that case, you can use the MetaImage format to read the dicom slices 
> to create a volume.   You can use the Insight/Example/MetaImageImporter 
> to walk you thru the process to create a MetaImage header file that will 
> allow the slices to be loaded.   Or you can write the MetaImage header 
> file yourself.   The MetaImage header format is simple and will resemble
> 
> NDims = 3
> DimSize = 512 512 <Enter#OfSlicesHere>
> ElementSpacing = <EnterXPointSize> <EnterYPointSize> <EnterSliceSpacing>
> HeaderSize = -1
> ElementType = MET_USHORT
> ElementByteOrderMSB = True
> ElementDataFile = LIST
> <EnterFileNameOfFirstSlice>
> <EnterFileNameOFSecondSlice>
> <EnterFileNameOfThirdSlice>
> .
> .
> .
> 
> 
> This is assuming the slices are 512x512 (most CT scans) of Unsigned 
> Shorts (valid for most CT dicom), and the Byte Ordering is MSB (the 
> default for most dicom).   By setting HeaderSize = -1 the program will 
> automatically calculate the header size for each slice under the 
> assumption that the pixel data occurs at the end of each slice's file 
> (which is generally true for dicom).
> 
> HOWEVER, DICOM does not guarantee order of delivery of slices - so, the 
> file numbering might be absolutely unrelated to how the slices should be 
> ordered to create a 3D volume.   You can try to figure out the ordering, 
> but that is really tedious.   Otherwise, we are working on a program to 
> automatically generate 3D MetaImages from a directory of dicom files. It 
> may be a few weeks before that program is ready.
> 
> I hope this helps,
> Stephen
> 
> Alberto Bert wrote:
> 
>> Hi all,
>>
>> I'm interested in loading a CT (comput. tomography) scan in itk.
>> I know that DicomImageIO can get DICOM file (medical images standard
>> format), but in this case each slice (2D images at specified z, forming
>> the 3D image when in stak) is in a separate file. I mean, I would like
>> to read several 2D DICOM files (each containing a slice) and organizing
>> them to form a 3D image for itk.
>>
>> Any one can help me?
>>
>> Alberto
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users@public.kitware.com
>> http://public.kitware.com/mailman/listinfo/insight-users
> 
> 
>