% uses the SGI command `toppm' to convert vidtomem images to ppm images
% matlab on SGIs is located ...     alias m /mas/system/bin/matlab

hak('run toppm and delete original images ^c to stop')
hak('once again run this and DELETE ORIGINAL IMAGES')

disp('starting at k=170 since ran out of disk space there last time')
for k = 170:2:372

  dis('doing image %d',k)
  eval(sprintf('!toppm out_%05d.rgb pic%03d.ppm',k,k))

  eval(sprintf('!rm out_%05d.rgb',k))

  %data=[reshape(R.',1,MN) reshape(G.',1,MN) reshape(B.',1,MN)];
  %disp('for some reason, on SGIs, loadpnm gives blue in first channel')
  %disp('                                        red in second channel')
  %disp('                                        green in third channel')
  %disp('thus writing out in ``gbr'' order (inverse of above ordering)')
  %data=[reshape(G.',1,MN) reshape(B.',1,MN) reshape(R.',1,MN)];
  %eval(sprintf('saveraw(''data%d'',data)',k/2))
end%for

