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

📄 serimcrop.m

📁 cell migration resource imaging icsmatlab
💻 M
字号:
function [crop,rect] = serimcrop(series);

% Crops a region of an image series, and outputs a smaller 3D matrix
% While loop ensures user is satisfied with choice
% If prime is 1, function will not accept a region with a prime dimension

ok = 'n';
figure

while ok == 'n'
colormap(hot(256));
imagesc(series(:,:,1))
title('Please select a region');
[im, rect] = imcrop;
close;
rect = floor(rect);

crop = zeros(rect(4)+1,rect(3)+1,size(series,3)); % Pre-allocates matrix

for i=1:size(series,3)
    crop(:,:,i) = imcrop(series(:,:,i),rect);
end

ok = 'y';
% disp('You have selected the following area')
% imgmovie(crop,0)
% ok = input('Are you satisfied? (y/n)', 's');

% if prime == 1
%     if or(isprime(size(crop,1)),isprime(size(crop,2)))
%     errordlg('You have selected an area with a prime dimension.  Please select again.','Fourier Transform Error')
%     ok = 'n';
%     end
% end

end

⌨️ 快捷键说明

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