How to view image from .MAT file

조회 수: 7 (최근 30일)
Max Walliam
Max Walliam 2021년 10월 21일
답변: Chunru 2021년 10월 21일
This brain tumor dataset containing 3064 T1-weighted contrast-inhanced images from 233 patients with three kinds of brain tumor: meningioma (708 slices), glioma (1426 slices), and pituitary tumor (930 slices).
This data is organized in matlab data format (.mat file). Each file stores a struct
How can i read this file and save it as jpg i have aattached one of the .mat file

채택된 답변

Chunru
Chunru 2021년 10월 21일
x = load("1.mat");
x.cjdata
ans = struct with fields:
label: 1 PID: '100360' image: [512×512 int16] tumorBorder: [38×1 double] tumorMask: [512×512 logical]
figure(1); imagesc(x.cjdata.image); axis image
saveas(gcf, 'a.jpg');
figure(2); imagesc(x.cjdata.tumorMask); axis image
saveas(gcf, 'b.jpg');
figure(3); plot(x.cjdata.tumorBorder); % what is this data?
dir
. .. 1.mat a.jpg b.jpg

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by