필터 지우기
필터 지우기

How to display some images and select one to Crop it

조회 수: 1 (최근 30일)
Jose Andrés
Jose Andrés 2015년 4월 11일
댓글: Jose Andrés 2015년 4월 11일
Hello erveryone,
I need to display a directory with 300 dicom images, and one of them it is the one which I want to crop to work later in other function. I have created this function:
for z=1:size(directory)
archive = directory(z).name;
R3 = (dicomread(archive));
R3=imadjust(R3);
imshow(R3);
pause(3)
% cro=imcrop(R3);
end
I have included a 3 seconds pause to watch each image, but I don't know how to include the imcrop condition when I see the correct image to save this crop and get out of the function.
Could you help me?
Thanks!

채택된 답변

Image Analyst
Image Analyst 2015년 4월 11일
Put this in your loop:
promptMessage = sprintf('Do you want to Crop this image,\nor Skip this image?');
titleBarCaption = 'Continue?';
button = questdlg(promptMessage, titleBarCaption, 'Crop', 'Skip', 'Skip');
if strcmpi(button, 'Crop')
croppedImage = imcrop(R3);
end
  댓글 수: 1
Jose Andrés
Jose Andrés 2015년 4월 11일
Oh, thank you so much! That was exactly what I was looking for.
Thank you mate!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Explore and Edit Images with Image Viewer App에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by