function im=loadlightimages(number,index,scale)

basedir='~c340/web_docs/labs/labAssign3EigIm/images/lighting';

fid=fopen(sprintf('%s/%d/info',basedir,number));
i=1;
while 1
  line = fgetl(fid);
  if ~isstr(line), break, end
    flist{i}=line;
i=i+1;
end
fclose(fid);

if(exist('scale'))
  for(i=1:length(index))
   temp=readppm(sprintf('%s/%d/%s',basedir,number,flist{index(i)}));
   im(:,:,i)=imresize(ppmunpack(temp)/255,scale,'nearest');
  end;
else
  for(i=1:length(index))
   temp=readppm(sprintf('%s/%d/%s',basedir,number,flist{index(i)}));
   im(:,:,i)=ppmunpack(temp)/255;
  end;
end
