Hello fellows. I have a code which dicom slice images are shown through imagesc and uicontrol. It works fine. However, I would like to use imshow instead of imagesc, but keeping the slider on the windows.
I figured that imshow with uicontrol does not work... So, is there anything in that sense I could do?
Thanks in advance
figure(10), imagesc(I10(:,:,1)); title('ROI');
hf9 = uicontrol('Style', 'Slider', 'SliderStep', [1/24 1], 'Value', 1, 'Min', 1, 'Max', 25, 'Callback', 'callbackslider_tocrop10');
hpop = uicontrol('Style', 'popup', 'String', 'hsv|hot|cool|gray|jet', 'Position', [300 0 50 25], 'Callback', 'setmap');

 채택된 답변

Image Analyst
Image Analyst 2015년 7월 1일

0 개 추천

Did you try imshow():
imshow(I10(:,:,1));
I would imagine so, so what went wrong?

댓글 수: 4

drummer
drummer 2015년 7월 1일
Hi Image Analyst. Yes, I did try it. I did the changes in the function callbackslider_tocrop10 as well, which the slider is applied on I10. But it did not work. I am using R2010a by the way.
drummer
drummer 2015년 7월 1일
편집: drummer 2015년 7월 1일
%CallBack to run over the slices in the transverse axis
figure(1),imshow(I10(:,:,get(hf,'Value')));
title(num2str(get(hf,'Value')));
Bellow there is the error. It appears when I try to slide in the window.
??? Error using ==> get Invalid handle object.
Error in ==> callbackslider01 at 3 title(num2str(get(hf,'Value')));
??? Error while evaluating uicontrol Callback
drummer
drummer 2015년 7월 1일
Just had to set the displayrange calling imshow =P Thanks Analist.
That doesn't sound right. It looks like it's saying that it doesn't know what hf is. What is hf? If you want the slider value, do this:
% Get the value from the slider. It might be a fractional number
sliderValue = get(handles.slider1, 'Value');
% Make sure it's an integer
sliceNumber = round(sliderValue);
if sliceNumber > 1 && sliceNumber <= size(I10, 3)
imshow(I10(:,:, sliceNumber));
caption = sprintf('Slice #%d', sliceNumber);
title(caption, 'FontSize', 24);
end
Replace slider1 with whatever the actual tag of your slider is.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 DICOM Format에 대해 자세히 알아보기

질문:

2015년 7월 1일

댓글:

2015년 7월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by