File Exchange

image thumbnail

MRI Analyze tools

version (413 KB) by Darren Weber
Read/View Analyze data format (MRI).


Updated 24 Jan 2003

No License

These tools read and visualize Analyze MRI data files (.hdr, .img). Further work will create functions to write files. See for more information and regular updates.

Cite As

Darren Weber (2021). MRI Analyze tools (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (13)

Lars Costers

tan jun

thank you!It is a very useful tool!

wenchao yang


I have been trying to use the avw_img_read function to read in the eigenvalues and eigenvectors from a Diffusion Tensor Image. I appended 12 of these files (3 files for eigenvalues, 9 for eigenvector components) into a single volume in Analyze before exporting it as a .hdr and .img file for use with this code. That is, there are 12 224x224x65 files appended into one. This code doesn't seem to recognize that--the result is instead just one 224x224x65 double (labeled 'img' by default) in the avw struct. How can I get the code to recognize the other 11 data files in that one .img/.hdr file?

Praveen Kulkarni

Thank you very much. Great Code, saved lot of time.



I've found that
"hist.exp_time = sprintf('%2d-%2d-%2.0f',datime(4),datime(5),datime(6));"
doesn't make up the 10 bytes required, so I had to modify it to "%2.1f". But sometimes I still get a 347 byte hdr file. I'm not quite sure why that happens...

Thanks for these programs, I would never have been able to do this from scratch.

Ibraheem Al-Dhamari

How to use these files ?

Brad Henrie

Extremely well made. Finding these files has saved me 2 weeks of programming.

Wenjia Bai

Very helpful for writing Analyze 7.5 format.

kalai selvi

very helpful to learn the analyse formats. could you please give suggestion to convert thses .img format to .tiff format?

James Hays

The file handling alone makes this a very useful tool.

Peterson Carl


MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: Tools for NIfTI and ANALYZE image

Community Treasure Hunt

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

Start Hunting!