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 件のコメント

Voss
Voss 2023 年 7 月 20 日
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 2023 年 7 月 20 日
I'm so sorry, this code can be used instead.
Voss
Voss 2023 年 7 月 20 日
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 2023 年 7 月 20 日
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 2023 年 7 月 20 日
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

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

 採用された回答

Voss
Voss 2023 年 7 月 20 日

1 投票

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 件のコメント

AN
AN 2023 年 7 月 20 日
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!
Voss
Voss 2023 年 7 月 20 日
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 2023 年 7 月 20 日
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 2023 年 7 月 21 日
You're welcome!

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

その他の回答 (0 件)

カテゴリ

製品

リリース

R2019a

質問済み:

AN
2023 年 7 月 20 日

コメント済み:

2023 年 7 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by