How to plot a point in 3D data displayed in volume Viewer?

12 次查看(过去 30 天)
I have a 3D medical image.
I want to mark a certain point in that image and display the 3D image with volumeViewer.
The point has x,y,z coordinates.
How can I plot this point into the 3D image and display both in volume Viewer?
  4 个评论
Dunja Gorup
Dunja Gorup 2023-4-24
XYZCoordinates_Array was positive integers array (:,:,:).
I(XYZ)=true; %does not preform as expected for e.g. XYZ=[10,13,9;12,11,8;1,2,3;3,4,5;1,7,5];
I(XYZ(1,:))=true % does not produce the same result as I(10,13,9)=true;
The solution was achieves by sub2index as below.
Rik
Rik 2023-4-25
The reason why this is the case, is that the indexing does not produce a comma separated list. You can produce such a list with a struct array and with a cell array:
XYZ=[10,13,9;12,11,8;1,2,3;3,4,5;1,7,5];
XYZ(1,:) % normal array
ans = 1×3
10 13 9
tmp = num2cell(XYZ);
tmp{1,:} % comma separated list
ans = 10
ans = 13
ans = 9

请先登录,再进行评论。

采纳的回答

Selva Karna
Selva Karna 2020-1-28
To view 3d Volume:
clc
clear all;
close all;
your volume=V;
volshow(V)
3Point view:
% Make mask 3d based on your 3d points
len=length(your 3d points);
% Create Mask
3d_mask=zeros(your_3d points(size));
3d_mask(:,:,:)=your_3d_mask_holes;
volshow(3d_mask)
  4 个评论
Dunja Gorup
Dunja Gorup 2023-4-24
Following solution worked by subindexing:
AL=zeros(50,50,50);
XYZ=[10,13,9;12,11,8;1,2,3;3,4,5;1,7,5];
ind = sub2ind(size(AL), XYZ(:,1), XYZ(:,2), XYZ(:,3));
AL(ind) = true;
volshow(AL);
Dunja Gorup
Dunja Gorup 2023-4-25
However, this mask is sometimes offset to the original image from which the voxel values were derived. Probably due to some transformation?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by