MATLAB Answers


how can i read or open a .img file using Matlab?

Asked by Mohamed Moawed on 9 Apr 2013

i have an fMRI images with .img and .hdr format but i can't open or see this image. could you please help me?





No products are associated with this question.

2 Answers

Answer by Matt Kindig
on 9 Apr 2013

I've never used it, but a quick search of the Help gave:

doc hdrread


thanks for your reply but i don't need to read the header i want to open the image with format .img

Matt, that doesn't say anything about reading files with extensions like .img, but it does for .hdr files.

Mohamed, with your hdr image, did you try the demo:

hdr = hdrread('office.hdr');
rgb = tonemap(hdr);

it certainly does display an image from an hdr file.

yes i tried it and it gives an error. "Not a Radiance file."

Answer by Walter Roberson
on 9 Apr 2013


, which is.......

Come on Mohamed, work with us here. Walter still, after all these years, has not been able to get an alpha version of the long awaited Mind Reading Toolbox. And of course, neither have I.

i'm interesting with Matlab and i'm sure there is a way for that

I am the third-party developer for the MATLAB Mind Reading Toolbox, but unfortunately this case has not been implemented yet, so I am going to need to know what the error message is. I am also going to need to know size() and class() of the data that was read in by analyze75read(). Oh yes, I am also going to have to know if this MRI data was produced by SPM.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!