How to open .raw files in Matlab

7 ビュー (過去 30 日間)
Joaquim
Joaquim 2016 年 11 月 30 日
コメント済み: Swati Jain 2018 年 5 月 31 日
Hi everybody, I have a 3D image stored in a .raw format, 32 bits floating point, uncompressed. The dimensions are 288x288x400. How can I open this image in Matlab?
Thanks in advance, Joaquim Costa
  1 件のコメント
Swati Jain
Swati Jain 2018 年 5 月 31 日
Hi, I am also trying to import an image in .raw format. My question is that, how did you know the dimensions and other details of your image?

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

採用された回答

Jan
Jan 2016 年 11 月 30 日
編集済み: Jan 2016 年 12 月 1 日
fid = fopen(FileName, 'r);
if fid == -1
error('Cannot open file: %s', FileName);
end
data = fread(fid, 288*288*400, 'float32');
fclose(fid);
data = reshape(data, [288, 288, 400]);
  5 件のコメント
Jan
Jan 2016 年 12 月 1 日
@Joaquim: How do you apply flipud on a 3D-array? Please post you code instead of describing it.
Walter Roberson
Walter Roberson 2016 年 12 月 1 日
R2014a redefines flipud, fliplr, rot90 to be able to handle arrays with multiple dimensions.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by