Display isosurface patch and pcshow surface together.

조회 수: 4 (최근 30일)
Tyce
Tyce 2022년 11월 18일
편집: Charu 2025년 2월 19일
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