Draw on a 3D volume in MATLAB
2 ビュー (過去 30 日間)
I have a 3D brain volume (x, y) coordinates and z=slices. For this volume, I have specific coordinates (that reflects some features) and I want to highlight these coordinates (e.g. through drawing with specific color). I searched and found a code like that:
t=image; % gray scale image
for i=1:size(indx,1) %indx: indexes of the featured coordinates
The problem is that, this code works with gray scale image. When I tried to generalize it to the volume I got something with the size:(x,y,z,3) through:
out = cat(4, red, green, blue);
Is this generalization right? if so, how to show the resulting slices with the colored parts?
回答 (1 件)
Walter Roberson 2017 年 1 月 31 日
Yes, that should work, if you use it together with a routine such as vol3d v2 from the File Exchange.
Other viewer routines might prefer that the RGB be the 3rd dimension rather than 4th, but vol3d prefers RGB to be the 4th dimension.