Resize image but dicom info missing

1 visualización (últimos 30 días)
mohd akmal masud
mohd akmal masud el 28 de Dic. de 2021
Comentada: mohd akmal masud el 28 de Dic. de 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?

Respuesta aceptada

Image Analyst
Image Analyst el 28 de Dic. de 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.

Más respuestas (0)

Categorías

Más información sobre Biomedical Imaging en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by