필터 지우기
필터 지우기

Draw on a 3D volume in MATLAB

조회 수: 2 (최근 30일)
Fatma Elzahraa Ahmed
Fatma Elzahraa Ahmed 2017년 1월 30일
댓글: Fatma Elzahraa Ahmed 2017년 1월 31일
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
red=t;
green=t;
blue=t;
for i=1:size(indx,1) %indx: indexes of the featured coordinates
red(indx(i,1),indx(i,2))=255;
green(indx(i,1),indx(i,2))=0;
blue(indx(i,1),indx(i,2))=0;
end
out=cat(3,red,green,blue);
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:
for i=1:size(indx,1)
red(indx(i,1),indx(i,2),indx(i,3))=255;
green(indx(i,1),indx(i,2),indx(i,3))=0;
blue(indx(i,1),indx(i,2),indx(i,3))=0;
end
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
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.
  댓글 수: 3
Walter Roberson
Walter Roberson 2017년 1월 31일
I suggest that you have a look in the File Exchange at the various slice routines.
Fatma Elzahraa Ahmed
Fatma Elzahraa Ahmed 2017년 1월 31일
I tried another way. Rather than representing what I need using the color, I draw shapes (e.g plus) to define the needed points. Thank you very much for your help.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by