Denver Dang
Denver Dang

Reputation: 2615

DICOM file info to .txt file

I have a DICOM file containing a dose distribution from radiation therapy. This dose distribution is needed to calculate various things in MatLab. But somehow, MatLab can't read these particular files, and I have no idea why.

I've tried some programs online, that can actually read them, but I cannot get an export of the 3D matrix containing the dose distribution, which I can then load into MatLab afterwards.

The only thing I have found is a program that gives a txt file with three columns (x position, y position and luminance) for one slice at a time. Ofc, from this I can create what I'm looking for, but it is pretty time consuming to go through 100-1500 slices for each patient to export an individual txt file every time.

So I was wondering if anyone knew a program or something that could do this easily ?

Upvotes: 0

Views: 1730

Answers (1)

Suever
Suever

Reputation: 65460

You can definitely handle this using the built-in MATLAB functions.

To get the DICOM header you will need to use dicominfo and then to get the image data that you're trying to get you'll need to use dicomread.

Using the example image that you provided I was able to load it using the following.

info = dicominfo('rtdose.dcm');  % Unnecessary because you can use dicomread directly on the filename
im = dicomread(info);
size(im)

    512   512   1   118

As you can see this is a 4D matrix where I'm assuming that the 4th dimension is time. I then looped through the images and found that the most signal occurred between specific time points and I made a gif of these images being displayed in grayscale (frame number in top left).

enter image description here

Upvotes: 2

Related Questions