[vtkusers] vtkImageReader, dicom2 and DICOM headers.

Sebastien BARRE seb-ml-a at barre.nom.fr
Mon Aug 14 14:18:25 EDT 2000


Hi

At 17:37 14/08/00 +0200, Marcel van Straten a écrit:

>vtkImageReader computes the headersize for each z-slice for a given
>dataextent and filesize as parameters. So if your data inside the
>dicom-files is uncompressed 16 bit you can read them directly with
>vtkImageReader and you don't need the tool dicom2 (from S.Barre) to extract
>the raw data.

Well, I do not exactly how vtkImageReader work, but this will work only if 
it finds the beginning of the pixels area by substracting the expected data 
size (given the extent) from the whole file size. According to the doc, it 
seems to be the case :

void vtkImageReader::SetHeaderSize ( int size )
    If there is a tail on the file, you want to explicitly set the header 
size.

Thus, it will work without my tool :) To be honnest, I'm not sure it was 
doing like that at the time I wrote dicom2, this might have been added 
later on ;)

But, this won't solve your problem if :

         - there are additional data after the pixel data. The DICOM 
protocol does not specify that pixel data should be at the end, it is 
organized as 'tags', and tags are sorted by increasing order, but Pixel 
Data tag is (7FE0,0010), see what I mean... :)

         - your pixel data is not located in 8 or 16 bits. I mean, there 
*are* file stored as 12 bits concatenated together ;)

         - you pixel data is less than 8/16 bits, but not starting at bit 
0. Yes it is :)

But in most of the case, vtkImageReader will do fine.

I also wrote dicom2 to compute a kind of accumulation/MIP map, compute a 
mask, then remove unwanted stuff from the images, quicky. Renaming issues 
were also important. Flipping, halving. I also had to convert to TEXT and 
PNG. Multiframe files support. DICOM anonymization. And of course parsing 
the tags to find the size of the pixels, the space between each slice. etc. 
And the whole stuff in one tool, allowing batch processing on hundreds of 
files.

By the way, feel free to modify the FAQ accordingly.





More information about the vtkusers mailing list