Resizing x and y values of a DICOM/3D logical matrix, slice-by-slice, using for-loop.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello, I am a new Matlab user. I would like your help with a for-loop code please.
I'll be using a software which will forward a DICOM file to Matlab, and convert the image into a logical matrix. For example 1536x1536x90, but the x,y,z values will vary depending on the input DICOM file.
I would like to adjust the images to 512x512 for every 90 slices.
Here's what I'm picturing:
For slices thru s = 1 to s = #slices in a dicom file
specify the x and y dimensions of the slice s
set the x and y dimensions of s to 512*512
repeat until s reaches #slices in the dicom file
End
Right now I have:
for s = 1:size(img,3)
xy = img(:,:,s)
use imresize on xy?
end
And I don't know where I'm going with this. Being a newbie I don't think I fully understand how to deal with various types of matrices, so any help is appreciated.
Thanks in advance!
0 comentarios
Respuestas (1)
Walter Roberson
el 5 de Oct. de 2016
out = imresize(img, [512, 512]);
It happens that imresize() handles the case of multiple planes, without needing a loop.
0 comentarios
Ver también
Categorías
Más información sobre DICOM Format 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!