function fig = PLclassify(action, varargin)
% This is the machine-generated representation of a Handle Graphics object
% and its children.  Note that handle values may change when these objects
% are re-created. This may cause problems with any callbacks written to
% depend on the value of the handle at the time the object was saved.
% This problem is solved by saving the output as a FIG-file.
%
% To reopen this object, just type the name of the M-file at the MATLAB
% prompt. The M-file and its associated MAT-file must be on your path.
% 
% NOTE: certain newer features in MATLAB may not have been saved in this
% M-file due to limitations of this format, which has been superseded by
% FIG-files.  Figures which have been annotated using the plot editor tools
% are incompatible with the M-file/MAT-file format, and should be saved as
% FIG-files.

if nargin<1,
  action='InitializePLclassify';
end;

feval(action,varargin{:});
return;

function InitializePLclassify

load PLclassify
redgreenblue=[0.2157 .6353 .6353]*1.2;


h0 = figure('Color',[redgreenblue], ...
	'Colormap',mat0, ...
	'FileName','c:\plgui\mygui\PLclassify.m', ...
	'MenuBar','none', ...
	'PaperPosition',[18 180 576 432], ...
	'PaperUnits','points', ...
	'Units','normalized', ...
	'Position',[.3 0.3 0.55 0.55], ...
   'numbertitle','off', ...
	'Name','VPR Image Classification', ...
	'Tag','VPR Image Classification', ...
	'ToolBar','none');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.1705    0.6713    0.7052    0.1892], ...
	'Style','frame', ...
	'Tag','Frame1');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.1354 0.1800 0.5035 0.4478], ...
	'Style','frame', ...
	'Tag','Frame2');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.6474 0.1825 0.1925 0.4453], ...
	'Style','frame', ...
	'Tag','Frame3');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.4110 0.7746 0.1716 0.0507], ...
    'fontunits','normalized','fontsize',0.500, ...
	'String','Classification', ...
	'Style','checkbox', ...
   'Tag','Checkbox Classification', ...
   'Value',1);
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.4110 0.6986 0.2089 0.0507], ...
	'String','Feature Extraction', ...
    'fontunits','normalized','fontsize',0.500, ...
	'Style','checkbox', ...
   'Tag','Checkbox Feature Extraction', ...
   'Value',1);
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Max',99, ...
	'Min',1, ...
	'Position',[0.220385674931129 0.760456273764259 0.154269972451791 0.0506970849176172], ...
	'String',mat1, ...
    'fontunits','normalized','fontsize',0.500, ...
	'Style','popupmenu', ...
	'Tag','PopupMenu VPR#', ...
	'TooltipString','VPR Tow number', ...
	'Value',1);
