フィルターのクリア

Not the correct color on volshow

10 ビュー (過去 30 日間)
Matteo Bonhomme
Matteo Bonhomme 2023 年 4 月 19 日
コメント済み: Matteo Bonhomme 2023 年 10 月 9 日
Hello,
I have this code
V_test=zeros(100,100,100);
V_test(10:20,10:20,10:20)=deal(1);
V_test(80:90,10:20,10:20)=deal(2);
V_test(45:55,45:55,45:55)=deal(3);
value=0:3;
color=[0,0,0;1,0,0;0,1,0;0,0,1];
queryPoints=linspace(min(value),max(value),256);
colormap = interp1(value,color,queryPoints);
figure(1)
myvol=volshow(V_test,Colormap=colormap);
I want the grey cube to be blue. It is blue on certain angle wich lead me to think it's a reflection issue but I'm not sure at all.
If anyone who's more familiar with volume rendering can help me that would be gratly appreciated :)

採用された回答

Sufiyan
Sufiyan 2023 年 4 月 27 日
Hi,
You can refer to the below code.
V_test=zeros(30,30,30);
% first cube
V_test(10:20,10:20,10:20)=1;
% second cube
V_test(80:90,10:20,10:20)=2;
% third cube
V_test(45:55,45:55,45:55)=3;
value=0:3;
color=[0,0,0;0.2,0.8,0;0,0,1;1,0,0];
queryPoints=linspace(min(value),max(value),256);
colormap = interp1(value,color,queryPoints);
figure(1)
myvol=volshow(V_test,'Colormap',colormap);
% Change the rendering method to MIP
myvol.RenderingStyle = 'VolumeRendering';
% Adjust the view angle of the MIP projection
view([30,30]);
hope this helps!
  1 件のコメント
Matteo Bonhomme
Matteo Bonhomme 2023 年 10 月 9 日
Hello,
Sorry for coming back to you after so long.
This is helping thank you :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRed についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by