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

조회 수: 19 (최근 30일)
M W
M W 2020년 1월 27일
댓글: Rik 2023년 4월 25일
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