Plot two overlapping surfaces on the same image

Hi All,
I am trying to plot two surfaces, one being a transparent interpolated surface of a heart and the second being a solid subset of that surface representing a voxel of interest. For some reason I cannot get the voxel surface to show up the way I want it to. My code and relevant files are attached. I appreciate any assistance with this. Thank you so much!

5 commentaires

Code doesn't run; variables are missing, e.g.:
Overlapping_Surfaces_Test
Unrecognized function or variable 'rgb_time_v'.

Error in Overlapping_Surfaces_Test (line 116)
num_points_v = length(rgb_time_v);
AN
AN le 20 Juil 2023
I'm so sorry, this code can be used instead.
Thanks, the new code runs.
isochronal_crowding
Region of interest contains 7 isochrones Ratio of red ie fastest points over total is 0 Ratio of orange points over total is 0.0010758 Ratio of yellow points over total is 0.051641 Ratio of green voltage points over total is 0.16138 Ratio of cyan voltage points over total is 0.22647 Ratio of blue voltage points over total is 0.30285 Ratio of purple voltage points over total is 0.1915 Ratio of pink ie slowest voltage points over total is 0.064551
Ratio of low voltage points over total is 0.27383 Ratio of border voltage points over total is 0.29022 Ratio of high voltage points over total is 0.43594
So how exactly do you want the plots to be different than they are?
AN
AN le 20 Juil 2023
Hi,
Thank you for your response. I want the last plot (transparent surface) overlaid by a solid surface of the voxel of interest (lines 653 of the original file sent in the previous methodwhich is commented as it does not work- ie I want a smooth surface version of the scatterplot created in the attached file on lines 581 to 592 overlapping on the transparent surface as a solid surface of interest.
AN
AN le 20 Juil 2023
An example figure of the voxel such as that I would like to create a solid surface to superimpose on the transparent surface is shown. I tried coding the interpolation the same way as I did for the original surface, however, the solid voxel does not show in the figure

Connectez-vous pour commenter.

 Réponse acceptée

Does this seem right?
isochronal_crowding
Region of interest contains 7 isochrones Ratio of red ie fastest points over total is 0 Ratio of orange points over total is 0.0010758 Ratio of yellow points over total is 0.051641 Ratio of green voltage points over total is 0.16138 Ratio of cyan voltage points over total is 0.22647 Ratio of blue voltage points over total is 0.30285 Ratio of purple voltage points over total is 0.1915 Ratio of pink ie slowest voltage points over total is 0.064551
Ratio of low voltage points over total is 0.27383 Ratio of border voltage points over total is 0.29022 Ratio of high voltage points over total is 0.43594
delete([1 2]) % remove first two figures for clarity
You'll see the following in the code (lines 655-656):
p = trisurf(K,x_points',y_points',z_points',colorCategory,'FaceAlpha',1,'EdgeColor','none');
p.FaceVertexCData(~ismember(x_points,x_v)) = NaN;
That creates a second (solid) trisurf patch using all the points (same points used in the first (transparent) trisurf patch), but then the faces that are not in the low-voltage data (x_v, y_v, z_v) are set to NaN so they don't show up and only the transparent surface is seen in those regions.

4 commentaires

AN
AN le 20 Juil 2023
Hi,
I apologize for all of the confusion. Actually I forgot to add in the code showing the scatterplot of the voxel region I want extrapolated and highlighted. It is a subset of the lower voltage areas. It is defined in lines 520 to 531. I am not too sure how to create a surface of this area to show over the transparent plot, as it is defined via voxel ID not xyz coords. I appreciate the surface you generated code for, as it is very useful! I want the same concept, except highlighting the cubic voxel of interest instead (as a smooth surface rather than scatterplot), over the transparent whole plot.
Thank you!
Like this?
isochronal_crowding_test
Region of interest contains 7 isochrones Ratio of red ie fastest points over total is 0 Ratio of orange points over total is 0.0010758 Ratio of yellow points over total is 0.051641 Ratio of green voltage points over total is 0.16138 Ratio of cyan voltage points over total is 0.22647 Ratio of blue voltage points over total is 0.30285 Ratio of purple voltage points over total is 0.1915 Ratio of pink ie slowest voltage points over total is 0.064551
Ratio of low voltage points over total is 0.27383 Ratio of border voltage points over total is 0.29022 Ratio of high voltage points over total is 0.43594
delete([1 2 3])
New code for partial solid patch:
p = trisurf(K,x_points',y_points',z_points',colorCategory,'FaceAlpha',1,'EdgeColor','none');
p.FaceVertexCData(voxelIDs ~= i_max) = NaN;
AN
AN le 20 Juil 2023
Yes perfect! I didn't think to be able to specify the voxel ID the way you did; Thank you so much for helping me!
Voss
Voss le 21 Juil 2023
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2019a

Question posée :

AN
le 20 Juil 2023

Commenté :

le 21 Juil 2023

Community Treasure Hunt

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

Start Hunting!

Translated by