how to convert a.mat file in to png?

조회 수: 36 (최근 30일)
hume
hume 2023년 2월 7일
댓글: DGM 2023년 2월 8일
I got a B-mode fatty liver ultrasound images from kaggle dataset.here is the file path for the dataset.I want to convert the images into png format how can I do it?
/kaggle/input/dataset-of-bmode-fatty-liver-ultrasound-images

답변 (1개)

KSSV
KSSV 2023년 2월 7일
Read about volumeViewer
load('dataset_liver_bmodes_steatosis_assessment_IJCARS.mat')
I = data(1).images ;
volumeViewer(I)
  댓글 수: 5
Kirthi
Kirthi 2023년 2월 8일
Can you try using the 'imwrite' function in MATLAB to convert a .MAT file to a .PNG image.
Here's an example:
load('yourFile.mat');
im = yourVariable; % substitute "yourVariable" with the name of the variable in your .MAT file
imwrite(im, 'yourFile.png');
Note that the input to the imwrite function should be a 2D or 3D matrix representing an image. If your .MAT file contains other data types, you'll need to extract the image data before passing it to imwrite.
DGM
DGM 2023년 2월 8일
Specifically, it should be a MxNx1 or MxNx3 array to be compatible with imwrite() directly. imwrite() will not accept a volumetric image directly.

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

카테고리

Help CenterFile Exchange에서 Medical Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by