Dienstag, 26. April 2011

Motic Microscope Camera SFC File Format

The Motic Microscope Camera software stores all images in their proprietary file format with extension ".sfc". Tthis simply contains binary pixel data. It can be viewed with Matlab with the following commands:

fid=fopen('Capture_4.sfc','r');
% read width and height information
fseek(fid,11,'bof');
Width  = fread(fid,1,'uint32=>uint32')
Height = fread(fid,1,'uint32=>uint32')
% read the image
fseek(fid,273,'bof');
rgb=fread(fid,Width*Height*3,'uint8=>uint8');
fclose(fid);
% reshape 1xN vector to Width x Height x 3 (RGB) vector
rgb=permute(reshape(rgb,3,Width,Height),[3,2,1]);
image(rgb);
Note that this code was only tested with images directly saved after capture without any edits.

Keine Kommentare: