Display isosurface patch and pcshow surface together.

5 visualizzazioni (ultimi 30 giorni)
Tyce
Tyce il 18 Nov 2022
Modificato: Charu il 19 Feb 2025
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');

Risposte (1)

Charu
Charu il 18 Feb 2025
Modificato: Charu il 19 Feb 2025
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);

Categorie

Scopri di più su DICOM Format in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by