function y = readminc(input_file)

% readminc(input_file)
% read a minc file and convert to 3D array
% EXAMPLE: brain=readminc(I001S3_flip.mnc);
% (c) Moo K. Chung, 2004. mchung@stat.wisc.edu


in_handle=openimage(input_file);
dim = getimageinfo(in_handle,'DimSizes');
dimZ = dim(2); 
dimY = dim(3);  
dimX = dim(4);  
numslices=getimageinfo(in_handle, 'NumSlices');
y=getimages(in_handle, 1:numslices);
y = reshape(y,dimX,dimY,dimZ);

return;