Effacer les filtres
Effacer les filtres

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

16 vues (au cours des 30 derniers jours)
M W
M W le 27 Jan 2020
Commenté : Rik le 25 Avr 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 commentaires
Dunja Gorup
Dunja Gorup le 24 Avr 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 le 25 Avr 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

Connectez-vous pour commenter.

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 3-D Volumetric Image Processing dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by