how to convert a.mat file in to png?

58 ビュー (過去 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.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by