How can I have impixelinfo give me pixel numbers rather than axis values?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nicholas
am 7 Apr. 2014
Kommentiert: Nicholas
am 7 Apr. 2014
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.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 7 Apr. 2014
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 Kommentare
Image Analyst
am 7 Apr. 2014
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!