Borrar filtros
Borrar filtros

How to open .raw files in Matlab

17 visualizaciones (últimos 30 días)
Joaquim
Joaquim el 30 de Nov. de 2016
Comentada: Swati Jain el 31 de Mayo de 2018
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 comentario
Swati Jain
Swati Jain el 31 de Mayo de 2018
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?

Iniciar sesión para comentar.

Respuesta aceptada

Jan
Jan el 30 de Nov. de 2016
Editada: Jan el 1 de Dic. de 2016
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 comentarios
Jan
Jan el 1 de Dic. de 2016
@Joaquim: How do you apply flipud on a 3D-array? Please post you code instead of describing it.
Walter Roberson
Walter Roberson el 1 de Dic. de 2016
R2014a redefines flipud, fliplr, rot90 to be able to handle arrays with multiple dimensions.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by