Rank: 189975 based on 0 downloads (last 30 days) and 0 files submitted
photo

Uli Kleßinger

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Uli
Updated File Comments Rating
10 Jan 2011 Andor SIF image reader Read Andor SIF multi-channel image files. Author: Marcel Leutenegger

@ Matt and users for SCMOS

I used it to read the data from a cinetic Sif-File from an Andor SCMOS Camera. Therefore i had to change the readSection to the following:

function [info]=readSection(f, currentFrameNumber)
o=fscanf(f,'%d',6);
info.date=datestr(o(5)/86400 + 719529);
info.temperature=o(6);
skipBytes(f,10)
o=fscanf(f,'%f',5);
info.exposureTime=o(2);
info.cycleTime=o(3);
info.accumulateCycles=o(5);
info.accumulateCycleTime=o(4);
skipBytes(f,2)
o=fscanf(f,'%f',2);
info.stackCycleTime=o(1);
info.pixelReadoutTime=o(2);
o=fscanf(f,'%d',3);
info.gainDAC=o(3);
skipLines(f,1)
info.detectorType=readLine(f);
info.detectorSize=fscanf(f,'%d',[1 2]);
info.fileName=readString(f);
info.possibleBitDepth=fscanf(f,'%d',[1 2]);
skipLines(f,3)
skipBytes(f,14)
info.shutterTime=fscanf(f,'%f',[1 2]);
skipLines(f,18)

info.imageAxis=fscanf(f,'%s',3);
info.currentBitDepth = 11;
o=fscanf(f,'%d %d %d %d %d %d %d %d 65538 %d %d %d %d %d %d',14);
info.imageArea=[o(1) o(4) o(6);o(3) o(2) o(5)];
info.frameArea=[o(9) o(12);o(11) o(10)];
info.frameBins=[o(14) o(13)];
s=(1 + diff(info.frameArea))./info.frameBins;
z=1 + diff(info.imageArea(5:6));
info.numberOfFrames = z;
info.resolution = s;
info.pixelPerFrame = prod(s);

skipLines(f,1)
info.timeStamps = fscanf(f,'%d\n', info.numberOfFrames);
    
if currentFrameNumber <= info.numberOfFrames
    
    info.timeStamp = info.timeStamps(currentFrameNumber);
    num_bytes_to_skip_for_curr_frame = 4 * ((currentFrameNumber-1) * info.pixelPerFrame);
    
    fseek(f, num_bytes_to_skip_for_curr_frame, 'cof');
    fseek(f, 2, 'cof'); %keine ahnung warum 2 byte offset..
    if prod(s) ~= o(8) || o(8)*z ~= o(7)
       fclose(f)
       error('Inconsistent image header.');
    end

    info.imageData=reshape(fread(f,info.pixelPerFrame,'single=>single'), info.resolution);
end

Contact us at files@mathworks.com