Use impoly to extract region from dicomfiles

1 回表示 (過去 30 日間)
Hugo
Hugo 2013 年 12 月 2 日
コメント済み: Hugo 2013 年 12 月 2 日
Hi all,
At the moment i'm using impoly to extract an area from a dataset. Unfortunately some of the images do not show the needed area and therefore i don't ant to draw an ROI on these images. Does anybody know how i could skip an image without creating an ROI?
So dor example if i want to skip the first 5 and last 5 images how should i do that? My method looks like this. (for the first position a predefined pos is used)
if true
%
pause on
s=size (MRI);
for i = 1:s(3)
A = MRI(:,:,i);
imshow (A,[]);
h = impoly(gca,pos);
pos = wait(h);
pause;
pos = getPosition(h);
BW = createMask(h);
BWs = imcomplement (BW);
A(BWs) = 0;
Brain(:,:,i)= A
delete(h)
end
pause off
end

採用された回答

Image Analyst
Image Analyst 2013 年 12 月 2 日
編集済み: Image Analyst 2013 年 12 月 2 日
Put this code right after the imshow:
promptMessage = sprintf('Do you want to process this image?');
titleBarCaption = 'Draw ROI?';
button = questdlg(promptMessage, titleBarCaption, 'Yes', 'No-Skip it', 'Yes');
if strcmpi(button, 'No-Skip it')
continue;
end
  1 件のコメント
Hugo
Hugo 2013 年 12 月 2 日
Thanks a lot!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by