File Exchange

image thumbnail

IMAGEVIEWER

version 1.3.0.1 (644 KB) by jiro
A GUI for viewing and interactively exploring image files.

13 Downloads

Updated 01 Sep 2016

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

IMAGEVIEWER Interactively pan and zoom images on the computer.
IMAGEVIEWER starts a GUI for opening image files and interactive panning and zooming.

IMAGEVIEWER(DIRNAME) starts the GUI with DIRNAME as the initial directory.

The GUI allows you to navigate through your computer and quickly view image files. It also allows you to interactively explore your images by panning (clicking and drag), zooming (right-click and drag), and centering view (double-clicking).

This is implemented using MATLAB Classes. It requires MATLAB R2008a or newer.

Comments and Ratings (15)

Liwei

Excellent tool. It works for my Matlab 2013a WIN64 BIT. I have a question: I want to add displaying the boundingboc and detected areas on the image. Can this be compiled as a matlab standalone application?

thanks!

Jeff

Attempted to install APP and run in MATLAB Version 8.1.0.604 (R2013a)...

GUI starts up and allows a directory selection, but causes MATLAB to crash non-gracefully shortly after the list of files is populated.

Has anyone else experienced this behavior and is there a preventative fix?

Thanks,
-Jeff

Gilles

Jiro,
Thank you ! ImageViewer is an excellent GUI implemented using matlab classes !
I try to use interactive panning and zooming with the matlab preview fcn of live video data.
I coded that :

% --- Executes on button press in Preview.
function PreviewFcn(varargin)
camobj = obj.camobj;
vidRes = get(camobj, 'VideoResolution');

imWidth = vidRes(1);
imHeight = vidRes(2);
nBands = get(camobj, 'NumberOfBands');

% create an empty image container and show it on axPreview
iH = image(zeros(imHeight,imWidth, nBands), 'parent', obj.handles.ImageAxes);
preview(camobj, iH);
end

Zoom seems to work on live video data, but pan doesn't work.
Could you help me?

Gilles

Gilles

mhmmrm

not so much handy enough,try to add some extra features.:D

Jiro Doke

Tim Tam,
I didn't code it so that you can extract the selected file name through the handles. Also, I made the GUI "HanldeVisibiltiy" to "off" on purpose so that it can't be accessed from the Command Window. That's why "gcf" and "gca" doesn't see it.

If you need to access the inner workings, I suggest you take a look inside the m-code. When I create the initial figure, I set the "HandleVisibility". You can change that to "on". Also, there's a place in the code that I extract the file name from the list box.

Tim Tam

How can one retrieve the name of the image file that the user has selected ?
I've tried returning then querying various handles, but can't get any approach to work.
Also gcf and gca don't seem to work with the viewer - when issued they create new figures / axes.

Edward Chao

Excellent examples of using the object callbacks (ButtonDownFcn, WindowButtonMotionFcn, WindowButtonUpFcn) for panning and zooming. I was looking for some good examples for a long time. Thank you very much!

Martin Fon

This is a very good job. Could it be used for cropping?

Tamir Suliman

Thats a very nice job great

Luis Nieto

Excellent job, works fine in R14 too.

Christian Schultes

Jiro,
It works very well with R14SP1 - I am very impressed. Thank you!
Very soon I do need only Matlab - when is the Office tool available to replace Word?

Jiro Doke

The program currently does not work on certain images. A new version will be posted in the next couple of days. Thanks.

Updates

1.3.0.1

Updated license

1.3.0.0

Updated to include an App file for R2012b

1.2.0.0

Implemented in MATLAB Classes

1.1.0.0

Copyright update. Added scroll wheel zoom.

1.0.0.0

Cosmetic changes to the GUI. A better TIMER management.

Bug fix for image centering feature. Also allow the window to be resized (without distortion of components)

Bug fixes. Make sure it works with various image types.

It actually works in R14 or later.

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux