File Exchange

image thumbnail

ginput2.m v3.1 (Nov 2009)

Same as GINPUT but with ZOOM, PAN and (optionally) PLOT and image SCALE/GEOREFERENCE!

4.22222
9 Ratings

27 Downloads

Updated

View License

Do you still use GINPUT to graphically select points on current axes with the mouse? Try this one!

With GINPUT2 you can also:
1. ZOOM: in, out (double-click)!
2. PAN: when dragging!
3. DELETE: last selected point!
4. PLOT: while selecting! (optional, just input the line style!)
5. SCALE or GEOREFERENCE images! (optional, just input: true)

So, besides of selecting points in a more precise way (zooming) you can DIGITIZE(!!!) lines with the last two options, by simply using:
>> ginput2(true,'.k')

Enjoy it!
Bug reports and comments will be very appreciated!

Comments and Ratings (11)

Zoidberg

GagoX

GagoX (view profile)

To deactivate the rezoom, just comment line 613

% Centers the selected point if ZOOM-IN: 29 SEP,2008
if all((lim~=zlim))
lim = [x+diff(lim(1:2))/2*[-1 1] y+diff(lim(3:4))/2*[-1 1]];
axis(lim) %Comment this line to deactivate recentering after each point selection
end

adi

adi (view profile)

needs one big improvement: when I zoom in, the image jumps every time I select a point! this is very annoying... otherwise, a very good tool

Genevieve

This looks very promising, but isn't working for me - I've tried various ways of running it, including the examples in the source, and every time I click on the plot it simply zooms in. I'm sure this isn't the expected behaviour - I can't get it to select any points at all, just zoom.

I'm using R2012a.

Sherif

Sherif (view profile)

Excellent work. Thank you very much.

Igor

Igor (view profile)

Mehdi

Mehdi (view profile)

Thanks for sharing such a useful code,
for my data, after running my code I get images for which I need the following action:
When selecting a part of image,I want Matlab to run my code for that area and calculate or graph other parameters for that part of image,
How can I do that?

Anilson

I take that back. It does work on 3 dimension picture.
I apologize.

Anilson

Olga Avila

This is really good!
It works perfect for me, and was exactly what I needed...
I just added a minor detail to plot a line from an input center point to the ginput point selected by the user (like a radial line). This was just to improve visualization for my needs.
Thank you very much!

Updates

1.4

v3.1 Now returns when N=1 and an "strange" KEY is pressed.

1.3

v3.0 Now allows panning while dragging. Some changes on help.

1.2

v2.1 Fixed bugs related with points delection. Added new 'keepzoom' feature.

1.1

Changed default YESERROR value and fixed a bug there. Changed behavior when N==1. Fixed bug with zoom out. Changed default selection keys. Changed default selection click mouse: from left one to the right one.

MATLAB Release
MATLAB 7.7 (R2008b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today