Hi,
I am working with a DICOM RD file (from brachytherapy) in MATLAB, and the dose volume dimensions I obtain are 237 x 226 x 226 (rows x columns x frames). The pixel spacing for both the x and y axes is 1, and the spacing between the GridFrameOffsetVector is also 1.
However, the CT slices have a volume size of 512 x 512 x 348 (rows*columns*slices), with pixel spacing for the x and y axes being 0.5, and the slice thickness is 1.
I have two questions:
The x and y coordinates (code below) I get from the RD file do not cover the full x,y z range of the CT slice coordinates when taking into account their respective pixel spacings. I was assuming RD dicom dose size should be 256*256* 174 instead of 237*226*226, giving its spacing dimensions. Is this normal?
How can I interpolate the dose values onto the intermediate voxels of the CT slice grid, considering the RD file has a pixel spacing of 1 for both x and y axes? Are there any MATLAB or Python tools that can help map the dose volume from the RD DICOM file onto the full CT coordinate grid? Thanks.
% Code to find x, y, z from Dicom RD file.
resolution = double(dcm.PixelSpacing);
dx = resolution(1); % dx is 1
x = dcm.ImagePositionPatient(1) + (0:(double(dcm.Columns) - 1)) * dx;
dy = resolution(2); % dy is also 1
y = dcm.ImagePositionPatient(2) + (0:(double(dcm.Rows) - 1)) * dy;
z = dcm.GridFrameOffsetVector + dcm.ImagePositionPatient(3);
Regards, Adnan