【问题标题】:Mesh plot threshold in MatLabMatLab 中的网格图阈值
【发布时间】:2013-11-20 16:43:50
【问题描述】:

我正在使用一种算法来确定 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)

我正在尝试将截止值应用于网格图,类似于我将阈值应用于原始图像的方式。

非常感谢任何帮助。

谢谢

【问题讨论】:

    标签: matlab image-processing mesh


    【解决方案1】:

    查看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]);
    

    握住轴手柄可让您随时在任何绘图上设置参数,而不仅仅是处理您正在处理的最后一个。

    最后一点:尝试使用图像功能而不是 imshow。不完全一样,但你可能会发现你根本不需要使用图像处理工具箱。

    【讨论】:

    • 感谢您的回复,波特。当我尝试使用您建议的代码时,我收到以下错误:使用 set Bad property value found 时出错。对象名称:表面属性名称:'CLimInclude'。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-04
    • 2013-03-16
    • 1970-01-01
    相关资源
    最近更新 更多