Azzera filtri
Azzera filtri

Not the correct color on volshow

10 visualizzazioni (ultimi 30 giorni)
Matteo Bonhomme
Matteo Bonhomme il 19 Apr 2023
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 :)

Risposta accettata

Sufiyan
Sufiyan il 27 Apr 2023
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 Commento
Matteo Bonhomme
Matteo Bonhomme il 9 Ott 2023
Hello,
Sorry for coming back to you after so long.
This is helping thank you :)

Accedi per commentare.

Più risposte (0)

Tag

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by