How can I have impixelinfo give me pixel numbers rather than axis values?

5 次查看(过去 30 天)
I have a figure in a GUI I am making created with imagesc that I then apply impixelinfo to, because I need to know the pixel locations of certain features. However, since I am also applying axis ranges, for example:
imagesc(xAx,yAx,axesVideoFocus(:,:,currentSlice))
where xAx and yAx are vectors describing the x and y axes, impixelinfo is returning me the values of xAx and yAx rather than the pixel number I am hovering over. So say I am over pixel 32, 5. What I actually get out of impixelinfo are the x and y axis values at that pixel, instead of (32,5).
Thanks for any help.

采纳的回答

Image Analyst
Image Analyst 2014-4-7
Then don't put in axis calibration factors. Just do this:
imagesc(axesVideoFocus(:,:,currentSlice))
assuming axesVideoFocus is the name of your 3D image variable.
  5 个评论
Image Analyst
Image Analyst 2014-4-7
You can turn "axis on" which will show the tick marks in pixels, but THEN, you can redefine the tick marks to be whatever you want. So use sprintf() to create a brand new set of tick marks that displays in your custom calibrated units. Look up help on tick marks or tick labels to see how to do it.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by