Natali Graß
Natali Graß

Reputation: 25

create the pixel size for Dicom_Picture in matlab

I have pictures in .dcm format. From Dicominfo I learned that the pixel spacing is [0.9,0.9] mm and the slice thickness is 1.98 mm.

My task: I should get the picture size in real (world) coordinates and then display the pictures in all three projections in matlab.

I had an idea that I would create a matrix in matlab, but it is difficult for me to create the pixel size spacing. I mean that the pixel in the matrix is like a square and is 0.9mm * 0.9mm. I don't know if my approach is correct and if there is an easy way to solve the problem. Thank you very much for every answer

Upvotes: 0

Views: 134

Answers (1)

FangQ
FangQ

Reputation: 1544

several plotting functions allow you to specify x/y/z positions of each pixel/voxel, including imagesc, pcolor, here is an example using imagesc.

% vol stores your dicom volume
vol=rand(40,50,30);
dx=[0.9,0.9,1.98];
imagesc((0:size(vol,1)-1)*dx(1), (0:size(vol,2)-1)*dx(2), vol(:,:,1))

Upvotes: 1

Related Questions