stmp=str2mat('Select Classifier Type','Dual','COM-SVM','SBF-NN');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Max',99, ...
	'Min',1, ...
	'Position',[0.6057 0.7723 0.2327 0.0507], ...
	'String',stmp, ...
    'fontunits','normalized','fontsize',0.500, ...
	'Style','popupmenu', ...
	'Tag','PopupMenu ClassifierType', ...
	'TooltipString',['SBF-NN = Shape-Based-Features with Neural Network Classifier' char(10) 'COM-SVM = Co-Occurrence Matrix with Support Vector Machine' char(10) 'Dual = Both SBF-NN and COM-SVM'], ...
	'Value',1);
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.143250688705234 0.544993662864385 0.154269972451791 0.0506970849176172], ...
	'String','Base Path', ...
   'fontunits','normalized','fontsize',0.500, ...
	'Style','text', ...
	'Tag','StaticText Disc Name', ...
	'TooltipString','base path to data, e.g. c:\data');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.143250688705234 0.494296577946768 0.154269972451791 0.0506970849176172], ...
	'String','Cruise Name', ...
   'fontunits','normalized','fontsize',0.500, ...
	'Style','text', ...
	'Tag','StaticText Cruise Name', ...
	'TooltipString','Input Cruise Name');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[ 0.143250688705234 0.443599493029151 0.154269972451791 0.0506970849176172], ...
	'String','Julian Day', ...
   'fontunits','normalized','fontsize',0.500, ...
	'Style','text', ...
	'Tag','StaticText Julian Day#', ...
	'TooltipString','Julian Day as three characters (e.g., 045)');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[ 0.143250688705234 0.392902408111534 0.154269972451791 0.0506970849176172], ...
	'String','Start Hour', ...
   'fontunits','normalized','fontsize',0.500, ...
	'Style','text', ...
	'Tag','StaticText Start Hour', ...
	'TooltipString','Start Hour for ROI feature extraction and classification');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.143250688705234 0.342205323193916 0.154269972451791 0.0506970849176172], ...
	'String','End Hour', ...
   'fontunits','normalized','fontsize',0.500, ...
	'Style','text', ...
	'Tag','StaticText End Hour', ...
	'TooltipString','End Hour for ROI feature extraction and classification');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.143250688705234 0.291508238276299 0.154269972451791 0.0506970849176172 ], ...
	'String','Classifier Name', ...
   'fontunits','normalized','fontsize',0.500, ...
	'Style','text', ...
	'TooltipString','Classifier Root File Name, (i.e., do not include dual.mat, svm.mat, or nn.mat)', ...
   'Tag','StaticText Classifier Name');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.1], ...
	'ListboxTop',0, ...
	'Position',[0.143250688705234 0.240811153358682 0.154269972451791 0.0506970849176172 ], ...
	'String','Autoid Base Path', ...
   'fontunits','normalized','fontsize',0.500, ...
	'Style','text', ...
	'TooltipString','Base Path for Automatic Identification results (e.g. c:\data)', ...
	'Tag','StaticText Autoid Disc');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.2], ...
	'ListboxTop',0, ...
	'Callback','plmain', ...
	'Position',[0.694214876033058 0.506970849176172 0.110192837465565 0.0506970849176172], ...
   'fontunits','normalized','fontsize',0.500, ...
	'String','START', ...
	'TooltipString','Start Feature Extraction and Classification', ...
	'Tag','Pushbutton Start');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.2], ...
	'Callback','classify_help', ...
	'ListboxTop',0, ...
	'Position',[0.694214876033058 0.380228136882129 0.110192837465565 0.0506970849176172], ...
   'fontunits','normalized','fontsize',0.500, ...
	'String','HELP', ...
	'Tag','Pushbutton Help');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[[redgreenblue]*1.2], ...
	'ListboxTop',0, ...
	'Position',[0.694214876033058 0.253485424588086 0.110192837465565 0.0506970849176172 ], ...
	'String','EXIT', ...
    'fontunits','normalized','fontsize',0.500, ...
	'Callback','close(gcbf)', ...
	'Tag','Pushbutton Exit');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Position',[0.330578512396694 0.55766793409379 0.220385674931129 0.0456273764258555], ...
	'String','c:\data', ...
    'fontunits','normalized','fontsize',0.600, ...
	'Style','edit', ...
	'TooltipString','Enter base path of ROIs (e.g., c:\data)', ...
	'Tag','EditText Disc Name');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Position',[0.330578512396694 0.506970849176172 0.220385674931129 0.0456273764258555], ...
	'String','knorr172', ...
    'fontunits','normalized','fontsize',0.600, ...
	'Style','edit', ...
	'Tag','EditText Cruise Name');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Position',[0.330578512396694 0.456273764258555 0.220385674931129 0.0456273764258555], ...
   'fontunits','normalized','fontsize',0.600, ...
	'String','045', ...
	'Style','edit', ...
	'TooltipString','Enter Julian Day as three characters (e.g., 045)', ...
	'Tag','EditText Julian Day#');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Position',[0.330578512396694 0.405576679340938 0.220385674931129 0.0456273764258555], ...
	'String','04', ...
   'fontunits','normalized','fontsize',0.600, ...
	'Style','edit', ...
	'Tag','EditText Start Hour');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Position',[0.330578512396694 0.354879594423321 0.220385674931129 0.0456273764258555], ...
	'String','23', ...
   'fontunits','normalized','fontsize',0.600, ...
	'Style','edit', ...
	'Tag','EditText End Hour');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Position',[0.330578512396694 0.304182509505703 0.220385674931129 0.0456273764258555], ...
	'String','classifier', ...
   'fontunits','normalized','fontsize',0.600, ...
	'Style','edit', ...
	'TooltipString','Enter Classifier Root File Name (from Step 4; do not include dual.mat, svm.mat, nn.mat)', ...
    'Tag','EditText Classifier File');
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Position',[0.330578512396694 0.253485424588086 0.220385674931129 0.0456273764258555 ], ...
	'String','c:\data', ...
   'fontunits','normalized','fontsize',0.600, ...
	'Style','edit', ...
	'Tag','EditText Autoid Disc');
if nargout > 0, fig = h0; end

function copyclpar

h=gcbf;
if ~isempty(h)
  h1=findobj(h,'Tag','EditText Disc Name');
  disc=get(h1,'String');
  h1=findobj(h,'Tag','EditText Cruise Name');
  cruise=get(h1,'String');
  pathname1=[disc,filesep,cruise,filesep,'clpar',filesep];
  h1=findobj(h,'Tag','EditText Classifier File');
  classifiername=get(h1,'string');
  h1=findobj(h,'Tag','EditText Autoid Disc');
  autoidisc=get(h1,'string');
  pathname2=[autoidisc,filesep,cruise,filesep,'clpar',filesep];
  if ~strcmp(pathname1,pathname2),
     dos(['xcopy ' pathname1 classifiername 'nn.mat ' pathname2 ' /Y']);
  end;
end

