
%fpath='.\';
fpath='d:\';
fnp='3dtestph001';
fnb='3dtestba001';


pimg=sprintf('%s%s%s',fpath,fnp,'.cin'); % Image filename
bimg=sprintf('%s%s%s',fpath,fnb,'.bin'); % Image filename

[Np pinfo]=imginfo(pimg);     % get file info works for phantom and basler
[Nb binfo]=imginfo(bimg);     % get file info works for phantom and basler
% or [Np pinfo]=cininfo(pimg);     % get file info works for phantom only
% or [Nb binfo]=cininfo(bimg);     % get file info works for phantom only

if(Np<0)           
  fprintf('%s does not exist.\n',phimg);    % Check for File
  return
end
if(Np<0)           
  fprintf('%s does not exist.\n',phimg);    % Check for File
  return
end

praw=readimgarr(pinfo.fullname,pinfo.Ny,pinfo.Nx,1,pinfo.type,pinfo.head,0,0,pinfo.ihead);    % Read first image
braw=readimgarr(binfo.fullname,binfo.Ny,binfo.Nx,1,binfo.type,binfo.head,0,0,binfo.ihead);    % Read first image
simage([praw braw]); % display image
fprintf('First image.  Press any key to continue\n');
pause;

raw=readimgarr(info.fullname,info.Ny,info.Nx,Nf,info.type,info.head,0,0,info.ihead);    % Read last image
simage(raw);
fprintf('Last image.  Press any key to continue\n');
pause;

simage(readimgarrs(info,1)); % re-display first image using info structure
fprintf('First image again.\n');
