LoadAgilent.m 517 Bytes
%Loads a standard Agilent ResPro binary file (DMD, DRD, SEQ, etc)
%	Scalable Tissue Imaging and Modeling Laboratory
%	University of Houston
%	developer: David Mayerich (mayerich@uh.edu)

function S = stimLoadAgilent(filename)

    fid = fopen(filename);
    fseek(fid, 9, 'bof');
    Z = fread(fid, 1, 'uint16');
    fseek(fid, 13, 'cof');
    X = fread(fid, 1, 'uint16');
    Y = fread(fid, 1, 'uint16');
    
    fseek(fid, 1020, 'bof');
    
    S = reshape(fread(fid, [X, Y * Z], 'float32'), [X, Y, Z]);