function [img info]=readimgarrs(info,N)
% readimgarr Read one image from a multifile image using info structure. 
% usage:: img=readimg(info,N) 
% 
% img is the Nth image in file filename which contains an array of
% of length>=1 images.  info is a structure which must contain fields:
% fullname -full file name
% Nx -xsize of image
% Ny -xsize of image
% 
% info can contain fields:
% type -precision (default: 'uint8')
% head -length of file header in bytes and is returned as header. 
%   (default: 0)  
% ihead -length of an image header in bytes to be skipped befor each
%   image. (default: 0) 
%
% Optional info return includes default fields defined.

% revision history:
% 01/28/98 Mark D. Shattuck <mds> readimgarrs.m

if (~isfield(info,'Ny')) 
  info.Ny=info.Nx;
end
if (~isfield(info,'type')) 
  info.type='uint8';
end
if (~isfield(info,'head')) 
  info.head=0;
end
if (~isfield(info,'ihead')) 
  info.ihead=0;
end

img=readimgarr(info.fullname,info.Ny,info.Nx,N,info.type,info.head,0,0,info.ihead);

