产生随机分叶肺结节轮廓的想法 [英] Ideas for generating random lobulated pulmonary nodule contours
本文介绍了产生随机分叶肺结节轮廓的想法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要生成随机分叶轮廓,如下所示
关于如何做到这一点的任何想法或算法?
我将要使用的软件是matlab,但是如果您以其他语言发布解决方案,我也没有问题...
ps我只需要绘制一个类似于上面的随机轮廓...
解决方案
这样如何?
degree = 5;
numPoints = 1000;
blobWidth = 5;
theta = 0:(2 * pi)/(numPoints-1):2 * pi;
coeffs = rand(degree,1);
rho = zeros(size(theta));
for i = 1:degree
rho = rho + coeffs(i)* sin(i * theta);
end
phase = rand * 2 * pi;
[x,y] = pol2cart(theta + phase,rho + blobWidth);
plot(x,y)
轴等于
set(gca,'Visible','off')
您可以通过修改度
来控制的抖动。我认为5给出了一些关于如你所举的例子那样宽大的摇摆乐。
这很有趣 - 希望它有帮助!
I need to generate random lobulated contours such as the following
Any ideas or algorithms on how to do this ?? The software I am going to use is matlab, however I have no problem if you post solutions in other languages too...
p.s I only need to plot a random contour that resembles the above...
解决方案
How about this?
degree = 5;
numPoints = 1000;
blobWidth = 5;
theta = 0:(2*pi)/(numPoints-1):2*pi;
coeffs = rand(degree,1);
rho = zeros(size(theta));
for i = 1:degree
rho = rho + coeffs(i)*sin(i*theta);
end
phase = rand*2*pi;
[x,y] = pol2cart(theta+phase, rho+blobWidth);
plot(x,y)
axis equal
set(gca,'Visible','off')
You can control the wiggliness lobulacrity by modifying degree
. I think 5 gives something about as wiggly lobulacious as your example.
That was fun - hope it helps!
这篇关于产生随机分叶肺结节轮廓的想法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文