File Exchange

image thumbnail


version (2.03 KB) by Laszlo Balkay
Read minc format medical image file.


Updated 23 Aug 2011

View License

This function read the minc format input file. The minc file format was introduced by NMI ( m file use the netcdf MATLAB utility. The loadminc function requires the netcdf matlab library.

Application of the function:

[imaVOL,scaninfo] = loadminc(filename)


[imaVOL,scaninfo] = loadminc;
% in that case the file selection popup window will be appeard to pick up a file

Cite As

Laszlo Balkay (2020). loadminc (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (24)

Excellent work! Thanks!!!

Comment to samar al ibrahim:I do not understand you exactly. If you get the imaVOL variable, which is usually a 3D array, you canshow up any slice you want. If the imaVOL size was [256,256,55], you can issue: "imagesc(imaVOL(:,:,33))" for presenting the slice of 33.

it works great! but I only get numerical data. How can I get a picture out of it?

Thank you very much


Works perfectly!


Good work! Works fine with the files from BrainWeb.

ujjwal baid

I am getting this error...

Error using netcdflib
The NetCDF library encountered an error during execution of 'open' function - 'Can't open
HDF5 attribute (NC_EATTMETA)'.

what to do?

neima enad

Index exceeds matrix dimensions.

Error in loadminc (line 74)
imaVOL = zeros(imsize([2,1,3]));
this error msg appear when i try to read mnc file
and please how to show or save the .mnc format in another format

The loadminc can only read the minc1 file format. If MRI brainweb contains minc2 format files unfortunatelly you can not use the loadminc.

file selection popup window will be appeard to pick up a file, when file is picked MRI image does not appears instead too many coefficients appears with scaninfo

Kindly tell me how to load MRI brainweb database images using this function


I've got the same problem as Eva Dyer.
The reason seems to me the file now I'm using is MINC2 format not MINC1 format...
Do you have any plan to make this function applicable also to MINC2??


This was working great until a few days ago. Although I haven't changed the files or the code, a few of the files now fail to load. It is likely a netcdf issue (Error message from the NetCDF library: "NetCDF: Numeric conversion not representable"), but I have no idea why it's failing.

Comment to Eva Dyer: Could you send me the minc file via email which cause this problem? (

Eva Dyer


I am having difficulties using this function (and your Mia GUI which relies on this function).

I get the following error
"The NetCDF library encountered an error during execution of 'open' function - 'Can't open HDF5 attribute

Do you have any suggestions?

Thanks in advance!


I have tried but I was unable to save the image slices in a folder from the volume. Can any one help me in this context..

Thanks in advance...

Comment to Nitesh. One way to check the images would be:
for i=1:size(imaVOL,3); imagesc(imaVOL(:,:,i)); pause;end

it is really helpful,can anybody tell me how we can view image through this


Well done!


Excellent work! Thanks!!!

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