nameOfFile.SPE files from Princeton CCD camera read by Matlab





%reads *.SPE files into Matlab
%    this program may contain errors -> evr@u.washington.edu
%use at your own risk
fid=fopen('nameOfFile.SPE','r');
header=fread(fid,2050,'uint16'); %4100bytes/2
ImMat=fread(fid,1024*1024,'uint16');
Z=reshape(ImMat,1024,1024);
fclose(fid);
Z=double(Z);
Z=rot90(Z);
[X,Y]=meshgrid(1:1024,1:1024);
mesh(X,Y,Z); % display 3D plot
view(90,90);

% print -djpeg99 nameOfFile.jpg  % creat high res. jpg file