필터 지우기
필터 지우기

colormap/caxis edit roipoly

조회 수: 5 (최근 30일)
William
William 2014년 11월 20일
편집: Charlotte Chaze 2018년 2월 20일
I would really appreciate help on this one,
Using roipoly to isolate data but when the function displays the initial image I want to draw on, the scaling is all wrong and it just shows a black image.
Applying colormap or caxis on figure editor shows the scaling is wrong but the below code does nothing. How can I set caxis on roipoly figure?
e.g.
BW = roipoly(img)
colormap hot
caxis([0 1000])
Many thanks, Will

채택된 답변

Image Analyst
Image Analyst 2014년 11월 20일
Don't pass in img - I never do. Just set up the image in advance as far as how you want it to look.
imshow(img, []);
colormap(hot(256));
colorbar;
mask = roipoly;
  댓글 수: 1
William
William 2014년 11월 20일
Fantastic, thanks :)

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

추가 답변 (1개)

Charlotte Chaze
Charlotte Chaze 2018년 2월 20일
편집: Charlotte Chaze 2018년 2월 20일
The previously accepted answer doesn't work for me in R2017b - here is what does, using OP's example img.
When you use roipoly, it resets caxis to [0 1]. So just change the scale in your img to [0 1]. In this case, here are the series of commands you'd use:
Use 'caxis' to find out what the scale of your image is.
caxis
Say it's [0 1000]. This will give back
ans = [0 1000]
Now, divide your img by 1000 to reduce the caxis to [0 1]. Then use roipoly on that.
img = img ./ 1000
mask = roipoly(img)

카테고리

Help CenterFile Exchange에서 Orange에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by