from
iScribble: A java based GUI for Matlab
by Adarsh Kowdle
iScribble, is a reconfigurable GUI, with a JAVA front-end and a Matlab back-end.
|
| main_app
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FUNCTION_NAME - main_app
%
% Syntax: main_app
%
% NOTE: Please set the absolute path for the working directory as denoted
%
% Inputs:
% NONE
%
% Outputs:
% NONE
%
% Author: Adarsh Kowdle
% email: apk64@cornell.edu
% Last revision: 02-June-2009
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% GUI main application
function main_app
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
warning off
clc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Working directory - SET PATH
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
working_dir = 'C:\Users\Adarsh\Desktop\iScribble';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add the javapath
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
javaaddpath java_gui;
% Import the class
import SquiggleFrame.*;
warning on
display('Launching the gui...');
% Folder which contains all the images
im_dir = fullfile(working_dir, 'images');
% Folder for all java temporary files
java_tmp_dir = fullfile(working_dir, 'java_tmp');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% List of all the images in the folder
im_list = dir(fullfile(im_dir,'*.jpg'));
img_files = {};
for p_file = 1:length(im_list)
% Save array of image file names for the java method
img_files = [img_files fullfile(im_dir,im_list(p_file).name)];
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The java code can handle displaying the images as well as the
% corresponding groundtruth ( in case of segmentation ) --> will need some
% changes to the java script
%
% The actual syntax would then be [image_files groundtruth_files Width Height]
% Width and Height define size of each image on the panel --> you can
% change this based on the size of your computer screen
%
% In our case however, only images are being shown and so img_files is used
% twice
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
img_files = [img_files img_files '175' '175'];
% Java frame handle
frame_handle = javaMethod('init', 'SquiggleFrame', img_files);
% Squiggle object handle
squiggle_handle = frame_handle.getSquiggle();
% call script to extract information from scribbles
script_use_scribbles;
% Dispose all the components of the gui
frame_handle.dispose();
clc;
disp('Thank you for using our gui!');
end
|
|
Contact us at files@mathworks.com