rd_imgser.m

来自「cell migration resource imaging icsmatla」· M 代码 · 共 23 行

M
23
字号
function image_data=rd_imgser(filename,sizex,sizey,numimg)
%sizex and sizey are dimensions of image
%numimg is the number of images in the series
% if display_tag = 1, figure of large matrix is displayed

%Reads whole raw file as big 2D matrix

h = waitbar(0,'Reading RAW file...');
fid_image=fopen(filename,'r','l'); 
bigmatrix = fread(fid_image,[sizex,sizey*numimg],'uchar');
bigmatrix = bigmatrix';

% Splits large 2D matrix into 3D matrix, where each z slice is an image

waitbar(0.5,h,'Generating Image Series...');
image_data = zeros(sizey,sizex,numimg);  % preallocate 3-D array 

for frame=1:numimg
    for pixel=((frame-1)*sizey)+1:frame*sizey
    image_data(pixel-(frame-1)*sizey,:,frame) = bigmatrix(pixel,:);
    end
end
close(h)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?