Create 3D Volume of interest (VOI)

조회 수: 10 (최근 30일)
Hugo
Hugo 2013년 11월 26일
댓글: Hugo 2013년 11월 27일
Hi all,
I am trying to create a 3D volume of interest (VOI), using imfreehand as in the script below. At the moment it's working but i have to draw my ROI at every single slide. Does anybody know whether it is possible to keep the region of the first slide and adjust it in the next slides?
if true
%
s = size (MRI1);
for i = 1:s(3);
A = MRI1(:,:,i);
imshow (A,[]);
h = imfreehand(gca);
BW = createMask(h);
BWs = imcomplement (BW);
A(BWs)=0;
MRIm (:,:,i) = A;
end
end

채택된 답변

Sean de Wolski
Sean de Wolski 2013년 11월 26일
A thought:
You could use imfreehand on the first slice. imfreehand does not have a 'Position' option that you can set. However, impoly does, so use impoly on the subsequent slices.
I = imread('cameraman.tif');
imshow(I);
hax=gca;
hf = imfreehand(hax);
wait(hf);
for ii = 2:2
pos = getPosition(hf);
%You would create mask etc. before deleting
delete(hf);
hf = impoly(hax,pos);
end
Can you post an example image? Perhaps there's a way to automate or semi-automate this process so you don't have to repeat this at each slice.
  댓글 수: 4
Sean de Wolski
Sean de Wolski 2013년 11월 26일
If I had to do this and only needed semi automation, I would take your freehand mask from above and use that as the initial mask in activecontour. Then let active contour do the work. For each subsequent slice, I'd use the previous slice's mask as the initial mask for the active contours.
Or you could fully automate this using a threshold and morphological operations. It's hard to say without knowing your requirements.
Hugo
Hugo 2013년 11월 27일
Basically the only requirement is to extract the brain from everything else, which doesn't have to be automatically.
Unfortunately i want to be enabled to change my roi in every loop, i understood getPosition gives me the coordinates of my ROI, but how do i create a line which gives me my previous MRI, but adaptable, and transfers me to the next slide when i complete my roi.
The script below is what i have at the moment, but i need to implement a specific instruction which allows me to close one slide, save the roi, go to the next slide and start there with the saved ROI, which should be adaptable, i tried to use getPosition and setPosition for this but i'm not sure how to implement them.
if true
%
s=size (MRIsag);
for i = 1:s(3)
A = MRIsag(:,:,i);
imshow (A,[]);
h = impoly(gca);
BW = createMask(h);
BWs = imcomplement (BW);
A(BWs) = 0;
Brain(:,:,i)= A;
end
end

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

추가 답변 (0개)

카테고리

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