2013-11-20 54 views
0

我正在使用算法来确定MATLAB中图像分析的阈值。该算法测量核内的所有像素强度,并计算用作截断的值以区分背景噪声和前景。我知道如何将这个值应用于原子核的图像,以查看截断的影响,但我想将阈值应用到网格图上。一次偶然的机会,没有人知道如何做到这一点,我不能发表图片,但是我已经加了我的图像分析的示例代码MatLab中的网格图阈值

example image of nucleus

% First I load image 
i = imread('nucleus.tif') 
% I calculate the value of the threshold using my algorithm using my function 
ci99 = getCI99('nucleus.tif') 
% say for example that the calculated value is 100. I would apply this threshold to the image of the nucleus with the following command 
imshow(picture , [ 100, inf]) % The resulting image only shows pixels at and above the calculated threshold. 

我用下面的代码,以使核

的网格图
% Mesh Plot 
I=imread('nucleus.tif'); 
[x,y]=size(I); 
X=1:x; 
Y=1:y; 
[xx,yy]=meshgrid(Y,X); 
i=im2double(I); 
figure;mesh(xx,yy,i); 
colorbar 
figure;imshow(i) 

我想将截断应用于网格图,类似于我将阈值应用于原始图像的方式。

我真的很感激任何帮助。

感谢

回答

0

退房的Matlab clim function

,你应该能够做到这一点:

clim([min_threshold max_threshold]); 

您也可以通过按住上轴手柄(有点像指针)访问特定地块

fig1 = figure; 
ax1 = mesh(xx,yy,i); 
colorbar; 

fig2 = figure; 
ax2 = imshow(i); 

set(ax1, 'clim', [100, inf]); 

握住轴手les让你可以随时在任何情节中设置参数,而不仅仅是处理你正在使用的最后一个。

最后注意:尝试图像功能,而不是imshow。它不完全相同,但是您可能会发现根本不需要使用图像处理工具箱。

+2

我很感谢您的回应Potter。当我尝试使用您建议的代码时,出现以下错误:使用集合错误 找到错误的属性值。 对象名称:surface 属性名称:'CLimInclude'。 – DataTx