删除切片中的小值 [英] Removing small values in slice

查看:134
本文介绍了删除切片中的小值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何删除切片图中的较小值? 在我的绘图中,基本上有太多蓝色,而我看不到里面的红色点.

How can I delete the small values in a slice plot? In my plot, there is basically too much blue and I cannot see the red points inside.

或者,稍有不同:

*是否可以使用matlab删除切片图中的某些点?

*Is it possible delete some points in a slice plot with matlab?

slice(X,Y,Z,V,sx,sy,sz)表示由sx,sy和sz定义的整个计划上的体积V的值.但是我可以选择只保留这些计划的某些要点吗?

slice(X,Y,Z,V,sx,sy,sz) represents the value of the volume V on the whole plans defined by sx,sy and sz. But can I choose to keep some points of these plans only?

  • 我们是否必须在整个计划中表示V的值?

  • Do we have to represent the values of V on the whole plan?

我可以使小值"透明吗?

Can I make "small values" transparent?

编辑 新代码:

h =slice(x,y,z,V,sx,sy,sz);
for n=1:length(h)
    set(h(n), 'alphadata',get(h(n),'cdata'), 'facealpha','flat');   
end
a = alphamap('rampup',256);
a(a<(threshold)) = 0;
a(a>(threshold)) = 0.07;
alphamap(a);

我尝试使用上面的代码.但是,这是我得到的情节: 我认为cdata(颜色)有问题,但我不知道这是什么...

I tried with the code above. However, this is the plot I am getting: I think there is a problem with cdata (the colors) but I can't figure out what this is...

推荐答案

您可以调整透明度,以便较低的值更加透明.首先,您需要切片的句柄:

You can adjust the transparency so lower values are more transparent. First, you need the handles to your slices:

h = slice(X,Y,Z,V,sx,sy,sz);

h不是单个句柄,而是针对不同片的一系列句柄.对于任何一个句柄,您都可以更改透明度(或为所有n循环以更改所有透明度):

h is not a single handle but a series of handles to the different slices. For any one handle you can change the transparency (or loop around for all n to change them all):

set(h(n),'alphadata',get(h(n),'cdata'),'facealpha','flat');

alphadata是透明度的数据-默认情况下为"1"(不透明),因此对于每个句柄,您可以将其设置为cdata的内容.默认情况下AlphaDataMapping应该已经设置为scaled-因此alphadata中的值被映射到alpha贴图,就像cdata值被映射到您的色图一样(稍后会详细介绍).

alphadata is the data for transparency - by default this is "1" (opaque), so instead for each handle you can set it to the contents of cdata. AlphaDataMapping should already be set to scaled by default - so the values in alphadata are mapped to an alphamap, just as cdata values are mapped to your colormap (more on that later).

facealpha是有关如何将alphadata应用到对象面部的设置-需要进行更改,以便实际使用alphadata中的值.

facealpha is a setting for how the alphadata is applied to the faces of an object - needs to be changed so that the values in alphadata are actually used.

如果要调整透明度值的透明度或透明度,可以更改Alpha贴图.默认贴图只是线性的,可以通过plot(get(gcf,'Alphamap'))看到,其中0 =不可见,1 =不透明.地图的长度可以变化,因此您可以自由调整它的位置-例如,如果您对这些值不感兴趣,则可以将下部完全清零:

If you want to adjust how transparent values are or which are transparent, you can change the alphamap. The default map is just linear and can be seen by plot(get(gcf,'Alphamap')), where is 0 = invisible and 1 = opaque. The length of the map can vary so you have a lot of freedom in adjusting it - for example you can completely zero out the lower part if you're not interested in those values:

a = alphamap('rampup',256);
a(1:80)=0;
alphamap(a); % only changes alphamap of current figure

在Matlab 此处中详细了解透明度. >.

Read more about transparency in Matlab here.

这篇关于删除切片中的小值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