필터 지우기
필터 지우기

How to combine all CT files to make a single array/matrix?

조회 수: 3 (최근 30일)
blues
blues 2020년 1월 31일
답변: Sean de Wolski 2020년 1월 31일
%load and read CT images
% Preallocate the 512-by-512-by-1-by-263 image array
CT = zeros(512, 512, 263);
for p = 1:263
CTfilename = sprintf('CT-0003-%03d.IMA', p);
CT = dicomread(CTfilename);
%imshow(X,[])
end
% Now I want to make a 3D array of all series
3DArray = cat(3, CT{:}); % how to write a code here so that I can get a 3D array with X*Y*Z dims?
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2020년 1월 31일
blues - your comment says
% Preallocate the 512-by-512-by-1-by-263 image array
but your code to pre-allocate the array removes the 1 and creates a 512x512x263 matrix. Which is correct? Or should your code to save the images be
CT = zeros(512, 512, 263);
for p = 1:263
CTfilename = sprintf('CT-0003-%03d.IMA', p);
CT(:,:,p) = dicomread(CTfilename);
%imshow(X,[])
end
assuming that dicomread returns a 512x512 matrix?
blues
blues 2020년 1월 31일
Thank you for pointing that out.
CT without CT(:,:,p) returned 512*512.
Now, with CT(:,:,p), I will not need concatenate (cat) thing, right?

댓글을 달려면 로그인하십시오.

답변 (1개)

Sean de Wolski
Sean de Wolski 2020년 1월 31일
Look at dicomreadVolume!
https://www.mathworks.com/help/images/ref/dicomreadvolume.html

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by