How to plot a point in 3D data displayed in volume Viewer?
Show older comments
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 Comments
Dunja Gorup
on 24 Apr 2023
I have a same question.
Logical indexing is not working.
E.g.
I=logical(zeros(size(Your_volume_size)));
I(XYZCoordinates_Array)=true; %not working
volshow(I); %displays only a line, not a shape, or point cloud. ptcloud, volumes and lines are not supported to display by volshow with logical masks. The answer below does not do anything, even though it was accepted.
Thank you very much
Rik
on 24 Apr 2023
What value does XYZCoordinates_Array have? And what do you interpret as not working?
Dunja Gorup
on 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.
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
tmp = num2cell(XYZ);
tmp{1,:} % comma separated list
Accepted Answer
More Answers (0)
Categories
Find more on Display 2-D Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!