matlab - How show two images in a figure -
I need to show two 3D images using a figure, I used alpha (0.5) but I The problem with color space is this is my code:
%%%%%%%%%%%%%%%%%%Liver%%%%%%%% %%%%%%%%%%%%% liver_surf1 = isosurface (nii.img (:, end-1: 1, :), 0.05); V = liver_surf1.vertices; F = liver_surf1.faces; T = Trisurf (F, V (V::, 1), V (:, 2), V (:, 3), 'fesalafa', 0.5, 'facecollar', Rangamand ([1 0]); % Red Color Shading Flat; Wait; . Isosurface (nii.img (:, end-1: 1, end-1: 1), 0.05); V2 = liver_surf.vertices; F2 = liver_surf.faces; T2 = Trisurf (F2, V2 (:, 1), V2 (:, 2), V2 (:, 3), 'feslafa', 0.5, 'facsolger', kelpapp ([0 0]) ); % Green color
And its result is:
The problem is that the colors of both images turn to green, if I participate differently then okay but I can not combine both images together. So when I add "Shading Flat" then it happens like this:
How can I be together with red and green? Thanks
These are two separate liver, which should be shown with transparency in the image because they have intersection.
I wonder if this code also works (which version of MATLAB?), I It is expected that trisurf
is any type of error, colormap
is a function that sets the stage of the image, not the individual surfaces You set the colors in green, all things will be green.
If you want to set the caller data, C
, the same value as the size of your z, then adjust the stage to give you the correct color. Here's an easy way:
trisurf (f, v (:, 1), v (:, 2), v (:, 3), zero (size (v (:, 3) )))); % Cdata = 0 trisurf (F2, V2 (:, 1), V2 (:, 2), v2 (:, 3), having (size (v2 (:, 3))); % Cdata = 1 colormap ([0 0 0; 0 0]);
It basically creates two surfaces, one with all the color values at zero and all the color values on each other. Colormap changes the call theater so there are only two values in red (zero) and green (a). (You should also work if you add fissile etc).
Comments
Post a Comment