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

21 Ansichten (letzte 30 Tage)
M W
M W am 27 Jan. 2020
Kommentiert: Rik am 25 Apr. 2023
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 Kommentare
Dunja Gorup
Dunja Gorup am 24 Apr. 2023
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 am 25 Apr. 2023
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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Selva Karna
Selva Karna am 28 Jan. 2020
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 Kommentare
Dunja Gorup
Dunja Gorup am 24 Apr. 2023
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 am 25 Apr. 2023
However, this mask is sometimes offset to the original image from which the voxel values were derived. Probably due to some transformation?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by