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

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?

thanks

0 Comments

Mohamed Moawed

Tags

Products

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

3 Comments

Mohamed Moawed on 9 Apr 2013

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

Image Analyst on 9 Apr 2013

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);
imshow(rgb);

it certainly does display an image from an hdr file.

Mohamed Moawed on 9 Apr 2013

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

Matt Kindig
Answer by Walter Roberson on 9 Apr 2013

6 Comments

Image Analyst 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.

Mohamed Moawed on 9 Apr 2013

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

Walter Roberson on 9 Apr 2013

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.

Walter Roberson

Contact us