Display isosurface patch and pcshow surface together.

7 次查看(过去 30 天)
I have this pcshow surface plot with intensity values recognizing the distance. I also have an isosurface plot of the same location. However their sizes are not matching up. Here is the plot:
The isosurface is from a volume of a CT dicom series. To match these should I try to make the isosurface into a pointCloud and pcshow it as well?
Here is the isosurface patch code:
[x1, y1, z1, D] = subvolume(I_crop, limits);
[fo,vo] = isosurface(x1,y1,z1,D,0.5);
[fe,ve,ce] = isocaps(x1,y1,z1,D,0.5);
figure
p1 = patch('Faces', fo, 'Vertices', vo);
p1.FaceColor = 'red';
p1.MarkerSize = 100;
p1.EdgeColor = 'none';
rotate(p1,[0 0 1],90);
axis equal; axis tight
set(gca,'xdir','reverse','ydir','reverse');

回答(1 个)

Charu
Charu 2025-2-18
编辑:Charu 2025-2-19
Hello Tyce,
It seems that you are working on plotting a "pcshow" surface plot alongside an "isosurface" plot, and there is a mismatch in their sizes. This could occur if both plots are not aligned within the same coordinate system. Additionally, please ensure that the scaling and translation of both datasets are consistent. If the "isosurface" and point cloud originate from different sources, they may require adjustments in scaling or translation to align correctly.
You can refer to the below code snippet:
ptCloud = pointCloud([pcX, pcY, pcZ]);
% Define the grid size for the isosurface
gridSize = 50;
Define a scalar field (e.g., a sphere)
scalarField = x.^2 + y.^2 + z.^2;
% Define the isosurface value
isoValue = 25;
figure;
hold on;
isosurfaceHandle = isosurface(x, y, z, scalarField, isoValue);
patch(isosurfaceHandle, 'FaceColor', 'red', 'EdgeColor', 'none', 'FaceAlpha', 0.5);
colormap('parula'); % Use 'parula' colormap
camlight;
lighting gouraud;
pcshow(ptCloud, 'MarkerSize', 50);

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by