⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rd_imgser.m

📁 cell migration resource imaging icsmatlab
💻 M
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -