How to convert 4D image dicom to png by slice

조회 수: 1 (최근 30일)
mohd akmal masud
mohd akmal masud 2021년 8월 30일
답변: Shadaab Siddiqie 2021년 9월 15일
Hi all,
Anyone know how to convert 4D image dicom to png slice by slice. I try, but have error
clc
clear all
[I, cmap] = dicomread('I10');
dcmImagei = squeeze(I); % Check number of images
for k = 1:176
dcmImagei(:,:,k) = uint8(255 * mat2gray( dcmImagei));
imwrite(dcmImagei(:,:,k), sprintf('qqqmyGray%d.png', k));
end
ERROR
Unable to perform assignment because the size of the left side is 258-by-258 and the size of
the right side is 258-by-258-by-176.

채택된 답변

Shadaab Siddiqie
Shadaab Siddiqie 2021년 9월 15일
From my understanding you want to get slices of your image. You might be able use sliceviewer and orthosliceviewer for this task.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by