Resize image but dicom info missing

1 vue (au cours des 30 derniers jours)
mohd akmal masud
mohd akmal masud le 28 Déc 2021
Commenté : mohd akmal masud le 28 Déc 2021
Hi all, I have 4D images,
>>spect130 = dicomread('khadijahkalai.dcm');
>>size(spect130)
ans =
130 130 1 90
Then I want resize it to 128x128, I wrote this code below
scale = 128/130;
spect128 = imresize(spect130, scale);
dicomwrite(spect128, 'spect128x128.dcm');
the problem is, the new spect128x128.dcm is missing dicominfo like SliceThickness.
Anyone know how to solve it?

Réponse acceptée

Image Analyst
Image Analyst le 28 Déc 2021
I believe that would resize all dimensions by that, including the 90, which obvisouly you don't want. I think you need to do it one slice at a time.
imageSize = size(spect130);
spect128 = zeros(128, 128, 1, imageSize(4), class(spect130))
for slice = 1 : imageSize(4)
thisSlice = spect130(:, :, 1, slice);
spect128(:, :, 1, slice) = imresize(thisSlice, [128, 128]);
end
As far as writing the new metadata to the output file, I don't know. You'd have to look into the dicomwrite() documentation.

Plus de réponses (0)

Catégories

En savoir plus sur Biomedical Imaging dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by